Makefile.am 9.62 KB
Newer Older
1
## Makefile.am for gtk+/gdk
2
include $(top_srcdir)/Makefile.decl
3
-include $(INTROSPECTION_MAKEFILE)
Johan Dahlin's avatar
Johan Dahlin committed
4 5
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
6 7
	--add-include-path=../gdk \
	--warn-all
Johan Dahlin's avatar
Johan Dahlin committed
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 tests
Tor Lillqvist's avatar
Tor Lillqvist committed
15

16 17
CLEANFILES =

18
EXTRA_DIST += 			\
19 20
	keynames.txt		\
	keyname-table.h		\
21
	gdkkeynames.c		\
22
	gen-keyname-table.pl	\
23
	gdkconfig.h.win32	\
24
	gdkkeysyms-update.pl	\
25
	gdk.def			\
26
	gdkmarshalers.list	\
27
	gdkwindowimpl.h		\
Tim Janik's avatar
Tim Janik committed
28
	makeenums.pl		\
29 30
	makefile.msc		\
	gdk.symbols		\
31 32
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
33
	abicheck.sh
34

35
INCLUDES = 				\
Owen Taylor's avatar
Owen Taylor committed
36
	-DG_LOG_DOMAIN=\"Gdk\"		\
Manish Singh's avatar
Manish Singh committed
37
	-DGDK_COMPILATION		\
Owen Taylor's avatar
Owen Taylor committed
38
	-I$(top_srcdir)			\
39
	-I$(top_builddir)		\
Owen Taylor's avatar
Owen Taylor committed
40
	-I$(top_builddir)/gdk		\
41
	$(GTK_DEBUG_FLAGS)		\
42
	$(GDK_DEP_CFLAGS)
43

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

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

59 60 61
#
# setup source file variables
#
Owen Taylor's avatar
Started  
Owen Taylor committed
62
#
63
# GDK header files for public installation (non-generated)
Owen Taylor's avatar
Started  
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 77
	gdkdnd.h				\
	gdkevents.h				\
	gdkkeys.h				\
78
	gdkkeysyms.h				\
79
	gdkkeysyms-compat.h			\
80
	gdkmain.h				\
81 82
	gdkpango.h				\
	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_built_public_sources = 			\
Matthias Clasen's avatar
Matthias Clasen committed
96
	gdkconfig.h				\
97 98
	gdkenumtypes.h

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

114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
gdk_c_sources = 				\
	gdk.c					\
	gdkapplaunchcontext.c			\
	gdkcairo.c				\
	gdkcolor.c				\
	gdkcursor.c				\
	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				\
138
	gdkwindowimpl.c
139

140
gdk_built_sources = 				\
141 142 143
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
144
	$(gdk_built_public_sources)
145

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

150
gdkincludedir = $(includedir)/gtk-3.0/gdk
151
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
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

Matthias Clasen's avatar
Matthias Clasen committed
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
Matthias Clasen's avatar
Matthias Clasen committed
165
libgdk_3_la_LIBADD += x11/libgdk-x11.la
166 167 168
endif # USE_X11

if USE_QUARTZ
Matthias Clasen's avatar
Matthias Clasen committed
169
libgdk_3_la_LIBADD += quartz/libgdk-quartz.la
170
endif # USE_QUARTZ
171

172
if USE_WIN32
Matthias Clasen's avatar
Matthias Clasen committed
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 180 181
if USE_BROADWAY
libgdk_3_0_la_LIBADD += broadway/libgdk-broadway.la
endif # USE_BROADWAY
182

183 184
if HAVE_INTROSPECTION

Matthias Clasen's avatar
Matthias Clasen committed
185
introspection_files = 		\
186
	$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))	\
Matthias Clasen's avatar
Matthias Clasen committed
187 188
	$(gdk_c_sources)	\
        gdkenumtypes.c		\
189
        gdkenumtypes.h
190

Matthias Clasen's avatar
Matthias Clasen committed
191
Gdk-3.0.gir: libgdk-3.la Makefile
192 193
Gdk_3_0_gir_SCANNERFLAGS = 	\
	--c-include="gdk/gdk.h"
