[libgit2-glib] Cleanly separate built sources
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Cleanly separate built sources
- Date: Sun, 21 Dec 2014 10:35:38 +0000 (UTC)
commit 48c030a5cd3c8ff440bb1ea810e5f34a0f141bf9
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sun Dec 21 11:34:35 2014 +0100
Cleanly separate built sources
This fixes building from builddir != srcdir
examples/Makefile.am | 6 ++++-
examples/clone.c | 3 +-
examples/general.c | 2 +-
examples/walk.c | 2 +-
libgit2-glib/Makefile.am | 49 +++++++++++++++++++++++++++------------------
tests/Makefile.am | 6 ++++-
tests/repository.c | 2 +-
7 files changed, 44 insertions(+), 26 deletions(-)
---
diff --git a/examples/Makefile.am b/examples/Makefile.am
index a3267b3..b15b040 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,4 +1,8 @@
-AM_CPPFLAGS = -g -I$(top_srcdir) -I$(top_srcdir)/libgit2-glib $(LIBGIT2_GLIB_CFLAGS)
+AM_CPPFLAGS = \
+ -g \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(LIBGIT2_GLIB_CFLAGS)
noinst_PROGRAMS = $(EXAMPLE_PROGS)
progs_ldadd = $(top_builddir)/libgit2-glib/libgit2-glib-1.0.la $(LIBGIT2_GLIB_LIBS)
diff --git a/examples/clone.c b/examples/clone.c
index c51dcd1..cc3fe2f 100644
--- a/examples/clone.c
+++ b/examples/clone.c
@@ -3,7 +3,8 @@
#include <termios.h>
#include <string.h>
#include <glib/gprintf.h>
-#include "ggit.h"
+
+#include "libgit2-glib/ggit.h"
typedef struct
{
diff --git a/examples/general.c b/examples/general.c
index 082af4e..1d16111 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -20,7 +20,7 @@
#include <glib.h>
-#include "ggit.h"
+#include "libgit2-glib/ggit.h"
int
main (int argc, char *argv[])
diff --git a/examples/walk.c b/examples/walk.c
index 2494fcc..7f8b96c 100644
--- a/examples/walk.c
+++ b/examples/walk.c
@@ -21,7 +21,7 @@
#include <gio/gio.h>
#include <glib/gprintf.h>
-#include "ggit.h"
+#include "libgit2-glib/ggit.h"
static gchar *
signature_to_string (GgitSignature *signature)
diff --git a/libgit2-glib/Makefile.am b/libgit2-glib/Makefile.am
index 3dd0f65..194e4ae 100644
--- a/libgit2-glib/Makefile.am
+++ b/libgit2-glib/Makefile.am
@@ -2,6 +2,7 @@ lib_LTLIBRARIES = libgit2-glib-1.0.la
AM_CPPFLAGS = \
-I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(srcdir) \
$(LIBGIT2_GLIB_CFLAGS) \
$(WARN_CFLAGS) \
@@ -15,7 +16,7 @@ libgit2_glib_1_0_la_LDFLAGS = \
libgit2_glib_1_0_la_LIBADD = $(LIBGIT2_GLIB_LIBS)
-INST_H_FILES = \
+H_FILES = \
ggit-blame.h \
ggit-blame-options.h \
ggit-blob.h \
@@ -73,12 +74,10 @@ INST_H_FILES = \
ggit-tree.h \
ggit-tree-builder.h \
ggit-tree-entry.h \
- ggit-types.h \
- ggit.h
+ ggit-types.h
-NOINST_H_FILES = \
- ggit-convert.h \
- ggit-utils.h
+BUILT_H_FILES = ggit.h
+BUILT_H_FILES_ENUMS = ggit-enum-types.h
C_FILES = \
ggit-blame.c \
@@ -142,37 +141,45 @@ C_FILES = \
ggit-types.c \
ggit-utils.c
+BUILT_C_FILES =
+BUILT_C_FILES_ENUMS = ggit-enum-types.c
+
if GIT_SSH
C_FILES += \
ggit-cred-ssh-interactive.c \
ggit-cred-ssh-key-from-agent.c
-INST_H_FILES += \
+H_FILES += \
ggit-cred-ssh-interactive.h \
ggit-cred-ssh-key-from-agent.h
endif
-ENUM_TYPES = \
- $(INST_H_FILES)
+BUILT_SOURCES = $(BUILT_C_FILES) $(BUILT_C_FILES_ENUMS) $(BUILT_H_FILES) $(BUILT_H_FILES_ENUMS)
+
+INST_H_FILES = $(H_FILES) $(BUILT_H_FILES) $(BUILT_H_FILES_ENUMS)
-ggit-enum-types.h: ggit-enum-types.h.template $(ENUM_TYPES) $(GLIB_MKENUMS)
- $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template ggit-enum-types.h.template $(ENUM_TYPES)) > $@
+NOINST_H_FILES = \
+ ggit-convert.h \
+ ggit-utils.h
+
+ENUM_TYPES = \
+ $(H_FILES)
-ggit-enum-types.c: ggit-enum-types.c.template $(ENUM_TYPES) $(GLIB_MKENUMS)
- $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template ggit-enum-types.c.template $(ENUM_TYPES)) > $@
+ggit-enum-types.h: ggit-enum-types.h.template $(H_FILES) $(BUILT_H_FILES) $(GLIB_MKENUMS)
+ $(AM_V_GEN) (cd $(builddir) && $(GLIB_MKENUMS) --template $(srcdir)/ggit-enum-types.h.template
$(addprefix $(srcdir)/,$(H_FILES)) $(BUILT_H_FILES)) > $@
-BUILT_SOURCES = \
- ggit-enum-types.c \
- ggit-enum-types.h
+ggit-enum-types.c: ggit-enum-types.c.template $(H_FILES) $(BUILT_H_FILES) $(GLIB_MKENUMS)
+ $(AM_V_GEN) (cd $(builddir) && $(GLIB_MKENUMS) --template $(srcdir)/ggit-enum-types.c.template
$(addprefix $(srcdir)/,$(H_FILES)) $(BUILT_H_FILES)) > $@
libgit2_glib_1_0_la_SOURCES = \
$(INST_H_FILES) \
$(NOINST_H_FILES) \
- $(BUILT_SOURCES) \
+ $(BUILT_C_FILES) \
+ $(BUILT_C_FILES_ENUMS) \
$(C_FILES)
headerdir = $(prefix)/include/libgit2-glib-1.0/libgit2-glib
-header_DATA = $(INST_H_FILES) ggit-enum-types.h
+header_DATA = $(INST_H_FILES)
if ENABLE_PYTHON
overridesdir = $(pyoverridesdir)
@@ -194,18 +201,20 @@ if HAVE_INTROSPECTION
INTROSPECTION_SCANNER_ENV = CC="$(CC)"
INTROSPECTION_SCANNER_ARGS = \
-I$(top_srcdir) \
+ -I$(top_builddir) \
--identifier-prefix=Ggit \
--c-include=libgit2-glib/ggit.h \
--warn-all
- introspection_sources = $(INST_H_FILES) $(C_FILES)
+ introspection_src_sources = $(H_FILES) $(C_FILES)
+ introspection_built_sources = $(BUILT_SOURCES)
Ggit-1.0.gir: libgit2-glib-1.0.la
Ggit_1_0_gir_NAMESPACE = Ggit
Ggit_1_0_gir_INCLUDES = GObject-2.0 GLib-2.0 Gio-2.0
Ggit_1_0_gir_CFLAGS = $(LIBGIT2_GLIB_CFLAGS)
Ggit_1_0_gir_LIBS = libgit2-glib-1.0.la
- Ggit_1_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_sources))
+ Ggit_1_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_src_sources)) $(introspection_built_sources)
Ggit_1_0_gir_PACKAGES = gobject-2.0 glib-2.0 libgit2 gio-2.0
Ggit_1_0_gir_EXPORT_PACKAGES = libgit2-glib-1.0
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3efe87b..66f8b3d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,8 @@
-AM_CPPFLAGS = -g -I$(top_srcdir) -I$(top_srcdir)/libgit2-glib $(LIBGIT2_GLIB_CFLAGS)
+AM_CPPFLAGS = \
+ -g \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(LIBGIT2_GLIB_CFLAGS)
noinst_PROGRAMS = $(TEST_PROGS)
progs_ldadd = $(top_builddir)/libgit2-glib/libgit2-glib-1.0.la $(LIBGIT2_GLIB_LIBS)
diff --git a/tests/repository.c b/tests/repository.c
index 0592970..7396ef7 100644
--- a/tests/repository.c
+++ b/tests/repository.c
@@ -31,7 +31,7 @@
#include <glib.h>
#include <glib/gstdio.h>
-#include "ggit.h"
+#include "libgit2-glib/ggit.h"
#define TESTREPO_NAME "testrepo.git"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]