[gtk+/introspection: 11/11] Use Makefile.introspection



commit 62b169be6a69386d0654faf6d95cb8fa1444b61a
Author: Johan Dahlin <johan gnome org>
Date:   Mon Dec 14 21:47:39 2009 -0200

    Use Makefile.introspection
    
    Use the new fancy rules from the Makefile.introspection, it makes
    the rules prettier and avoids quite a bit of duplication

 gdk-pixbuf/Makefile.am |   38 ++++++++++++++++----------------------
 gdk/Makefile.am        |   42 +++++++++++++++++++-----------------------
 gtk/Makefile.am        |   45 ++++++++++++++++++++++-----------------------
 3 files changed, 57 insertions(+), 68 deletions(-)
---
diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
index 90346fe..4384372 100644
--- a/gdk-pixbuf/Makefile.am
+++ b/gdk-pixbuf/Makefile.am
@@ -1,4 +1,7 @@
 include $(top_srcdir)/Makefile.decl
+include $(INTROSPECTION_MAKEFILE)
+
+INTROSPECTION_GIRS =
 
 SUBDIRS = pixops
 
@@ -687,32 +690,23 @@ EXTRA_DIST +=					\
 	gen-color-table.pl
 
 if HAVE_INTROSPECTION
-BUILT_GIRSOURCES =
-
-GdkPixbuf-2.0.gir: $(INTROSPECTION_SCANNER) libgdk_pixbuf-2.0.la Makefile
-	$(INTROSPECTION_SCANNER) -v \
-		--namespace GdkPixbuf --nsversion=2.0 --strip-prefix=Gdk \
-		$(INCLUDES) \
-		--include=Gio-2.0 \
-		--include=GModule-2.0 \
-		--library=libgdk_pixbuf-2.0.la \
-		--libtool="$(LIBTOOL)" \
-	        --output $@ \
-		$(addprefix $(srcdir)/,$(libgdk_pixbufinclude_HEADERS)) \
-		$(addprefix $(srcdir)/,$(libgdk_pixbuf_2_0_la_SOURCES))
-BUILT_GIRSOURCES += GdkPixbuf-2.0.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
 
-typelibsdir = $(libdir)/girepository-1.0/
+GdkPixbuf_2_0_gir_SCANNERFLAGS = --strip-prefix=Gdk
+GdkPixbuf_2_0_gir_INCLUDES = GModule-2.0 Gio-2.0
+GdkPixbuf_2_0_gir_LIBS = libgdk_pixbuf-2.0.la
+GdkPixbuf_2_0_gir_CFLAGS = $(INCLUDES)
+GdkPixbuf_2_0_gir_FILES = \
+    $(addprefix $(srcdir)/,$(libgdk_pixbufinclude_HEADERS)) \
+    $(addprefix $(srcdir)/,$(libgdk_pixbuf_2_0_la_SOURCES))
+INTROSPECTION_GIRS += GdkPixbuf-2.0.gir
 
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+girdir = $(INTROSPECTION_GIRDIR)
+dist_gir_DATA = $(INTROSPECTION_GIRS)
 
