1 include $(top_srcdir)/common.mk
17 EXTRA_DIST += $(BASE_GIRSOURCES)
20 GLIB_INCLUDEDIR=`pkg-config --variable=includedir glib-2.0`/glib-2.0
21 GLIB_LIBDIR=`pkg-config --variable=libdir glib-2.0`
24 GLIB_LIBRARY=libglib-2.0-0
29 GLib-2.0.gir: $(SCANNER_BIN) $(SCANNER_LIBS) Makefile glib-2.0.c
31 --namespace GLib --nsversion=2.0 \
35 --libtool="$(SHAVE_SAVED_LIBTOOL)" \
36 --c-include="glib.h" \
37 --library=$(GLIB_LIBRARY) \
40 -I$(GLIB_INCLUDEDIR) \
41 -I$(GLIB_LIBDIR)/glib-2.0/include \
42 -DGETTEXT_PACKAGE=Dummy \
44 $(GLIB_LIBDIR)/glib-2.0/include/glibconfig.h \
45 $(srcdir)/glib-2.0.c \
47 $(GLIB_INCLUDEDIR)/glib/*.h
48 $(SCANNER) $(SCANNER_ARGS) \
49 --xpath-assertions=$(srcdir)/GLib-2.0.xpath GLib-2.0.gir
50 BUILT_GIRSOURCES += GLib-2.0.gir
51 EXTRA_DIST += glib-2.0.c GLib-2.0.xpath
54 GOBJECT_INCLUDEDIR=`pkg-config --variable=includedir gobject-2.0`/glib-2.0
55 GOBJECT_LIBDIR=`pkg-config --variable=libdir gobject-2.0`
58 GOBJECT_LIBRARY=libgobject-2.0-0
60 GOBJECT_LIBRARY=gobject-2.0
63 GObject-2.0.gir: GLib-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
65 --namespace GObject --nsversion=2.0 \
69 --libtool="$(SHAVE_SAVED_LIBTOOL)" \
70 --c-include="glib-object.h" \
72 --library=$(GOBJECT_LIBRARY) \
73 -I$(GOBJECT_INCLUDEDIR) \
74 -I$(GOBJECT_LIBDIR)/glib-2.0/include \
75 -DGOBJECT_COMPILATION \
77 $(srcdir)/gobject-2.0.c \
78 $(GLIB_INCLUDEDIR)/gobject/*.h
79 $(SCANNER) $(SCANNER_ARGS) \
80 --xpath-assertions=$(srcdir)/GObject-2.0.xpath GObject-2.0.gir
81 BUILT_GIRSOURCES += GObject-2.0.gir
82 EXTRA_DIST += gobject-2.0.c GObject-2.0.xpath
85 GMODULE_INCLUDEDIR=`pkg-config --variable=includedir gmodule-2.0`/glib-2.0
86 GMODULE_LIBDIR=`pkg-config --variable=libdir gmodule-2.0`
89 GMODULE_LIBRARY=libgmodule-2.0-0
91 GMODULE_LIBRARY=gmodule-2.0
94 GModule-2.0.gir: GLib-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS)
96 --namespace GModule --nsversion=2.0 \
97 --add-include-path=. \
101 --libtool="$(SHAVE_SAVED_LIBTOOL)" \
102 --c-include="gmodule.h" \
104 --library=$(GMODULE_LIBRARY) \
105 -I$(GMODULE_INCLUDEDIR) \
106 -I$(GMODULE_LIBDIR)/glib-2.0/include \
108 $(GLIB_INCLUDEDIR)/gmodule.h
109 BUILT_GIRSOURCES += GModule-2.0.gir
112 GIO_INCLUDEDIR=`pkg-config --variable=includedir gio-2.0`/glib-2.0
113 GIO_LIBDIR=`pkg-config --variable=libdir gio-2.0`
116 GIO_LIBRARY=libgio-2.0-0
122 GIO_UNIX_HDRS=`pkg-config --variable=includedir gio-unix-2.0`/gio-unix-2.0/gio/*.h
127 Gio-2.0.gir: GObject-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile $(srcdir)/gio-2.0.c
129 --namespace Gio --nsversion=2.0 \
130 --add-include-path=. \
134 --libtool="$(SHAVE_SAVED_LIBTOOL)" \
135 --c-include="gio/gio.h" \
136 --include=GObject-2.0 \
137 --library=$(GIO_LIBRARY) \
138 -I$(GIO_INCLUDEDIR) \
139 -I$(GIO_LIBDIR)/glib-2.0/include \
142 $(srcdir)/gio-2.0.c \
143 $(GLIB_INCLUDEDIR)/gio/*.h \
145 BUILT_GIRSOURCES += Gio-2.0.gir
146 EXTRA_DIST += gio-2.0.c
149 GIREPOSITORY_FILES = \
150 $(top_srcdir)/girepository/girepository.c \
151 $(top_srcdir)/girepository/girepository.h
153 GIRepository-2.0.gir: GObject-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) $(GIREPOSITORY_FILES)
155 --namespace GIRepository --nsversion=2.0 \
159 --libtool="$(SHAVE_SAVED_LIBTOOL)" \
160 --c-include="girepository.h" \
161 --include=GObject-2.0 \
162 --library=girepository-1.0 \
163 -I$(srcdir)/girepository \
166 $(GIREPOSITORY_FILES)
167 BUILT_GIRSOURCES += GIRepository-2.0.gir
172 LT_VERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
173 TYPELIB_VERSION = $(LT_CURRENT).0
175 lib_LTLIBRARIES = libgirepository-everything-1.0.la
177 libgirepository_everything_1_0_la_SOURCES = $(srcdir)/everything.c $(srcdir)/everything.h
178 libgirepository_everything_1_0_la_CFLAGS = $(GOBJECT_CFLAGS)
179 libgirepository_everything_1_0_la_LDFLAGS = -version-info $(LT_VERSION)
180 libgirepository_everything_1_0_la_LIBADD = $(GOBJECT_LIBS)
183 libgirepository_everything_1_0_la_LDFLAGS += -no-undefined
186 Everything-$(TYPELIB_VERSION).gir: libgirepository-everything-1.0.la everything.c everything.h $(SCANNER_BIN) $(SCANNER_LIBS)
187 LPATH=$(builddir)/.libs $(CHECK_DEBUG) $(SCANNER) \
188 --include=GObject-2.0 \
189 --libtool="$(SHAVE_SAVED_LIBTOOL)" \
190 --library=girepository-everything-1.0 \
191 --namespace=Everything --nsversion=$(TYPELIB_VERSION) \
193 $(srcdir)/everything.h $(srcdir)/everything.c \
195 BUILT_GIRSOURCES += Everything-$(TYPELIB_VERSION).gir
196 EXPECTEDGIRS += Everything-$(TYPELIB_VERSION)-expected.gir
199 CLEANFILES += $(BUILT_GIRSOURCES)
206 dist_gir_DATA = $(GIRSOURCES)
208 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT)
209 LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:$(builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} $(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
211 typelibsdir = $(libdir)/girepository-1.0
212 typelibs_DATA = $(GIRSOURCES:.gir=.typelib)
214 CLEANFILES += $(typelibs_DATA)
217 @diff -u -U 10 $(srcdir)/$*-expected.gir $*.gir && echo " TEST $*.gir"
219 CHECKGIRS = $(EXPECTEDGIRS:-expected.gir=.gir.check)
220 check-local: $(CHECKGIRS)
222 # Check that typelib -> gir -> typelib transformation is lossless.
223 # Comparing gir files is relatively fragile (whitespace, attribute default
224 # values, etc.) but the typelibs should identical as long as the gir files are
225 # semantically equivalent.
227 %.test.gir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT)
228 $(DEBUG) $(top_builddir)/tools/g-ir-generate$(EXEEXT) --includedir=. $< -o $@
230 testlib-%: %.test.gir $(top_builddir)/tools/g-ir-generate$(EXEEXT)
231 $(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $*.test.typelib
232 cmp $*.typelib $*.test.typelib && rm $*.test.typelib
234 testgir-%: %.test.gir
235 diff -u $*.gir $< && rm $<
237 CLEANFILES += $(typelibs_DATA:%.typelib=%.test.gir)
238 CLEANFILES += $(typelibs_DATA:%.typelib=%.test.typelib)
240 #check-local: $(typelibs_DATA:%.typelib=testlib-%)
241 check-gir: $(typelibs_DATA:%.typelib=testgir-%)
243 EXTRA_DIST += $(EXPECTEDGIRS)