Imported Upstream version 1.38.0
[platform/upstream/gobject-introspection.git] / Makefile-gir.am
1 BUILT_GIRSOURCES =
2 SUBSTITUTED_GIRSOURCES =
3
4 STATIC_GIRSOURCES =                 \
5         gir/DBus-1.0.gir            \
6         gir/DBusGLib-1.0.gir        \
7         gir/fontconfig-2.0.gir      \
8         gir/freetype2-2.0.gir       \
9         gir/GL-1.0.gir              \
10         gir/libxml2-2.0.gir         \
11         gir/xft-2.0.gir             \
12         gir/xlib-2.0.gir            \
13         gir/xfixes-4.0.gir          \
14         gir/xrandr-1.3.gir          \
15         gir/win32-1.0.gir
16 EXTRA_DIST += $(STATIC_GIRSOURCES)
17
18 gir/cairo-1.0.gir: gir/cairo-1.0.gir.in Makefile
19         [ -d $(@D) ] || $(mkdir_p) $(@D) ; \
20         sed \
21         -e s,%CAIRO_SHARED_LIBRARY%,$(CAIRO_SHARED_LIBRARY), \
22         -e s,%CAIRO_GIR_PACKAGE%,$(CAIRO_GIR_PACKAGE), \
23         < $< > $@.tmp && mv $@.tmp $@
24 BUILT_SOURCES += gir/cairo-1.0.gir
25 SUBSTITUTED_GIRSOURCES += gir/cairo-1.0.gir
26 CLEANFILES += gir/cairo-1.0.gir
27 EXTRA_DIST += gir/cairo-1.0.gir.in
28
29 # Doesn't seem to work to do gir/%.typelib =(
30 gir/cairo-1.0.typelib: g-ir-compiler
31 gir/DBus-1.0.typelib: g-ir-compiler
32 gir/DBusGLib-1.0.typelib: g-ir-compiler
33 gir/fontconfig-2.0.typelib: g-ir-compiler
34 gir/freetype2-2.0.typelib: g-ir-compiler
35 gir/GL-1.0.typelib: g-ir-compiler
36 gir/libxml2-2.0.typelib: g-ir-compiler
37 gir/xft-2.0.typelib: g-ir-compiler
38 gir/xlib-2.0.typelib: g-ir-compiler
39 gir/xfixes-4.0.typelib: g-ir-compiler
40 gir/xrandr-1.3.typelib: g-ir-compiler
41 gir/win32-1.0.typelib: g-ir-compiler
42
43 # glib with source (to enable documentation)
44 if WITH_GLIBSRC
45      GLib_2_0_gir_DOCSRC = $(GLIBSRC)/glib/*.c
46      GObject_2_0_gir_DOCSRC = $(GLIBSRC)/gobject/*.c
47      GModule_2_0_gir_DOCSRC = $(GLIBSRC)/gmodule/*.c
48      Gio_2_0_gir_DOCSRC = $(GLIBSRC)/gio/*.c
49 else
50     GLib_2_0_gir_DOCSRC = 
51     GObject_2_0_gir_DOCSRC = 
52     GModule_2_0_gir_DOCSRC = 
53     Gio_2_0_gir_DOCSRC = 
54
55 endif
56
57 # glib
58 GLIB_INCLUDEDIR=$(shell pkg-config --variable=includedir glib-2.0)/glib-2.0
59 GLIB_LIBDIR=$(shell pkg-config --variable=libdir glib-2.0)
60
61 if OS_WIN32
62 GLIB_LIBRARY=libglib-2.0-0
63 else
64 GLIB_LIBRARY=glib-2.0
65 endif
66
67 GLib_2_0_gir_LIBS = $(GLIB_LIBRARY) $(GOBJECT_LIBRARY)
68 GLib_2_0_gir_SCANNERFLAGS = \
69             --external-library \
70             --reparse-validate \
71             --identifier-prefix=G \
72             --symbol-prefix=g \
73             --symbol-prefix=glib \
74             --c-include="glib.h" \
75             $(GLib_2_0_gir_DOCSRC)
76 GLib_2_0_gir_PACKAGES = glib-2.0
77 GLib_2_0_gir_CFLAGS = \
78             -I$(GLIB_INCLUDEDIR) \
79             -I$(GLIB_LIBDIR)/glib-2.0/include \
80             -DGETTEXT_PACKAGE=Dummy \
81             -DGLIB_COMPILATION \
82             -D__G_I18N_LIB_H__
83 GLib_2_0_gir_FILES =  \
84                 $(GLIB_LIBDIR)/glib-2.0/include/glibconfig.h \
85                 $(GLIB_INCLUDEDIR)/glib/*.h \
86                 $(GLIB_INCLUDEDIR)/gobject/glib-types.h \
87                 gir/glib-2.0.c
88 if HAVE_GIO_UNIX
89 GLib_2_0_gir_FILES += $(GLIB_INCLUDEDIR)/glib-unix.h
90 endif
91
92 BUILT_GIRSOURCES += GLib-2.0.gir
93
94 GLib-2.0.gir: g-ir-scanner g-ir-compiler$(EXEEXT)
95
96 gir/DBusGLib-1.0.typelib: GObject-2.0.gir
97
98 # gobject
99 GOBJECT_INCLUDEDIR=$(shell pkg-config --variable=includedir gobject-2.0)/glib-2.0
100 GOBJECT_LIBDIR=$(shell pkg-config --variable=libdir gobject-2.0)
101
102 if OS_WIN32
103 GOBJECT_LIBRARY=libgobject-2.0-0
104 else
105 GOBJECT_LIBRARY=gobject-2.0
106 endif
107
108 GObject-2.0.gir: GLib-2.0.gir
109 GObject_2_0_gir_LIBS = $(GOBJECT_LIBRARY)
110 GObject_2_0_gir_SCANNERFLAGS = \
111             --external-library \
112             --reparse-validate \
113             --identifier-prefix=G \
114             --c-include="glib-object.h" \
115             --add-include-path=. \
116             $(GObject_2_0_gir_DOCSRC)
117
118 GObject_2_0_gir_PACKAGES = gobject-2.0
119 GObject_2_0_gir_INCLUDES = GLib-2.0
120 GObject_2_0_gir_CFLAGS = \
121             -DGOBJECT_COMPILATION \
122             -I$(GOBJECT_INCLUDEDIR) \
123             -I$(GOBJECT_LIBDIR)/glib-2.0/include
124 GObject_2_0_gir_FILES = \
125         $(filter-out $(GOBJECT_INCLUDEDIR)/gobject/glib-types.h, $(wildcard $(GOBJECT_INCLUDEDIR)/gobject/*.h)) \
126         gir/gobject-2.0.c
127
128 BUILT_GIRSOURCES += GObject-2.0.gir
129
130 # gmodule
131 GMODULE_INCLUDEDIR=$(shell pkg-config --variable=includedir gmodule-2.0)/glib-2.0
132 GMODULE_LIBDIR=$(shell pkg-config --variable=libdir gmodule-2.0)
133
134 if OS_WIN32
135 GMODULE_LIBRARY=libgmodule-2.0-0
136 else
137 GMODULE_LIBRARY=gmodule-2.0
138 endif
139
140 GModule-2.0.gir: GLib-2.0.gir
141
142 GModule_2_0_gir_LIBS = $(GMODULE_LIBRARY)
143 GModule_2_0_gir_SCANNERFLAGS = \
144             --external-library \
145             --identifier-prefix=G \
146             --c-include="gmodule.h" \
147             --add-include-path=. \
148             $(GModule_2_0_gir_DOCSRC)
149
150 GModule_2_0_gir_PACKAGES = gmodule-2.0
151 GModule_2_0_gir_INCLUDES = GLib-2.0
152 GModule_2_0_gir_CFLAGS = \
153             -I$(GMODULE_INCLUDEDIR) \
154             -I$(GMODULE_LIBDIR)/glib-2.0/include
155 GModule_2_0_gir_FILES = $(GLIB_INCLUDEDIR)/gmodule.h \
156             gir/gmodule-2.0.c
157
158 BUILT_GIRSOURCES += GModule-2.0.gir
159
160 # gio
161 GIO_INCLUDEDIR=$(shell pkg-config --variable=includedir gio-2.0)/glib-2.0
162 GIO_LIBDIR=$(shell pkg-config --variable=libdir gio-2.0)
163
164 if OS_WIN32
165 GIO_LIBRARY=libgio-2.0-0
166 else
167 GIO_LIBRARY=gio-2.0
168 endif
169
170 if HAVE_GIO_UNIX
171 GIO_UNIX_HDRS=$(shell pkg-config --variable=includedir gio-unix-2.0)/gio-unix-2.0/gio/*.h
172 GIO_UNIX_PACKAGES = gio-unix-2.0
173 else
174 GIO_UNIX_HDRS=
175 GIO_UNIX_PACKAGES =
176 endif
177 GIO_CINCLUDES=$(patsubst %,--c-include='%',$(shell echo $(GIO_UNIX_HDRS)))
178
179 Gio-2.0.gir: GObject-2.0.gir
180
181 Gio_2_0_gir_LIBS = $(GIO_LIBRARY)
182 Gio_2_0_gir_SCANNERFLAGS = \
183             --external-library \
184             --reparse-validate \
185             --warn-all \
186             --identifier-prefix=G \
187             --c-include="gio/gio.h" \
188             $(GIO_CINCLUDES) \
189             --add-include-path=. \
190             $(Gio_2_0_gir_DOCSRC)
191
192 Gio_2_0_gir_PACKAGES = gio-2.0 $(GIO_UNIX_PACKAGES)
193 Gio_2_0_gir_INCLUDES = GObject-2.0
194 Gio_2_0_gir_CFLAGS = \
195             -DGIO_COMPILATION \
196             -I$(GIO_LIBDIR)/glib-2.0/include
197 Gio_2_0_gir_FILES = \
198             $(GIO_UNIX_HDRS) \
199             $(filter-out %/gsettingsbackend.h, $(shell echo $(GIO_INCLUDEDIR)/gio/*.h)) \
200             gir/gio-2.0.c
201
202 BUILT_GIRSOURCES += Gio-2.0.gir
203 EXTRA_DIST += gir/glib-2.0.c gir/gmodule-2.0.c gir/gobject-2.0.c gir/gio-2.0.c
204
205 # girepository
206 GIRepository-2.0.gir: GObject-2.0.gir libgirepository-1.0.la
207
208 GIRepository_2_0_gir_LIBS = libgirepository-1.0.la
209 GIRepository_2_0_gir_SCANNERFLAGS = \
210         --warn-all \
211         --identifier-prefix=GI \
212         --symbol-prefix=g \
213         --c-include="girepository.h" \
214         --add-include-path=.
215 GIRepository_2_0_gir_PACKAGES = gobject-2.0
216 GIRepository_2_0_gir_INCLUDES = GObject-2.0
217 GIRepository_2_0_gir_EXPORT_PACKAGES = gobject-introspection-1.0
218 GIRepository_2_0_gir_CFLAGS = \
219     -I$(top_srcdir)/girepository -I$(top_srcdir) \
220     -DGI_COMPILATION
221 GIRepository_2_0_gir_FILES = \
222         $(top_srcdir)/girepository/girepository.h   \
223         $(top_srcdir)/girepository/girepository.c   \
224         $(top_srcdir)/girepository/gi*info.c        \
225         $(top_srcdir)/girepository/gi*info.h        \
226         $(top_srcdir)/girepository/gitypelib.h      \
227         $(top_srcdir)/girepository/gitypes.h
228
229 BUILT_GIRSOURCES += GIRepository-2.0.gir
230
231 CLEANFILES += $(BUILT_GIRSOURCES)
232
233 INTROSPECTION_GIRS += $(BUILT_GIRSOURCES)
234
235 girdir = $(GIR_DIR)
236 gir_DATA = $(STATIC_GIRSOURCES) $(SUBSTITUTED_GIRSOURCES) $(BUILT_GIRSOURCES)
237
238 typelibsdir = $(libdir)/girepository-1.0
239 typelibs_DATA = $(gir_DATA:.gir=.typelib)
240
241 CLEANFILES += $(typelibs_DATA)