Makefile.am 10.5 KB
Newer Older
1
## Makefile.am for gtk+/gdk
2
include $(top_srcdir)/Makefile.decl
3
-include $(INTROSPECTION_MAKEFILE)
4 5
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
6 7
	--add-include-path=../gdk \
	--warn-all
8 9
INTROSPECTION_COMPILER_ARGS = \
   --includedir=$(srcdir) \
10
   --includedir=.
Elliot Lee's avatar
Elliot Lee committed
11

12 13
SUBDIRS = $(GDK_BACKENDS) . tests

14
DIST_SUBDIRS = win32 x11 quartz broadway wayland tests
Tor Lillqvist's avatar
Tor Lillqvist committed
15

16 17
CLEANFILES =

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 30
	makefile.msc		\
	gdk.symbols		\
31 32
	gdkenumtypes.c.template	\
	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_srcdir)			\
40
	-I$(top_builddir)		\
41
	-I$(top_builddir)/gdk		\
42
	$(GTK_DEBUG_FLAGS)		\
43
	$(GDK_DEP_CFLAGS)
44

Tor Lillqvist's avatar
Tor Lillqvist committed
45 46 47 48
if PLATFORM_WIN32
no_undefined = -no-undefined
endif

49
# libtool stuff: set version and export symbols for resolving
50 51
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
# we use the general approach here
52 53 54 55 56 57
LDADD = 					\
	$(GTK_LINK_FLAGS)			\
	-version-info $(LT_VERSION_INFO)	\
	-export-dynamic 			\
	-rpath $(libdir) 			\
	$(no_undefined)				\
58 59
	$(LIBTOOL_EXPORT_OPTIONS)

60 61 62
#
# setup source file variables
#
Owen Taylor's avatar
Owen Taylor committed
63
#
64
# GDK header files for public installation (non-generated)
Owen Taylor's avatar
Owen Taylor committed
65
#
66
gdk_public_h_sources = 				\
67
	gdk.h					\
68
	gdkapplaunchcontext.h			\
69
	gdkcairo.h				\
70 71
	gdkcolor.h				\
	gdkcursor.h				\
72 73
	gdkdevice.h				\
	gdkdevicemanager.h			\
74
	gdkdisplay.h				\
75
	gdkdisplaymanager.h			\
76 77 78
	gdkdnd.h				\
	gdkevents.h				\
	gdkkeys.h				\
79
	gdkkeysyms.h				\
80
	gdkkeysyms-compat.h			\
81
	gdkmain.h				\
82 83
	gdkpango.h				\
	gdkpixbuf.h				\
84
	gdkprivate.h				\
85
	gdkproperty.h				\
86
	gdkrectangle.h				\
87
	gdkrgba.h				\
88
	gdkscreen.h				\
89
	gdkselection.h				\
90
	gdktestutils.h				\
91
	gdkthreads.h				\
92 93
	gdktypes.h				\
	gdkvisual.h				\
94
	gdkwindow.h
95

96
gdk_private_headers = 				\
97
	gdkapplaunchcontextprivate.h		\
98
	gdkcursorprivate.h			\
99
	gdkdevicemanagerprivate.h		\
100
	gdkdeviceprivate.h			\
101 102 103 104 105
	gdkdisplaymanagerprivate.h		\
	gdkdisplayprivate.h			\
	gdkdndprivate.h				\
	gdkscreenprivate.h			\
	gdkinternals.h				\
106
	gdkintl.h				\
107
	gdkkeysprivate.h			\
108 109
	gdkvisualprivate.h			\
	gdkx.h
110

111 112 113 114 115 116
gdk_c_sources = 				\
	gdk.c					\
	gdkapplaunchcontext.c			\
	gdkcairo.c				\
	gdkcolor.c				\
	gdkcursor.c				\
117
	gdkdeprecated.c				\
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
	gdkdevice.c				\
	gdkdevicemanager.c			\
	gdkdisplay.c				\
	gdkdisplaymanager.c			\
	gdkdnd.c				\
	gdkevents.c     			\
	gdkglobals.c				\
	gdkkeys.c				\
	gdkkeyuni.c				\
	gdkoffscreenwindow.c			\
	gdkpango.c				\
	gdkpixbuf-drawable.c			\
	gdkrectangle.c				\
	gdkrgba.c				\
	gdkscreen.c				\
	gdkselection.c				\
	gdkvisual.c				\
	gdkwindow.c				\
136
	gdkwindowimpl.c
137

138
gdk_built_sources = 				\
139 140 141
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
142
	gdkversionmacros.h			\
143
	gdkenumtypes.h
144

145
#
146
# setup GDK sources and their dependencies
147
#
148

149
gdkincludedir = $(includedir)/gtk-3.0/gdk
150
gdkinclude_HEADERS = $(gdk_public_h_sources) gdkenumtypes.h gdkversionmacros.h
151
nodist_gdkinclude_HEADERS = gdkconfig.h
152

