Skip to content
Browse files

do not generate .gir.[ch] everytime

  • Loading branch information...
1 parent 2fbee01 commit fca57e3a517b89b0cd7d8167137407aeab9edd16 @tagoh committed Oct 12, 2012
Showing with 26 additions and 8 deletions.
  1. +13 −8 liblangtag-gobject/Makefile.am
  2. +13 −0 liblangtag-gobject/gendeps.sh
View
21 liblangtag-gobject/Makefile.am
@@ -17,8 +17,9 @@ LIBS = \
$(GOBJECT_LIBS) \
$(top_builddir)/liblangtag/liblangtag.la \
$(NULL)
-EXTRA_DIST = \
- gengir.sh \
+EXTRA_DIST = \
+ gengir.sh \
+ gendeps.sh \
$(NULL)
MAINTAINERCLEANFILES = \
$(stamp_files) \
@@ -29,11 +30,13 @@ CLEANFILES = \
$(liblangtag_gobject_built_sources) \
xgen-lefh \
xgen-lefc \
+ gir.deps \
$(NULL)
BUILT_FILES = \
$(liblangtag_gobject_built_public_headers) \
$(liblangtag_gobject_built_private_headers) \
$(liblangtag_gobject_built_sources) \
+ gir.deps \
$(NULL)
INTROSPECTION_GIRS =
@@ -145,7 +148,7 @@ liblangtag_gobject_la_LDFLAGS = \
$(NULL)
#
if HAVE_INTROSPECTION
-lt_headers = $(liblangtag_gobject_private_headers:.gir.h=.h)
+lt_headers = $(liblangtag_gobject_built_private_headers:.gir.h=.h)
lt_sources = $(liblangtag_gobject_built_sources:.gir.c=.c)
introspection_sources = \
$(liblangtag_gobject_built_private_headers) \
@@ -154,12 +157,14 @@ introspection_sources = \
$(liblangtag_gobject_sources) \
$(NULL)
-%.gir.h: $(top_builddir)/liblangtag/liblangtag.la gengir.sh Makefile
- $(AM_V_GEN) $(srcdir)/gengir.sh $(top_srcdir)/liblangtag $@
-%.gir.c: $(top_builddir)/liblangtag/liblangtag.la gengir.sh Makefile
- $(AM_V_GEN) $(srcdir)/gengir.sh $(top_srcdir)/liblangtag $@
+SUFFIXES = .gir.h .gir.c
-LangTag-0.2.gir: liblangtag-gobject.la Makefile
+gir.deps: $(srcdir)/gendeps.sh Makefile
+ $(AM_V_GEN) $(srcdir)/gendeps.sh $(top_srcdir)/liblangtag $(lt_headers) $(lt_sources) > $@
+
+-include gir.deps
+
+LangTag-0.2.gir: gir.deps liblangtag-gobject.la Makefile
LangTag_0_2_gir_INCLUDES = \
GLib-2.0 \
GObject-2.0 \
View
13 liblangtag-gobject/gendeps.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+srcdir=$1
+shift
+
+while [ $# -ne 0 ]; do
+ f=$1
+ shift
+ x=`echo $f|sed -e 's,\.\([ch]\),.gir.\1,g'`
+ echo "$x: $srcdir/$f \$(srcdir)/gengir.sh Makefile"
+ echo " \$(AM_V_GEN) \$(srcdir)/gengir.sh \$(top_srcdir)/liblangtag \$@"
+done
+echo "\$(srcdir)/gendir.sh:"

0 comments on commit fca57e3

Please sign in to comment.
Something went wrong with that request. Please try again.