Makefile.am 10.3 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
	gdkmarshalers.list	\
27
	gdkwindowimpl.h		\
28
	makefile.msc		\
29 30
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
31
	gdkversionmacros.h.in
32

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

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

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

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

94
gdk_private_headers = 				\
95
	gdkapplaunchcontextprivate.h		\
96
	gdkcursorprivate.h			\
97
	gdkdevicemanagerprivate.h		\
98
	gdkdeviceprivate.h			\
99 100 101
	gdkdisplaymanagerprivate.h		\
	gdkdisplayprivate.h			\
	gdkdndprivate.h				\
Owen W. Taylor's avatar
Owen W. Taylor committed
102
	gdkframeclockidle.h			\
103
	gdkframeclockprivate.h			\
104 105
	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
	gdkdevice.c				\
	gdkdevicemanager.c			\
	gdkdisplay.c				\
	gdkdisplaymanager.c			\
	gdkdnd.c				\
	gdkevents.c     			\
124
	gdkframetimings.c			\
125 126 127 128
	gdkglobals.c				\
	gdkkeys.c				\
	gdkkeyuni.c				\
	gdkoffscreenwindow.c			\
Owen W. Taylor's avatar
Owen W. Taylor committed
129 130
	gdkframeclock.c				\
	gdkframeclockidle.c			\
131 132
	gdkpango.c				\
	gdkpixbuf-drawable.c			\
133
	gdkproperty.c				\
134 135 136 137 138 139
	gdkrectangle.c				\
	gdkrgba.c				\
	gdkscreen.c				\
	gdkselection.c				\
	gdkvisual.c				\
	gdkwindow.c				\
140
	gdkwindowimpl.c
141

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

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

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

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

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

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

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

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

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

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

193 194
if HAVE_INTROSPECTION

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

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

211
if USE_X11
Matthias Clasen's avatar
Matthias Clasen committed
212 213 214 215
x11_introspection_files = 		\
	x11/gdkapplaunchcontext-x11.c	\
	x11/gdkasync.c			\
	x11/gdkcursor-x11.c		\
216 217
	x11/gdkdevice-core-x11.c	\
	x11/gdkdevicemanager-core-x11.c	\
Matthias Clasen's avatar
Matthias Clasen committed
218
	x11/gdkdevicemanager-x11.c	\
219
	x11/gdkdevicemanager-xi2.c	\
Matthias Clasen's avatar
Matthias Clasen committed
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
	x11/gdkdevice-xi2.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		\
238
	x11/gdkx.h			\
239
	x11/gdkx11cursor.h		\
240
	x11/gdkx11display.h		\
241
	x11/gdkx11property.h		\
242
	x11/gdkx11screen.h		\
243
	x11/gdkx11selection.h		\
244
	x11/gdkx11utils.h		\
245
	x11/gdkx11visual.h		\
246
	x11/gdkx11window.h
247

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

260 261
endif # USE_X11

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

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

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

endif # HAVE_INTROSPECTION
271

272
if OS_WIN32
273
install-def-file: gdk.def
274
	mkdir -p $(DESTDIR)$(libdir)
275
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
276
uninstall-def-file:
277
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
278
else
279 280
install-def-file:
uninstall-def-file:
281 282 283 284 285 286
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
287
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
288 289

install-ms-lib:
290
	mkdir -p $(DESTDIR)$(libdir)
291 292 293 294 295 296 297 298 299
	$(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

300
lib_LTLIBRARIES = libgdk-3.la
301

302
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
303 304 305
EXTRA_DIST += \
	$(gdk_built_sources)	\
	fallback-c89.c
306

307 308
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
309
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.la
310 311
endif

312 313
BUILT_SOURCES = \
	$(gdk_built_sources)			\
314 315 316
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
317
	@true
318
stamp-gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
319
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
320
		$(gdk_public_h_sources) ) >> xgen-geth \
321
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
322 323
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
324
gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
325
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
326
		$(gdk_public_h_sources) ) > xgen-getc \
327
	&& cp xgen-getc gdkenumtypes.c  \
328
	&& rm -f xgen-getc
329

330
#
331 332
# Marshaller generation
#
333
gdkmarshalers.h: gdkmarshalers.list
334
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
335 336
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
337
gdkmarshalers.c: gdkmarshalers.list
338 339
	$(AM_V_GEN) (echo "#include \"gdkmarshalers.h\""; \
	 $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
340 341
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
342

343
gdkconfig.h: stamp-gc-h
344
	$(AM_V_GEN) if test -f gdkconfig.h; then :; \
345
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
346
stamp-gc-h: $(top_builddir)/config.status
347
	$(AM_V_at) cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
348 349
	echo timestamp > stamp-gc-h

350
dist-hook: ../build/win32/vs9/gdk.vcproj ../build/win32/vs10/gdk.vcxproj ../build/win32/vs10/gdk.vcxproj.filters
351 352

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
353
	for F in $(libgdk_3_la_SOURCES); do \
354 355 356 357 358 359 360
		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
361

362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
../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
381

382 383
DISTCLEANFILES = gdkconfig.h stamp-gc-h

384
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
385

386
uninstall-local: uninstall-ms-lib uninstall-def-file
387 388 389 390 391 392 393 394
	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
395

Elliot Lee's avatar
Elliot Lee committed
396 397 398 399 400 401
.PHONY: files

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

-include $(top_srcdir)/git.mk