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

14
SUBDIRS = $(GDK_BACKENDS) .
15

16
DIST_SUBDIRS = win32 x11 quartz broadway wayland
Tor Lillqvist's avatar
Tor Lillqvist committed
17

18 19
CLEANFILES =

20
EXTRA_DIST += 			\
21
	keynames.txt		\
22
	keynames-translate.txt	\
23
	keyname-table.h		\
24
	gdkkeynames.c		\
25
	gen-keyname-table.pl	\
26
	gdkconfig.h.win32	\
27
	gdkconfig.h.win32_broadway	\
28
	gdkkeysyms-update.pl	\
29
	gdkmarshalers.list	\
30
	gdkwindowimpl.h		\
31
	makefile.msc		\
32 33
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
34
	gdkversionmacros.h.in
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

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
LDADD = 					\
	$(GTK_LINK_FLAGS)			\
	-version-info $(LT_VERSION_INFO)	\
	-export-dynamic 			\
	-rpath $(libdir) 			\
57
	$(no_undefined)
58

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

97
gdk_private_headers = 				\
98
	gdkapplaunchcontextprivate.h		\
99
	gdkcursorprivate.h			\
100
	gdkdevicemanagerprivate.h		\
101
	gdkdeviceprivate.h			\
102 103 104
	gdkdisplaymanagerprivate.h		\
	gdkdisplayprivate.h			\
	gdkdndprivate.h				\
Owen W. Taylor's avatar
Owen W. Taylor committed
105
	gdkframeclockidle.h			\
106
	gdkframeclockprivate.h			\
107 108
	gdkscreenprivate.h			\
	gdkinternals.h				\
109
	gdkintl.h				\
110
	gdkkeysprivate.h			\
111 112
	gdkvisualprivate.h			\
	gdkx.h
113

114 115 116 117 118 119
gdk_c_sources = 				\
	gdk.c					\
	gdkapplaunchcontext.c			\
	gdkcairo.c				\
	gdkcolor.c				\
	gdkcursor.c				\
120
	gdkdeprecated.c				\
121 122 123 124 125 126
	gdkdevice.c				\
	gdkdevicemanager.c			\
	gdkdisplay.c				\
	gdkdisplaymanager.c			\
	gdkdnd.c				\
	gdkevents.c     			\
127
	gdkframetimings.c			\
128 129 130 131
	gdkglobals.c				\
	gdkkeys.c				\
	gdkkeyuni.c				\
	gdkoffscreenwindow.c			\
Owen W. Taylor's avatar
Owen W. Taylor committed
132 133
	gdkframeclock.c				\
	gdkframeclockidle.c			\
134 135
	gdkpango.c				\
	gdkpixbuf-drawable.c			\
136
	gdkproperty.c				\
137 138 139 140 141 142
	gdkrectangle.c				\
	gdkrgba.c				\
	gdkscreen.c				\
	gdkselection.c				\
	gdkvisual.c				\
	gdkwindow.c				\
143
	gdkwindowimpl.c
144

145
gdk_built_sources = 				\
146
	gdkenumtypes.h				\
147 148 149
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
150
	gdkversionmacros.h
151

152
#
153
# setup GDK sources and their dependencies
154
#
155

156
gdkincludedir = $(includedir)/gtk-3.0/gdk
157
gdkinclude_HEADERS = $(gdk_public_h_sources) gdkenumtypes.h gdkversionmacros.h
158
nodist_gdkinclude_HEADERS = gdkconfig.h
159

Matthias Clasen's avatar
Matthias Clasen committed
160 161 162
common_sources = 		\
	$(gdk_private_headers)	\
	$(gdk_c_sources)	\
163
	gdkenumtypes.c		\
164
	gdkmarshalers.c		\
165
	gdkmarshalers.h
166

167
libgdk_3_la_SOURCES = $(common_sources)
168
libgdk_3_la_CFLAGS = $(AM_CFLAGS) $(GDK_HIDDEN_VISIBILITY_CFLAGS)
169 170
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS)
libgdk_3_la_LDFLAGS = $(LDADD)
171

172
if USE_X11
173
libgdk_3_la_LIBADD += x11/libgdk-x11.la
174 175 176
endif # USE_X11

if USE_QUARTZ
177
libgdk_3_la_CFLAGS += -xobjective-c
178
libgdk_3_la_LIBADD += quartz/libgdk-quartz.la
179
endif # USE_QUARTZ
180

