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