-%.typelib: %.gir $(INTROSPECTION_COMPILER)
-	$(DEBUG) $(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+typelibsdir = $(INTROSPECTION_TYPELIBDIR)
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
 endif
 
 if CROSS_COMPILING
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index c579a87..876b5f4 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -1,5 +1,13 @@
 ## Makefile.am for gtk+/gdk
 include $(top_srcdir)/Makefile.decl
+include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = \
+   --add-include-path=../gdk-pixbuf
+INTROSPECTION_COMPILER_ARGS = \
+   --includedir=$(srcdir) \
+   --includedir=. \
+   --includedir=../gdk-pixbuf
 
 SUBDIRS = $(gdktarget) . tests
 DIST_SUBDIRS = win32 x11 quartz directfb tests
@@ -185,7 +193,6 @@ libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.
 libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
 
 if HAVE_INTROSPECTION
-BUILT_GIRSOURCES =
 
 introspection_files = \
 		$(gdk_public_h_sources) \
@@ -193,31 +200,20 @@ introspection_files = \
         gdkenumtypes.c \
         gdkenumtypes.h
 
-Gdk-2.0.gir: $(INTROSPECTION_SCANNER) $(gdktargetlib) Makefile
-	$(INTROSPECTION_SCANNER) -v \
-		--namespace Gdk --nsversion=2.0 --strip-prefix=Gdk \
-		$(INCLUDES) \
-		--include=Gio-2.0 \
-		--add-include-path=../gdk-pixbuf \
-		--include=GdkPixbuf-2.0 \
-		--include=Pango-1.0 \
-		--library=$(gdktargetlib) \
-		--libtool="$(LIBTOOL)" \
-	        --output $@ \
-		$(addprefix $(srcdir)/,$(introspection_files))
-BUILT_GIRSOURCES += Gdk-2.0.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
-
-typelibsdir = $(libdir)/girepository-1.0/
+Gdk_2_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf
+Gdk_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0
+Gdk_2_0_gir_LIBS = $(gdktargetlib)
+Gdk_2_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
+Gdk_2_0_gir_CFLAGS = $(INCLUDES)
+INTROSPECTION_GIRS += Gdk-2.0.gir
 
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+girdir = $(INTROSPECTION_GIRDIR)
+dist_gir_DATA = $(INTROSPECTION_GIRS)
 
-%.typelib: %.gir $(INTROSPECTION_COMPILER)
-	$(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. --includedir=../gdk-pixbuf $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+typelibsdir = $(INTROSPECTION_TYPELIBDIR)
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
 
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
 endif
 
 if OS_WIN32
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index cfeebea..d55c031 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1,5 +1,15 @@
 # Makefile.am for gtk+/gtk
 include $(top_srcdir)/Makefile.decl
+include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = \
+	--add-include-path=../gdk-pixbuf \
+	--add-include-path=../gdk
+INTROSPECTION_COMPILER_ARGS = \
+	--includedir=$(srcdir) \
+    --includedir=. \
+    --includedir=../gdk-pixbuf \
+    --includedir=../gdk
 
 if USE_QUARTZ
 GTK_PRINT_PREVIEW_COMMAND="open -a /Applications/Preview.app %f"
@@ -962,8 +972,6 @@ LDADDS =								\
 	$(top_builddir)/gdk/$(gdktargetlib)
 
 if HAVE_INTROSPECTION
-BUILT_GIRSOURCES =
-
 introspection_files = \
     $(gtkinclude_HEADERS) \
     $(gtk_all_c_sources) \
@@ -971,33 +979,24 @@ introspection_files = \
     gtktypebuiltins.c
 
 Gtk-2.0.gir: $(INTROSPECTION_SCANNER) $(gtktargetlib) Makefile
-	$(INTROSPECTION_SCANNER) -v \
-		--namespace Gtk --nsversion=2.0 --strip-prefix=Gtk \
+Gtk_2_0_gir_SCANNERFLAGS = --strip-prefix=Gtk
+Gtk_2_0_gir_INCLUDES = Atk-1.0 Gdk-2.0
+Gtk_2_0_gir_CFLAGS = \
 		$(INCLUDES) \
-		--add-include-path=../gdk \
-		--add-include-path=../gdk-pixbuf \
-		--include=Gdk-2.0 \
-		--include=Atk-1.0 \
-		--library=$(gtktargetlib) \
-		--libtool="$(LIBTOOL)" \
-	        --output $@ \
 		-UGDK_DISABLE_DEPRECATED \
 		-UGTK_DISABLE_DEPRECATED \
-		-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API \
-		$(addprefix $(srcdir)/, $(introspection_files))
-BUILT_GIRSOURCES += Gtk-2.0.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
-
-typelibsdir = $(libdir)/girepository-1.0/
+		-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
+Gtk_2_0_gir_LIBS = $(gtktargetlib)
+Gtk_2_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files))
+INTROSPECTION_GIRS += Gtk-2.0.gir
 
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+girdir = $(INTROSPECTION_GIRDIR)
+dist_gir_DATA = $(INTROSPECTION_GIRS)
 
-%.typelib: %.gir $(INTROSPECTION_COMPILER)
-	$(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. --includedir=../gdk-pixbuf --includedir=../gdk $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+typelibsdir = $(INTROSPECTION_TYPELIBDIR)
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
 endif
 
 #



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]