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