1## Makefile.am for gtk+/gdk
2include $(top_srcdir)/Makefile.decl
3-include $(INTROSPECTION_MAKEFILE)
4INTROSPECTION_GIRS =
5INTROSPECTION_SCANNER_ARGS = \
6   --warn-all \
7   --add-include-path=../gdk
8INTROSPECTION_COMPILER_ARGS = \
9   --includedir=$(srcdir) \
10   --includedir=.
11
12SUBDIRS = $(gdktarget) . tests
13DIST_SUBDIRS = win32 x11 quartz directfb tests
14
15CLEANFILES =
16
17EXTRA_DIST +=			\
18	keynames.txt		\
19	keyname-table.h		\
20	gen-keyname-table.pl	\
21	gdkconfig.h.win32 	\
22	gdkkeysyms-update.pl	\
23	gdk.def 		\
24	gdkmarshalers.list	\
25	gdkmedialib.h		\
26	gdkwindowimpl.h		\
27	makeenums.pl		\
28	makefile.msc		\
29	gdk.symbols		\
30	makegdkalias.pl		\
31	gdkenumtypes.c.template	\
32	gdkenumtypes.h.template	\
33	abicheck.sh		\
34	pltcheck.sh
35
36INCLUDES =                              \
37	-DG_LOG_DOMAIN=\"Gdk\"		\
38	-DGDK_COMPILATION		\
39	-I$(top_srcdir)			\
40	-I$(top_builddir)		\
41	-I$(top_builddir)/gdk		\
42	$(GTK_DEBUG_FLAGS) 		\
43	$(GDK_DEP_CFLAGS)
44
45gtarget=$(gdktarget)
46
47if PLATFORM_WIN32
48no_undefined = -no-undefined
49endif
50
51# libtool stuff: set version and export symbols for resolving
52# since automake doesn't support conditionalized libsomething_la_LDFLAGS
53# we use the general approach here
54LDADD = \
55	$(GTK_LINK_FLAGS)						\
56	-version-info $(LT_VERSION_INFO)		 		\
57	-export-dynamic 						\
58	-rpath $(libdir) 						\
59	$(no_undefined)							\
60	$(LIBTOOL_EXPORT_OPTIONS)
61
62if USE_MEDIALIB
63medialib_sources =  \
64    gdkmedialib.c
65else
66medialib_sources =
67endif
68
69#
70# setup source file variables
71#
72#
73# GDK header files for public installation (non-generated)
74#
75gdk_public_h_sources =				\
76	gdk.h					\
77	gdkapplaunchcontext.h			\
78	gdkcairo.h				\
79	gdkcolor.h				\
80	gdkcursor.h				\
81	gdkdisplay.h				\
82	gdkdisplaymanager.h			\
83	gdkdnd.h				\
84	gdkdrawable.h				\
85	gdkevents.h				\
86	gdkfont.h				\
87	gdkgc.h					\
88	gdki18n.h				\
89	gdkimage.h				\
90	gdkinput.h				\
91	gdkkeys.h				\
92	gdkkeysyms.h				\
93	gdkkeysyms-compat.h			\
94	gdkpango.h				\
95	gdkpixbuf.h				\
96	gdkpixmap.h				\
97	gdkprivate.h				\
98	gdkproperty.h				\
99	gdkregion.h				\
100	gdkrgb.h				\
101	gdkscreen.h				\
102	gdkselection.h				\
103	gdkspawn.h				\
104	gdktestutils.h				\
105	gdktypes.h				\
106	gdkvisual.h				\
107	gdkwindow.h
108
109gdk_built_public_sources =			\
110	gdkenumtypes.h
111
112gdk_built_private_headers =			\
113	gdkalias.h
114
115gdk_private_headers =   \
116	gdkinternals.h \
117	gdkintl.h \
118    gdkpoly-generic.h	\
119	gdkregion-generic.h
120
121gdk_c_sources =                 \
122	$(medialib_sources)     \
123	gdk.c			\
124	gdkapplaunchcontext.c	\
125	gdkcairo.c		\
126	gdkcolor.c		\
127	gdkcursor.c		\
128	gdkdisplay.c		\
129	gdkdisplaymanager.c	\
130	gdkdnd.c		\
131	gdkdraw.c		\
132	gdkevents.c     	\
133	gdkfont.c		\
134	gdkgc.c			\
135	gdkglobals.c		\
136	gdkimage.c		\
137	gdkkeys.c		\
138	gdkkeyuni.c		\
139	gdkoffscreenwindow.c	\
140	gdkpango.c		\
141	gdkpixbuf-drawable.c	\
142	gdkpixbuf-render.c	\
143	gdkpixmap.c		\
144	gdkpolyreg-generic.c	\
145	gdkrectangle.c		\
146	gdkregion-generic.c	\
147	gdkrgb.c		\
148	gdkscreen.c		\
149	gdkselection.c		\
150	gdkvisual.c		\
151	gdkwindow.c		\
152	gdkwindowimpl.c
153
154gdk_built_sources =				\
155	gdkaliasdef.c				\
156	gdkenumtypes.c				\
157	gdkmarshalers.h 			\
158	gdkmarshalers.c				\
159	$(gdk_built_public_sources)		\
160	$(gdk_built_private_headers)
161
162#
163# setup GDK sources and their dependencies
164#
165
166gdkincludedir = $(includedir)/gtk-2.0/gdk
167gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
168
169common_sources =                \
170	$(gdk_private_headers)      \
171    $(gdk_c_sources)	\
172	gdkenumtypes.c		\
173	gdkmarshalers.c		\
174	gdkmarshalers.h
175
176libgdk_directfb_2_0_la_SOURCES = $(common_sources)
177libgdk_directfb_2_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS)
178libgdk_directfb_2_0_la_LDFLAGS = $(LDADD)
179
180libgdk_x11_2_0_la_SOURCES = $(common_sources)
181libgdk_x11_2_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
182libgdk_x11_2_0_la_LDFLAGS = $(LDADD)
183
184libgdk_quartz_2_0_la_SOURCES = $(common_sources) gdkkeynames.c
185libgdk_quartz_2_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS)
186libgdk_quartz_2_0_la_LDFLAGS = $(LDADD)
187
188libgdk_win32_2_0_la_SOURCES = $(common_sources) gdkkeynames.c
189libgdk_win32_2_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS)
190libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
191libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
192
193if HAVE_INTROSPECTION
194
195base_introspection_files = 		\
196	$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))	\
197	$(gdk_c_sources)	\
198	gdkkeynames.c		\
199        gdkenumtypes.c		\
200        gdkenumtypes.h
201
202introspection_files = $(base_introspection_files)
203
204Gdk-2.0.gir: $(gdktargetlib) Makefile
205Gdk_2_0_gir_SCANNERFLAGS = --c-include="gdk/gdk.h"
206Gdk_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
207Gdk_2_0_gir_LIBS = $(gdktargetlib)
208Gdk_2_0_gir_FILES = $(introspection_files)
209Gdk_2_0_gir_EXPORT_PACKAGES = gdk-2.0
210Gdk_2_0_gir_CFLAGS = $(INCLUDES)
211INTROSPECTION_GIRS += Gdk-2.0.gir
212
213if USE_X11
214x11_introspection_files = 		\
215	x11/checksettings.c		\
216	x11/gdkapplaunchcontext-x11.c	\
217	x11/gdkasync.c			\
218	x11/gdkcolor-x11.c		\
219	x11/gdkcursor-x11.c		\
220	x11/gdkdisplay-x11.c		\
221	x11/gdkdnd-x11.c		\
222	x11/gdkdrawable-x11.c		\
223	x11/gdkgc-x11.c			\
224	x11/gdkgeometry-x11.c		\
225	x11/gdkglobals-x11.c		\
226	x11/gdkimage-x11.c		\
227	x11/gdkim-x11.c			\
228	x11/gdkinput.c			\
229	x11/gdkkeys-x11.c		\
230	x11/gdkmain-x11.c		\
231	x11/gdkpixmap-x11.c		\
232	x11/gdkproperty-x11.c		\
233	x11/gdkscreen-x11.c		\
234	x11/gdkselection-x11.c		\
235	x11/gdksettings.c		\
236	x11/gdkspawn-x11.c		\
237	x11/gdktestutils-x11.c		\
238	x11/gdkvisual-x11.c		\
239	x11/gdkwindow-x11.c		\
240	x11/gdkxftdefaults.c		\
241	x11/gdkxid.c			\
242	x11/xsettings-client.c		\
243	x11/xsettings-common.c		\
244        x11/gdkx.h
245
246GdkX11-2.0.gir: $(gdktargetlib) Gdk-2.0.gir Makefile
247GdkX11_2_0_gir_SCANNERFLAGS = --identifier-prefix=Gdk --include-uninstalled=Gdk-2.0.gir
248GdkX11_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
249
250GdkX11_2_0_gir_LIBS = $(gdktargetlib)
251GdkX11_2_0_gir_FILES = $(x11_introspection_files)
252GdkX11_2_0_gir_EXPORT_PACKAGES = gdk-x11-2.0
253GdkX11_2_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
254INTROSPECTION_GIRS += GdkX11-2.0.gir
255
256introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files))
257
258endif # USE_X11
259
260girdir = $(datadir)/gir-1.0
261gir_DATA = $(INTROSPECTION_GIRS)
262
263typelibsdir = $(libdir)/girepository-1.0
264typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
265
266CLEANFILES += $(gir_DATA) $(typelibs_DATA)
267
268endif # HAVE_INTROSPECTION
269
270if OS_WIN32
271install-def-file: gdk.def
272	$(mkinstalldirs) $(DESTDIR)$(libdir)
273	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def
274uninstall-def-file:
275	-rm $(DESTDIR)$(libdir)/gdk-win32-2.0.def
276else
277install-def-file:
278uninstall-def-file:
279endif
280
281if MS_LIB_AVAILABLE
282noinst_DATA = gdk-win32-$(GTK_API_VERSION).lib
283
284gdk-win32-$(GTK_API_VERSION).lib: libgdk-win32-$(GTK_API_VERSION).la gdk.def
285	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
286
287install-ms-lib:
288	$(mkinstalldirs) $(DESTDIR)$(libdir)
289	$(INSTALL) gdk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
290
291uninstall-ms-lib:
292	-rm $(DESTDIR)$(libdir)/gdk-win32-$(GTK_API_VERSION).lib
293else
294install-ms-lib:
295uninstall-ms-lib:
296endif
297
298# This places the generated .def file in srcdir, since it is expected to be there.
299# (The one from a tarball is)
300gdk.def: gdk.symbols
301	(echo -e EXPORTS; $(CPP) -P -DALL_FILES -DGDK_WINDOWING_WIN32 -DINCLUDE_VARIABLES - <$(srcdir)/gdk.symbols | sed -e '/^$$/d' -e 's/^/	/' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gdk.def
302
303gdkalias.h: gdk.symbols
304	 $(PERL) $(srcdir)/makegdkalias.pl < $(srcdir)/gdk.symbols > gdkalias.h
305
306gdkaliasdef.c: gdk.symbols
307	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c
308
309if OS_LINUX
310TESTS = abicheck.sh pltcheck.sh
311endif
312
313
314lib_LTLIBRARIES = $(gdktargetlib)
315
316EXTRA_LTLIBRARIES = libgdk-x11-2.0.la libgdk-win32-2.0.la libgdk-quartz-2.0.la libgdk-directfb-2.0.la
317
318MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
319EXTRA_DIST += $(gdk_built_sources)
320EXTRA_HEADERS =
321
322#
323# Rule to install gdkconfig.h header file
324#
325configexecincludedir = $(libdir)/gtk-2.0/include
326#configexecinclude_DATA = gdkconfig.h
327
328install-exec-local: gdkconfig.h
329	$(mkinstalldirs) $(DESTDIR)$(configexecincludedir)
330	file=$(DESTDIR)$(configexecincludedir)/gdkconfig.h; \
331	if test -r $$file && cmp -s gdkconfig.h $$file; then :; \
332	else $(INSTALL_DATA) gdkconfig.h $$file; fi
333
334install-exec-hook:
335if DISABLE_EXPLICIT_DEPS
336	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
337endif
338
339#note: not gdkconfig.h
340BUILT_SOURCES = \
341	$(gdk_built_sources)			\
342	gdkconfig.h
343
344gdkenumtypes.h: stamp-gdkenumtypes.h
345	@true
346stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
347	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
348		$(gdk_public_h_sources) ) >> xgen-geth \
349	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
350	&& rm -f xgen-geth \
351	&& echo timestamp > $(@F)
352gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
353	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
354		$(gdk_public_h_sources) ) > xgen-getc \
355	&& cp xgen-getc gdkenumtypes.c  \
356	&& rm -f xgen-getc
357
358#
359# Marshaller generation
360#
361gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
362	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
363	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
364	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
365gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
366	(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
367	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
368	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
369
370gdkconfig.h: stamp-gc-h
371	@if test -f gdkconfig.h; then :; \
372	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
373stamp-gc-h: $(top_builddir)/config.status
374	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
375	echo timestamp > stamp-gc-h
376
377# ---------------- MSVC Projects ----------------
378MSVCPROJS = gdk
379
380gdk_FILES = $(libgdk_win32_2_0_la_SOURCES)
381gdk_EXCLUDES = gdkdummy
382
383gdk_HEADERS_DIR = $(gdkincludedir)
384gdk_HEADERS_INST = $(gdkinclude_HEADERS)
385gdk_HEADERS_EXCLUDES = gdkdummy
386
387include $(top_srcdir)/build/Makefile.msvcproj
388
389if HAVE_INTROSPECTION
390# Introspection Items for MSVC
391MSVC_INTROSPECT_GIRS = Gdk-2.0.gir
392
393BASE_MSVC_GIR_CFLAGS =			\
394	-DGDK_COMPILATION		\
395	-I../.. -I../../gdk -I.../../gdk/win32
396
397INTROSPECTION_INTERMEDIATE_ITEMS = \
398	$(top_builddir)/build/win32/Gdk-2.0.gir.msvc.introspect	\
399	$(top_builddir)/build/win32/Gdk_2_0_gir_list
400
401Gdk_2_0_gir_MSVC_FILES = $(filter-out gdkmedialib.c, $(base_introspection_files))
402Gdk_2_0_gir_MSVC_EXPORT_PACKAGES = $(Gdk_2_0_gir_EXPORT_PACKAGES)
403Gdk_2_0_gir_MSVC_INCLUDE_GIRS = $(Gdk_2_0_gir_INCLUDES)
404Gdk_2_0_gir_MSVC_LIBS = gdk-win32-2.0
405Gdk_2_0_gir_MSVC_CFLAGS = $(BASE_MSVC_GIR_CFLAGS)
406Gdk_2_0_gir_MSVC_SCANNERFLAGS = $(Gdk_2_0_gir_SCANNERFLAGS)
407
408include $(top_srcdir)/build/Makefile.msvc-introspection
409
410else
411INTROSPECTION_INTERMEDIATE_ITEMS =
412endif
413
414dist-hook:	\
415	$(top_builddir)/build/win32/vs9/gdk.vcproj	\
416	$(top_builddir)/build/win32/vs9/gdk.headers	\
417	$(INTROSPECTION_INTERMEDIATE_ITEMS)
418
419DISTCLEANFILES = gdkconfig.h stamp-gc-h
420
421install-data-local: install-ms-lib install-def-file
422
423uninstall-local: uninstall-ms-lib uninstall-def-file
424	rm -f $(DESTDIR)$(configexecincludedir)/gdkconfig.h
425
426# if srcdir!=builddir, clean out maintainer-clean files from builddir
427# this allows dist to pass.
428distclean-local:
429	if test $(srcdir) != .; then \
430	  rm -f $(MAINTAINERCLEANFILES); \
431	fi
432
433.PHONY: files
434
435files:
436	@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
437	  echo $$p; \
438	done
439
440-include $(top_srcdir)/git.mk
441