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