Matthias Clasen's avatar
Matthias Clasen committed
153 154 155
common_sources = 		\
	$(gdk_private_headers)	\
	$(gdk_c_sources)	\
156
	gdkenumtypes.c		\
157
	gdkmarshalers.c		\
158
	gdkmarshalers.h
159

160 161 162
libgdk_3_la_SOURCES = $(common_sources)
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS)
libgdk_3_la_LDFLAGS = $(LDADD)
163

164
if USE_X11
165
libgdk_3_la_LIBADD += x11/libgdk-x11.la
166 167 168
endif # USE_X11

if USE_QUARTZ
169
libgdk_3_la_LIBADD += quartz/libgdk-quartz.la
170
endif # USE_QUARTZ
171

172
if USE_WIN32
173 174 175 176
libgdk_3_la_SOURCES += gdkkeynames.c
libgdk_3_la_LIBADD += win32/libgdk-win32.la
libgdk_3_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
libgdk_3_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def
177
endif # USE_WIN32
Anders Carlsson's avatar
Anders Carlsson committed
178

179
if USE_BROADWAY
180
libgdk_3_la_LIBADD += broadway/libgdk-broadway.la
181
endif # USE_BROADWAY
182

Kristian Høgsberg's avatar
Kristian Høgsberg committed
183
if USE_WAYLAND
184
libgdk_3_la_LIBADD += wayland/libgdk-wayland.la
Kristian Høgsberg's avatar
Kristian Høgsberg committed
185 186
endif

187 188
if HAVE_INTROSPECTION

Matthias Clasen's avatar
Matthias Clasen committed
189
introspection_files = 		\
190
	$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))	\
Matthias Clasen's avatar
Matthias Clasen committed
191 192
	$(gdk_c_sources)	\
        gdkenumtypes.c		\
193
        gdkenumtypes.h
194

195
Gdk-3.0.gir: libgdk-3.la Makefile
196 197
Gdk_3_0_gir_SCANNERFLAGS = 	\
	--c-include="gdk/gdk.h"
198
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
199
Gdk_3_0_gir_LIBS = libgdk-3.la
200
Gdk_3_0_gir_FILES = $(introspection_files)
201
Gdk_3_0_gir_CFLAGS = $(AM_CPPFLAGS)
202
Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
203
INTROSPECTION_GIRS += Gdk-3.0.gir
204

205
if USE_X11
Matthias Clasen's avatar
Matthias Clasen committed
206 207 208 209 210
x11_introspection_files = 		\
	x11/checksettings.c		\
	x11/gdkapplaunchcontext-x11.c	\
	x11/gdkasync.c			\
	x11/gdkcursor-x11.c		\
211 212
	x11/gdkdevice-core-x11.c	\
	x11/gdkdevicemanager-core-x11.c	\
Matthias Clasen's avatar
Matthias Clasen committed
213 214
	x11/gdkdevicemanager-x11.c	\
	x11/gdkdevicemanager-xi.c	\
215
	x11/gdkdevicemanager-xi2.c	\
Matthias Clasen's avatar
Matthias Clasen committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
	x11/gdkdevice-xi2.c		\
	x11/gdkdevice-xi.c		\
	x11/gdkdisplay-x11.c		\
	x11/gdkdnd-x11.c		\
	x11/gdkeventsource.c		\
	x11/gdkeventtranslator.c	\
	x11/gdkgeometry-x11.c		\
	x11/gdkkeys-x11.c		\
	x11/gdkmain-x11.c		\
	x11/gdkproperty-x11.c		\
	x11/gdkscreen-x11.c		\
	x11/gdkselection-x11.c		\
	x11/gdksettings.c		\
	x11/gdktestutils-x11.c		\
	x11/gdkvisual-x11.c		\
	x11/gdkwindow-x11.c		\
	x11/gdkxftdefaults.c		\
	x11/gdkxid.c			\
	x11/xsettings-client.c		\
	x11/xsettings-common.c		\
236
	x11/gdkx.h			\
237
	x11/gdkx11cursor.h		\
238
	x11/gdkx11display.h		\
239
	x11/gdkx11property.h		\
240
	x11/gdkx11screen.h		\
241
	x11/gdkx11selection.h		\
242
	x11/gdkx11utils.h		\
243
	x11/gdkx11visual.h		\
244
	x11/gdkx11window.h
245

246
GdkX11-3.0.gir: libgdk-3.la Gdk-3.0.gir Makefile
247
GdkX11_3_0_gir_SCANNERFLAGS = 		\
248
	--identifier-prefix=Gdk		\
249 250
	--c-include="gdk/gdkx.h"	\
	--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
251
GdkX11_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
252
GdkX11_3_0_gir_LIBS = libgdk-3.la
253
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
254
GdkX11_3_0_gir_CFLAGS = $(AM_CPPFLAGS) -L$(top_builddir)/gdk
255
GdkX11_3_0_gir_EXPORT_PACKAGES = gdk-x11-3.0
256
INTROSPECTION_GIRS += GdkX11-3.0.gir
257