181
if USE_WIN32
182 183 184 185
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
186
endif # USE_WIN32
Anders Carlsson's avatar
Anders Carlsson committed
187

188
if USE_BROADWAY
189
libgdk_3_la_LIBADD += broadway/libgdk-broadway.la
190
endif # USE_BROADWAY
191

Kristian Høgsberg's avatar
Kristian Høgsberg committed
192
if USE_WAYLAND
193
libgdk_3_la_LIBADD += wayland/libgdk-wayland.la
Kristian Høgsberg's avatar
Kristian Høgsberg committed
194 195
endif

196 197
if HAVE_INTROSPECTION

Matthias Clasen's avatar
Matthias Clasen committed
198
introspection_files = 		\
199
	$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))	\
Matthias Clasen's avatar
Matthias Clasen committed
200 201
	$(gdk_c_sources)	\
        gdkenumtypes.c		\
202
        gdkenumtypes.h
203

204
Gdk-3.0.gir: libgdk-3.la Makefile
205 206
Gdk_3_0_gir_SCANNERFLAGS = 	\
	--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
LRN's avatar
LRN committed
213 214 215
if OS_WIN32
Gdk_3_0_gir_CFLAGS += -I$(srcdir)/win32 -I$(srcdir)
endif
216
if USE_X11
Matthias Clasen's avatar
Matthias Clasen committed
217 218 219 220
x11_introspection_files = 		\
	x11/gdkapplaunchcontext-x11.c	\
	x11/gdkasync.c			\
	x11/gdkcursor-x11.c		\
221 222
	x11/gdkdevice-core-x11.c	\
	x11/gdkdevicemanager-core-x11.c	\
Matthias Clasen's avatar
Matthias Clasen committed
223
	x11/gdkdevicemanager-x11.c	\
224
	x11/gdkdevicemanager-xi2.c	\
Matthias Clasen's avatar
Matthias Clasen committed
225 226
	x11/gdkdevice-xi2.c		\
	x11/gdkdisplay-x11.c		\
227
	x11/gdkdisplaymanager-x11.c	\
Matthias Clasen's avatar
Matthias Clasen committed
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
	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		\
244
	x11/gdkx.h			\
245
	x11/gdkx11applaunchcontext.h	\
246
	x11/gdkx11cursor.h		\
247 248 249 250 251 252
	x11/gdkx11device.h		\
	x11/gdkx11device-core.h		\
	x11/gdkx11device-xi2.h		\
	x11/gdkx11devicemanager.h	\
	x11/gdkx11devicemanager-core.h	\
	x11/gdkx11devicemanager-xi2.h	\
253
	x11/gdkx11display.h		\
254 255 256
	x11/gdkx11displaymanager.h	\
	x11/gdkx11dnd.h			\
	x11/gdkx11keys.h		\
257
	x11/gdkx11property.h		\
258
	x11/gdkx11screen.h		\
259
	x11/gdkx11selection.h		\
260
	x11/gdkx11utils.h		\
261
	x11/gdkx11visual.h		\
262
	x11/gdkx11window.h
263

264
GdkX11-3.0.gir: libgdk-3.la Gdk-3.0.gir Makefile
265
GdkX11_3_0_gir_SCANNERFLAGS = 		\
266
	--identifier-prefix=Gdk		\
267 268
	--c-include="gdk/gdkx.h"	\
	--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
269
GdkX11_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
270
GdkX11_3_0_gir_LIBS = libgdk-3.la
271
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
272
GdkX11_3_0_gir_CFLAGS = $(AM_CPPFLAGS) -L$(top_builddir)/gdk
273
GdkX11_3_0_gir_EXPORT_PACKAGES = gdk-x11-3.0
274
INTROSPECTION_GIRS += GdkX11-3.0.gir
275

276 277
endif # USE_X11

