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