194
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
Matthias Clasen's avatar
Matthias Clasen committed
195
Gdk_3_0_gir_LIBS = libgdk-3.la
196
Gdk_3_0_gir_FILES = $(introspection_files)
197
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
198
Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
199
INTROSPECTION_GIRS += Gdk-3.0.gir
200

201
if USE_X11
Matthias Clasen's avatar
Matthias Clasen committed
202 203 204 205 206
x11_introspection_files = 		\
	x11/checksettings.c		\
	x11/gdkapplaunchcontext-x11.c	\
	x11/gdkasync.c			\
	x11/gdkcursor-x11.c		\
207 208
	x11/gdkdevice-core-x11.c	\
	x11/gdkdevicemanager-core-x11.c	\
Matthias Clasen's avatar
Matthias Clasen committed
209 210
	x11/gdkdevicemanager-x11.c	\
	x11/gdkdevicemanager-xi.c	\
211
	x11/gdkdevicemanager-xi2.c	\
Matthias Clasen's avatar
Matthias Clasen committed
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
	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		\
232
        x11/gdkx.h			\
233
	x11/gdkx11cursor.h		\
234
	x11/gdkx11display.h		\
235
	x11/gdkx11property.h		\
236
	x11/gdkx11screen.h		\
237
	x11/gdkx11selection.h		\
238
	x11/gdkx11utils.h		\
239
	x11/gdkx11visual.h		\
240
	x11/gdkx11window.h
241

Matthias Clasen's avatar
Matthias Clasen committed
242
GdkX11-3.0.gir: libgdk-3.la Gdk-3.0.gir Makefile
243
GdkX11_3_0_gir_SCANNERFLAGS = 		\
244
	--identifier-prefix=Gdk		\
245 246
	--c-include="gdk/gdkx.h"	\
	--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
247
GdkX11_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
Matthias Clasen's avatar
Matthias Clasen committed
248
GdkX11_3_0_gir_LIBS = libgdk-3.la
249
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
Matthias Clasen's avatar
Matthias Clasen committed
250
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
251
GdkX11_3_0_gir_EXPORT_PACKAGES = gdk-x11-3.0
252
INTROSPECTION_GIRS += GdkX11-3.0.gir
253

254 255
endif # USE_X11

256
girdir = $(datadir)/gir-1.0
Javier Jardon's avatar
Javier Jardon committed
257
gir_DATA = $(INTROSPECTION_GIRS)
258

259
typelibsdir = $(libdir)/girepository-1.0
260
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
261

Javier Jardon's avatar
Javier Jardon committed
262
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
263 264

endif # HAVE_INTROSPECTION
265

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

install-ms-lib:
284
	mkdir -p $(DESTDIR)$(libdir)
285 286 287 288 289 290 291 292 293
	$(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

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

Matthias Clasen's avatar
Matthias Clasen committed
299
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
Matthias Clasen's avatar
Matthias Clasen committed
300
if OS_LINUX
301
TESTS = abicheck.sh
302 303
endif

Matthias Clasen's avatar
Matthias Clasen committed
304
lib_LTLIBRARIES = libgdk-3.la
305

306 307
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
308
EXTRA_HEADERS =
309

310 311
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
Matthias Clasen's avatar
Matthias Clasen committed
312
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.la
313 314
endif

315
#note: not gdkconfig.h
316 317
BUILT_SOURCES = \
	$(gdk_built_sources)			\
318 319 320
	gdkconfig.h

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

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

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

353 354 355
dist-hook: ../build/win32/vs9/gdk.vcproj

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
Matthias Clasen's avatar
Matthias Clasen committed
356
	for F in $(libgdk_3_la_SOURCES); do \
357 358 359 360 361 362 363 364
		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

365 366
DISTCLEANFILES = gdkconfig.h stamp-gc-h

367
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
368

369
uninstall-local: uninstall-ms-lib uninstall-def-file
370 371 372 373 374 375 376 377
	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
378

Elliot Lee's avatar
Elliot Lee committed
379 380 381 382 383 384
.PHONY: files

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

-include $(top_srcdir)/git.mk