LRN's avatar
LRN committed
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
if OS_WIN32
w32_introspection_files =		\
	win32/gdkcursor-win32.c		\
	win32/gdkdevicemanager-win32.c	\
	win32/gdkdevice-virtual.c	\
	win32/gdkdevice-win32.c		\
	win32/gdkdevice-wintab.c	\
	win32/gdkdisplaymanager-win32.c	\
	win32/gdkdisplay-win32.c	\
	win32/gdkdnd-win32.c		\
	win32/gdkevents-win32.c		\
	win32/gdkgeometry-win32.c	\
	win32/gdkglobals-win32.c	\
	win32/gdkinput.c		\
	win32/gdkkeys-win32.c		\
	win32/gdkmain-win32.c		\
	win32/gdkproperty-win32.c	\
	win32/gdkscreen-win32.c		\
	win32/gdkselection-win32.c	\
	win32/gdktestutils-win32.c	\
	win32/gdkvisual-win32.c		\
	win32/gdkwin32.h		\
	win32/gdkwin32cursor.h		\
	win32/gdkwin32display.h		\
	win32/gdkwin32displaymanager.h	\
	win32/gdkwin32dnd.h		\
	win32/gdkwin32id.c		\
	win32/gdkwin32keys.h		\
	win32/gdkwin32misc.h		\
	win32/gdkwin32screen.h		\
	win32/gdkwin32window.h		\
	win32/gdkwindow-win32.c


GdkWin32-3.0.gir: libgdk-3.la Gdk-3.0.gir Makefile
GdkWin32_3_0_gir_SCANNERFLAGS = \
	--identifier-prefix=Gdk		\
	--c-include="gdk/gdkwin32.h"	\
	--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
GdkWin32_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0
GdkWin32_3_0_gir_LIBS = libgdk-3.la
GdkWin32_3_0_gir_FILES = $(w32_introspection_files)
GdkWin32_3_0_gir_CFLAGS = $(AM_CPPFLAGS) -L$(top_builddir)/gdk -I$(srcdir)/win32 -I$(srcdir)
INTROSPECTION_GIRS += GdkWin32-3.0.gir

endif # OS_WIN32

325
girdir = $(datadir)/gir-1.0
Javier Jardón's avatar
Javier Jardón committed
326
gir_DATA = $(INTROSPECTION_GIRS)
327

328
typelibsdir = $(libdir)/girepository-1.0
329
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
330

Javier Jardón's avatar
Javier Jardón committed
331
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
332 333

endif # HAVE_INTROSPECTION
334

335
if OS_WIN32
336
install-def-file: gdk.def
337
	mkdir -p $(DESTDIR)$(libdir)
338
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
339
uninstall-def-file:
340
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
341
else
342 343
install-def-file:
uninstall-def-file:
344 345 346 347 348 349
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
350
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
351 352

install-ms-lib:
353
	mkdir -p $(DESTDIR)$(libdir)
354 355 356 357 358 359 360 361 362
	$(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

363
lib_LTLIBRARIES = libgdk-3.la
364

365
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
366 367 368
EXTRA_DIST += \
	$(gdk_built_sources)	\
	fallback-c89.c
369

370 371
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
372
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.la
373 374
endif

375 376
BUILT_SOURCES = \
	$(gdk_built_sources)			\
377 378 379
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
380
	@true
381
stamp-gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
382
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
383
		$(gdk_public_h_sources) ) >> xgen-geth \
384
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
385 386
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
387
gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
388
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
389
		$(gdk_public_h_sources) ) > xgen-getc \
390
	&& cp xgen-getc gdkenumtypes.c  \
391
	&& rm -f xgen-getc
392

393
#
394 395
# Marshaller generation
#
396
gdkmarshalers.h: gdkmarshalers.list
397
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
398 399
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
400
gdkmarshalers.c: gdkmarshalers.list
401 402
	$(AM_V_GEN) (echo "#include \"gdkmarshalers.h\""; \
	 $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
403 404
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
405

406
gdkconfig.h: stamp-gc-h
407
	$(AM_V_GEN) if test -f gdkconfig.h; then :; \
408
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
409
stamp-gc-h: $(top_builddir)/config.status
410
	$(AM_V_at) cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
411 412
	echo timestamp > stamp-gc-h

413
dist-hook: ../build/win32/vs9/gdk.vcproj ../build/win32/vs10/gdk.vcxproj ../build/win32/vs10/gdk.vcxproj.filters
414 415

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
416
	for F in $(libgdk_3_la_SOURCES); do \
417 418 419 420 421 422 423
		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
424

425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
../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
444

445 446
DISTCLEANFILES = gdkconfig.h stamp-gc-h

447
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
448

449
uninstall-local: uninstall-ms-lib uninstall-def-file
450 451 452 453 454 455 456 457
	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
458

Elliot Lee's avatar
Elliot Lee committed
459 460 461 462 463 464
.PHONY: files

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

-include $(top_srcdir)/git.mk