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