258 259
endif # USE_X11

260
girdir = $(datadir)/gir-1.0
Javier Jardón's avatar
Javier Jardón committed
261
gir_DATA = $(INTROSPECTION_GIRS)
262

263
typelibsdir = $(libdir)/girepository-1.0
264
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
265

Javier Jardón's avatar
Javier Jardón committed
266
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
267 268

endif # HAVE_INTROSPECTION
269

270
if OS_WIN32
271
install-def-file: gdk.def
272
	mkdir -p $(DESTDIR)$(libdir)
273
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
274
uninstall-def-file:
275
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
276
else
277 278
install-def-file:
uninstall-def-file:
279 280 281 282 283 284
endif

if MS_LIB_AVAILABLE
noinst_DATA = gdk-win32-$(GTK_API_VERSION).lib

gdk-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 287

install-ms-lib:
288
	mkdir -p $(DESTDIR)$(libdir)
289 290 291 292 293 294 295 296 297
	$(INSTALL) gdk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)

uninstall-ms-lib:
	-rm $(DESTDIR)$(libdir)/gdk-win32-$(GTK_API_VERSION).lib
else
install-ms-lib:
uninstall-ms-lib:
endif

298 299
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
300
gdk.def: gdk.symbols
301
	$(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
302

Matthias Clasen's avatar
Matthias Clasen committed
303
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
304
if OS_LINUX
305
TESTS = abicheck.sh
306 307
endif

308
lib_LTLIBRARIES = libgdk-3.la
309

310 311
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
312

313 314
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
315
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.la
316 317
endif

318 319
BUILT_SOURCES = \
	$(gdk_built_sources)			\
320 321 322
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
323
	@true
324
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
325
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
326
		$(gdk_public_h_sources) ) >> xgen-geth \
327
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
328 329
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
330
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
331
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
332
		$(gdk_public_h_sources) ) > xgen-getc \
333
	&& cp xgen-getc gdkenumtypes.c  \
334
	&& rm -f xgen-getc
335

336
#
337 338
# Marshaller generation
#
339
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
340
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
341 342 343
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
344
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp	\
345 346
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
347

348
gdkconfig.h: stamp-gc-h
349
	$(AM_V_GEN) if test -f gdkconfig.h; then :; \
350
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
351
stamp-gc-h: $(top_builddir)/config.status
352
	$(AM_V_at) cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
353 354
	echo timestamp > stamp-gc-h

355
dist-hook: ../build/win32/vs9/gdk.vcproj ../build/win32/vs10/gdk.vcxproj ../build/win32/vs10/gdk.vcxproj.filters
356 357

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
358
	for F in $(libgdk_3_la_SOURCES); do \
359 360 361 362 363 364 365
		case $$F in \
		*.c) echo '   <File RelativePath="..\..\..\gdk\'$$F'" />' \
		     ;; \
		esac; \
	done >libgdk.sourcefiles
	$(CPP) -P - <$(top_srcdir)/build/win32/vs9/gdk.vcprojin >$@
	rm libgdk.sourcefiles
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
	
../build/win32/vs10/gdk.vcxproj: ../build/win32/vs10/gdk.vcxprojin
	for F in $(libgdk_3_la_SOURCES); do \
		case $$F in \
		*.c) echo '   <ClCompile Include="..\..\..\gdk\'$$F'" />' \
		     ;; \
		esac; \
	done >libgdk.vs10.sourcefiles
	$(CPP) -P - <$(top_srcdir)/build/win32/vs10/gdk.vcxprojin >$@
	rm libgdk.vs10.sourcefiles

../build/win32/vs10/gdk.vcxproj.filters: ../build/win32/vs10/gdk.vcxproj.filtersin
	for F in $(libgdk_3_la_SOURCES); do \
		case $$F in \
		*.c) echo '   <ClCompile Include="..\..\..\gdk\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
		     ;; \
		esac; \
	done >libgdk.vs10.sourcefiles.filters
	$(CPP) -P - <$(top_srcdir)/build/win32/vs10/gdk.vcxproj.filtersin >$@
	rm libgdk.vs10.sourcefiles.filters
386

387 388
DISTCLEANFILES = gdkconfig.h stamp-gc-h

389
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
390

391
uninstall-local: uninstall-ms-lib uninstall-def-file
392 393 394 395 396 397 398 399
	rm -f $(DESTDIR)$(configexecincludedir)/gdkconfig.h

# if srcdir!=builddir, clean out maintainer-clean files from builddir
# this allows dist to pass.
distclean-local:
	if test $(srcdir) != .; then \
	  rm -f $(MAINTAINERCLEANFILES); \
	fi
Tor Lillqvist's avatar
Tor Lillqvist committed
400

Elliot Lee's avatar
Elliot Lee committed
401 402 403 404 405 406
.PHONY: files

files:
	@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
	  echo $$p; \
	done
407 408

-include $(top_srcdir)/git.mk