Makefile.am 10.6 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
SUBDIRS = $(GDK_BACKENDS) .
13

14
DIST_SUBDIRS = win32 x11 quartz broadway wayland
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
	gdkconfig.h.win32_broadway	\
26
	gdkkeysyms-update.pl	\
27
	gdkmarshalers.list	\
28
	gdkwindowimpl.h		\
29
	makefile.msc		\
30 31
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
32
	gdkversionmacros.h.in
33

34
AM_CPPFLAGS = 				\
35
	-DG_LOG_DOMAIN=\"Gdk\"		\
36
	-DGDK_COMPILATION		\
37
	-I$(top_builddir)		\
38
	-I$(top_builddir)/gdk		\
39
	-I$(top_srcdir)			\
40
	$(GTK_DEBUG_FLAGS)		\
41
	$(GDK_DEP_CFLAGS)
42

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

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

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

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

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

143
gdk_built_sources = 				\
144
	gdkenumtypes.h				\
145 146 147
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
148
	gdkversionmacros.h
149

150
#
151
# setup GDK sources and their dependencies
152
#
153

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

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

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

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

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

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

186
if USE_BROADWAY
187
libgdk_3_la_LIBADD += broadway/libgdk-broadway.la
188
endif # USE_BROADWAY
189

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

194 195
if HAVE_INTROSPECTION

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

202
Gdk-3.0.gir: libgdk-3.la Makefile
203 204
Gdk_3_0_gir_SCANNERFLAGS = 	\
	--c-include="gdk/gdk.h"
205
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
206
Gdk_3_0_gir_LIBS = libgdk-3.la
207
Gdk_3_0_gir_FILES = $(introspection_files)
208
Gdk_3_0_gir_CFLAGS = $(AM_CPPFLAGS)
209
Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
210
INTROSPECTION_GIRS += Gdk-3.0.gir
211

212
if USE_X11
Matthias Clasen's avatar
Matthias Clasen committed
213 214 215 216
x11_introspection_files = 		\
	x11/gdkapplaunchcontext-x11.c	\
	x11/gdkasync.c			\
	x11/gdkcursor-x11.c		\
217 218
	x11/gdkdevice-core-x11.c	\
	x11/gdkdevicemanager-core-x11.c	\
Matthias Clasen's avatar
Matthias Clasen committed
219
	x11/gdkdevicemanager-x11.c	\
220
	x11/gdkdevicemanager-xi2.c	\
Matthias Clasen's avatar
Matthias Clasen committed
221 222
	x11/gdkdevice-xi2.c		\
	x11/gdkdisplay-x11.c		\
223
	x11/gdkdisplaymanager-x11.c	\
Matthias Clasen's avatar
Matthias Clasen committed
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
	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		\
240
	x11/gdkx.h			\
241
	x11/gdkx11applaunchcontext.h	\
242
	x11/gdkx11cursor.h		\
243 244 245 246 247 248
	x11/gdkx11device.h		\
	x11/gdkx11device-core.h		\
	x11/gdkx11device-xi2.h		\
	x11/gdkx11devicemanager.h	\
	x11/gdkx11devicemanager-core.h	\
	x11/gdkx11devicemanager-xi2.h	\
249
	x11/gdkx11display.h		\
250 251 252
	x11/gdkx11displaymanager.h	\
	x11/gdkx11dnd.h			\
	x11/gdkx11keys.h		\
253
	x11/gdkx11property.h		\
254
	x11/gdkx11screen.h		\
255
	x11/gdkx11selection.h		\
256
	x11/gdkx11utils.h		\
257
	x11/gdkx11visual.h		\
258
	x11/gdkx11window.h
259

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

272 273
endif # USE_X11

274
girdir = $(datadir)/gir-1.0
Javier Jardón's avatar
Javier Jardón committed
275
gir_DATA = $(INTROSPECTION_GIRS)
276

277
typelibsdir = $(libdir)/girepository-1.0
278
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
279

Javier Jardón's avatar
Javier Jardón committed
280
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
281 282

endif # HAVE_INTROSPECTION
283

284
if OS_WIN32
285
install-def-file: gdk.def
286
	mkdir -p $(DESTDIR)$(libdir)
287
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
288
uninstall-def-file:
289
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
290
else
291 292
install-def-file:
uninstall-def-file:
293 294 295 296 297 298
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
299
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
300 301

install-ms-lib:
302
	mkdir -p $(DESTDIR)$(libdir)
303 304 305 306 307 308 309 310 311
	$(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

312
lib_LTLIBRARIES = libgdk-3.la
313

314
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
315 316 317
EXTRA_DIST += \
	$(gdk_built_sources)	\
	fallback-c89.c
318

319 320
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
321
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.la
322 323
endif

324 325
BUILT_SOURCES = \
	$(gdk_built_sources)			\
326 327 328
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
329
	@true
330
stamp-gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
331
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
332
		$(gdk_public_h_sources) ) >> xgen-geth \
333
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
334 335
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
336
gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
337
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
338
		$(gdk_public_h_sources) ) > xgen-getc \
339
	&& cp xgen-getc gdkenumtypes.c  \
340
	&& rm -f xgen-getc
341

342
#
343 344
# Marshaller generation
#
345
gdkmarshalers.h: gdkmarshalers.list
346
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
347 348
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
349
gdkmarshalers.c: gdkmarshalers.list
350 351
	$(AM_V_GEN) (echo "#include \"gdkmarshalers.h\""; \
	 $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
352 353
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
354

355
gdkconfig.h: stamp-gc-h
356
	$(AM_V_GEN) if test -f gdkconfig.h; then :; \
357
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
358
stamp-gc-h: $(top_builddir)/config.status
359
	$(AM_V_at) cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
360 361
	echo timestamp > stamp-gc-h

362
dist-hook: ../build/win32/vs9/gdk.vcproj ../build/win32/vs10/gdk.vcxproj ../build/win32/vs10/gdk.vcxproj.filters
363 364

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
365
	for F in $(libgdk_3_la_SOURCES); do \
366 367 368 369 370 371 372
		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
373

374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
../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
393

394 395
DISTCLEANFILES = gdkconfig.h stamp-gc-h

396
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
397

398
uninstall-local: uninstall-ms-lib uninstall-def-file
399 400 401 402 403 404 405 406
	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
407

Elliot Lee's avatar
Elliot Lee committed
408 409 410 411 412 413
.PHONY: files

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

-include $(top_srcdir)/git.mk