]> Pileus Git - ~andy/gtk/blob - gdk/Makefile.am
Merge branch 'master' into broadway
[~andy/gtk] / gdk / Makefile.am
1 ## Makefile.am for gtk+/gdk
2 include $(top_srcdir)/Makefile.decl
3 -include $(INTROSPECTION_MAKEFILE)
4 INTROSPECTION_GIRS =
5 INTROSPECTION_SCANNER_ARGS = \
6         --add-include-path=../gdk \
7         --warn-all
8 INTROSPECTION_COMPILER_ARGS = \
9    --includedir=$(srcdir) \
10    --includedir=.
11
12 SUBDIRS = $(GDK_BACKENDS) . tests
13
14 DIST_SUBDIRS = win32 x11 quartz broadway tests
15
16 CLEANFILES =
17
18 EXTRA_DIST +=                   \
19         keynames.txt            \
20         keyname-table.h         \
21         gdkkeynames.c           \
22         gen-keyname-table.pl    \
23         gdkconfig.h.win32       \
24         gdkkeysyms-update.pl    \
25         gdk.def                 \
26         gdkmarshalers.list      \
27         gdkwindowimpl.h         \
28         makeenums.pl            \
29         makefile.msc            \
30         gdk.symbols             \
31         gdkenumtypes.c.template \
32         gdkenumtypes.h.template \
33         abicheck.sh
34
35 INCLUDES =                              \
36         -DG_LOG_DOMAIN=\"Gdk\"          \
37         -DGDK_COMPILATION               \
38         -I$(top_srcdir)                 \
39         -I$(top_builddir)               \
40         -I$(top_builddir)/gdk           \
41         $(GTK_DEBUG_FLAGS)              \
42         $(GDK_DEP_CFLAGS)
43
44 if PLATFORM_WIN32
45 no_undefined = -no-undefined
46 endif
47
48 # libtool stuff: set version and export symbols for resolving
49 # since automake doesn't support conditionalized libsomething_la_LDFLAGS
50 # we use the general approach here
51 LDADD =                                         \
52         $(GTK_LINK_FLAGS)                       \
53         -version-info $(LT_VERSION_INFO)        \
54         -export-dynamic                         \
55         -rpath $(libdir)                        \
56         $(no_undefined)                         \
57         $(LIBTOOL_EXPORT_OPTIONS)
58
59 #
60 # setup source file variables
61 #
62 #
63 # GDK header files for public installation (non-generated)
64 #
65 gdk_public_h_sources =                          \
66         gdk.h                                   \
67         gdkapplaunchcontext.h                   \
68         gdkcairo.h                              \
69         gdkcolor.h                              \
70         gdkcursor.h                             \
71         gdkdevice.h                             \
72         gdkdevicemanager.h                      \
73         gdkdisplay.h                            \
74         gdkdisplaymanager.h                     \
75         gdkdnd.h                                \
76         gdkevents.h                             \
77         gdkkeys.h                               \
78         gdkkeysyms.h                            \
79         gdkkeysyms-compat.h                     \
80         gdkmain.h                               \
81         gdkpango.h                              \
82         gdkpixbuf.h                             \
83         gdkprivate.h                            \
84         gdkproperty.h                           \
85         gdkrectangle.h                          \
86         gdkrgba.h                               \
87         gdkscreen.h                             \
88         gdkselection.h                          \
89         gdktestutils.h                          \
90         gdkthreads.h                            \
91         gdktypes.h                              \
92         gdkvisual.h                             \
93         gdkwindow.h
94
95 gdk_built_public_sources =                      \
96         gdkconfig.h                             \
97         gdkenumtypes.h
98
99 gdk_private_headers =                           \
100         gdkapplaunchcontextprivate.h            \
101         gdkcursorprivate.h                      \
102         gdkdevicemanagerprivate.h               \
103         gdkdeviceprivate.h                      \
104         gdkdisplaymanagerprivate.h              \
105         gdkdisplayprivate.h                     \
106         gdkdndprivate.h                         \
107         gdkscreenprivate.h                      \
108         gdkinternals.h                          \
109         gdkintl.h                               \
110         gdkkeysprivate.h                        \
111         gdkvisualprivate.h                      \
112         gdkx.h
113
114 gdk_c_sources =                                 \
115         gdk.c                                   \
116         gdkapplaunchcontext.c                   \
117         gdkcairo.c                              \
118         gdkcolor.c                              \
119         gdkcursor.c                             \
120         gdkdevice.c                             \
121         gdkdevicemanager.c                      \
122         gdkdisplay.c                            \
123         gdkdisplaymanager.c                     \
124         gdkdnd.c                                \
125         gdkevents.c                             \
126         gdkglobals.c                            \
127         gdkkeys.c                               \
128         gdkkeyuni.c                             \
129         gdkoffscreenwindow.c                    \
130         gdkpango.c                              \
131         gdkpixbuf-drawable.c                    \
132         gdkrectangle.c                          \
133         gdkrgba.c                               \
134         gdkscreen.c                             \
135         gdkselection.c                          \
136         gdkvisual.c                             \
137         gdkwindow.c                             \
138         gdkwindowimpl.c
139
140 gdk_built_sources =                             \
141         gdkenumtypes.c                          \
142         gdkmarshalers.h                         \
143         gdkmarshalers.c                         \
144         $(gdk_built_public_sources)
145
146 #
147 # setup GDK sources and their dependencies
148 #
149
150 gdkincludedir = $(includedir)/gtk-3.0/gdk
151 gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
152
153 common_sources =                \
154         $(gdk_private_headers)  \
155         $(gdk_c_sources)        \
156         gdkenumtypes.c          \
157         gdkmarshalers.c         \
158         gdkmarshalers.h
159
160 libgdk_3_la_SOURCES = $(common_sources)
161 libgdk_3_la_LIBADD = $(GDK_DEP_LIBS)
162 libgdk_3_la_LDFLAGS = $(LDADD)
163
164 if USE_X11
165 libgdk_3_la_LIBADD += x11/libgdk-x11.la
166 endif # USE_X11
167
168 if USE_QUARTZ
169 libgdk_3_la_LIBADD += quartz/libgdk-quartz.la
170 endif # USE_QUARTZ
171
172 if USE_WIN32
173 libgdk_3_la_SOURCES += gdkkeynames.c
174 libgdk_3_la_LIBADD += win32/libgdk-win32.la
175 libgdk_3_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
176 libgdk_3_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def
177 endif # USE_WIN32
178
179 if USE_BROADWAY
180 libgdk_3_0_la_LIBADD += broadway/libgdk-broadway.la
181 endif # USE_BROADWAY
182
183 if HAVE_INTROSPECTION
184
185 introspection_files =           \
186         $(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))      \
187         $(gdk_c_sources)        \
188         gdkenumtypes.c          \
189         gdkenumtypes.h
190
191 Gdk-3.0.gir: libgdk-3.la Makefile
192 Gdk_3_0_gir_SCANNERFLAGS =      \
193         --c-include="gdk/gdk.h"
194 Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
195 Gdk_3_0_gir_LIBS = libgdk-3.la
196 Gdk_3_0_gir_FILES = $(introspection_files)
197 Gdk_3_0_gir_CFLAGS = $(INCLUDES)
198 Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
199 INTROSPECTION_GIRS += Gdk-3.0.gir
200
201 if USE_X11
202 x11_introspection_files =               \
203         x11/checksettings.c             \
204         x11/gdkapplaunchcontext-x11.c   \
205         x11/gdkasync.c                  \
206         x11/gdkcursor-x11.c             \
207         x11/gdkdevice-core-x11.c        \
208         x11/gdkdevicemanager-core-x11.c \
209         x11/gdkdevicemanager-x11.c      \
210         x11/gdkdevicemanager-xi.c       \
211         x11/gdkdevicemanager-xi2.c      \
212         x11/gdkdevice-xi2.c             \
213         x11/gdkdevice-xi.c              \
214         x11/gdkdisplay-x11.c            \
215         x11/gdkdnd-x11.c                \
216         x11/gdkeventsource.c            \
217         x11/gdkeventtranslator.c        \
218         x11/gdkgeometry-x11.c           \
219         x11/gdkkeys-x11.c               \
220         x11/gdkmain-x11.c               \
221         x11/gdkproperty-x11.c           \
222         x11/gdkscreen-x11.c             \
223         x11/gdkselection-x11.c          \
224         x11/gdksettings.c               \
225         x11/gdktestutils-x11.c          \
226         x11/gdkvisual-x11.c             \
227         x11/gdkwindow-x11.c             \
228         x11/gdkxftdefaults.c            \
229         x11/gdkxid.c                    \
230         x11/xsettings-client.c          \
231         x11/xsettings-common.c          \
232         x11/gdkx.h                      \
233         x11/gdkx11cursor.h              \
234         x11/gdkx11display.h             \
235         x11/gdkx11property.h            \
236         x11/gdkx11screen.h              \
237         x11/gdkx11selection.h           \
238         x11/gdkx11utils.h               \
239         x11/gdkx11visual.h              \
240         x11/gdkx11window.h
241
242 GdkX11-3.0.gir: libgdk-3.la Gdk-3.0.gir Makefile
243 GdkX11_3_0_gir_SCANNERFLAGS =           \
244         --identifier-prefix=Gdk         \
245         --c-include="gdk/gdkx.h"        \
246         --include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
247 GdkX11_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
248 GdkX11_3_0_gir_LIBS = libgdk-3.la
249 GdkX11_3_0_gir_FILES = $(x11_introspection_files)
250 GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
251 GdkX11_3_0_gir_EXPORT_PACKAGES = gdk-x11-3.0
252 INTROSPECTION_GIRS += GdkX11-3.0.gir
253
254 endif # USE_X11
255
256 girdir = $(datadir)/gir-1.0
257 gir_DATA = $(INTROSPECTION_GIRS)
258
259 typelibsdir = $(libdir)/girepository-1.0
260 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
261
262 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
263
264 endif # HAVE_INTROSPECTION
265
266 if OS_WIN32
267 install-def-file: gdk.def
268         mkdir -p $(DESTDIR)$(libdir)
269         $(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
270 uninstall-def-file:
271         -rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
272 else
273 install-def-file:
274 uninstall-def-file:
275 endif
276
277 if MS_LIB_AVAILABLE
278 noinst_DATA = gdk-win32-$(GTK_API_VERSION).lib
279
280 gdk-win32-$(GTK_API_VERSION).lib: libgdk-win32-$(GTK_API_VERSION).la gdk.def
281         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
282
283 install-ms-lib:
284         mkdir -p $(DESTDIR)$(libdir)
285         $(INSTALL) gdk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
286
287 uninstall-ms-lib:
288         -rm $(DESTDIR)$(libdir)/gdk-win32-$(GTK_API_VERSION).lib
289 else
290 install-ms-lib:
291 uninstall-ms-lib:
292 endif
293
294 # This places the generated .def file in srcdir, since it is expected to be there.
295 # (The one from a tarball is)
296 gdk.def: gdk.symbols
297         $(AM_V_GEN) (echo -e EXPORTS; $(CPP) -P -DGDK_WINDOWING_WIN32 - <$(srcdir)/gdk.symbols | sed -e '/^$$/d' -e 's/^/       /' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gdk.def
298
299 TESTS_ENVIRONMENT = srcdir="$(srcdir)"
300 if OS_LINUX
301 TESTS = abicheck.sh
302 endif
303
304 lib_LTLIBRARIES = libgdk-3.la
305
306 MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
307 EXTRA_DIST += $(gdk_built_sources)
308 EXTRA_HEADERS =
309
310 install-exec-hook:
311 if DISABLE_EXPLICIT_DEPS
312         $(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.la
313 endif
314
315 #note: not gdkconfig.h
316 BUILT_SOURCES = \
317         $(gdk_built_sources)                    \
318         gdkconfig.h
319
320 gdkenumtypes.h: stamp-gdkenumtypes.h
321         @true
322 stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
323         $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
324                 $(gdk_public_h_sources) ) >> xgen-geth \
325         && (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
326         && rm -f xgen-geth \
327         && echo timestamp > $(@F)
328 gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
329         $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
330                 $(gdk_public_h_sources) ) > xgen-getc \
331         && cp xgen-getc gdkenumtypes.c  \
332         && rm -f xgen-getc
333
334 #
335 # Marshaller generation
336 #
337 gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
338         $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
339         && mv gdkmarshalers-h.tmp gdkmarshalers.h \
340         || ( rm -f gdkmarshalers-h.tmp && exit 1)
341 gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
342         $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp  \
343         && mv gdkmarshalers-c.tmp gdkmarshalers.c \
344         || ( rm -f gdkmarshalers-c.tmp && exit 1 )
345
346 gdkconfig.h: stamp-gc-h
347         $(AM_V_GEN) if test -f gdkconfig.h; then :; \
348         else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
349 stamp-gc-h: $(top_builddir)/config.status
350         $(AM_V_at) cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
351         echo timestamp > stamp-gc-h
352
353 dist-hook: ../build/win32/vs9/gdk.vcproj
354
355 ../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
356         for F in $(libgdk_3_la_SOURCES); do \
357                 case $$F in \
358                 *.c) echo '   <File RelativePath="..\..\..\gdk\'$$F'" />' \
359                      ;; \
360                 esac; \
361         done >libgdk.sourcefiles
362         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gdk.vcprojin >$@
363         rm libgdk.sourcefiles
364
365 DISTCLEANFILES = gdkconfig.h stamp-gc-h
366
367 install-data-local: install-ms-lib install-def-file
368
369 uninstall-local: uninstall-ms-lib uninstall-def-file
370         rm -f $(DESTDIR)$(configexecincludedir)/gdkconfig.h
371
372 # if srcdir!=builddir, clean out maintainer-clean files from builddir
373 # this allows dist to pass.
374 distclean-local:
375         if test $(srcdir) != .; then \
376           rm -f $(MAINTAINERCLEANFILES); \
377         fi
378
379 .PHONY: files
380
381 files:
382         @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
383           echo $$p; \
384         done
385
386 -include $(top_srcdir)/git.mk