Makefile.am 9.39 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
   --add-include-path=../gdk
Johan Dahlin's avatar
Johan Dahlin committed
7 8
INTROSPECTION_COMPILER_ARGS = \
   --includedir=$(srcdir) \
9
   --includedir=.
Elliot Lee's avatar
Elliot Lee committed
10

11 12
SUBDIRS = $(GDK_BACKENDS) . tests

Benjamin Otte's avatar
Benjamin Otte committed
13
DIST_SUBDIRS = win32 x11 quartz tests
Tor Lillqvist's avatar
Tor Lillqvist committed
14

15 16
CLEANFILES =

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

34
INCLUDES = 				\
Owen Taylor's avatar
Owen Taylor committed
35
	-DG_LOG_DOMAIN=\"Gdk\"		\
Manish Singh's avatar
Manish Singh committed
36
	-DGDK_COMPILATION		\
Owen Taylor's avatar
Owen Taylor committed
37
	-I$(top_srcdir)			\
38
	-I$(top_builddir)		\
Owen Taylor's avatar
Owen Taylor committed
39
	-I$(top_builddir)/gdk		\
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 55
LDADD = 					\
	$(GTK_LINK_FLAGS)			\
	-version-info $(LT_VERSION_INFO)	\
	-export-dynamic 			\
	-rpath $(libdir) 			\
	$(no_undefined)				\
56 57
	$(LIBTOOL_EXPORT_OPTIONS)

58 59 60
#
# setup source file variables
#
Owen Taylor's avatar
Started  
Owen Taylor committed
61
#
62
# GDK header files for public installation (non-generated)
Owen Taylor's avatar
Started  
Owen Taylor committed
63
#
64
gdk_public_h_sources = 				\
65
	gdk.h					\
66
	gdkapplaunchcontext.h			\
67
	gdkcairo.h				\
68 69
	gdkcolor.h				\
	gdkcursor.h				\
70 71
	gdkdevice.h				\
	gdkdevicemanager.h			\
72
	gdkdisplay.h				\
73
	gdkdisplaymanager.h			\
74 75 76
	gdkdnd.h				\
	gdkevents.h				\
	gdkkeys.h				\
77
	gdkkeysyms.h				\
78
	gdkkeysyms-compat.h			\
79
	gdkmain.h				\
80 81
	gdkpango.h				\
	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_built_public_sources = 			\
Matthias Clasen's avatar
Matthias Clasen committed
95
	gdkconfig.h				\
96 97
	gdkenumtypes.h

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

112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
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				\
136
	gdkwindowimpl.c
137

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

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

148
gdkincludedir = $(includedir)/gtk-3.0/gdk
149
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
150

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

Matthias Clasen's avatar
Matthias Clasen committed
158
libgdk_3_0_la_SOURCES = $(common_sources)
159
libgdk_3_0_la_LIBADD = $(GDK_DEP_LIBS)
Matthias Clasen's avatar
Matthias Clasen committed
160 161
libgdk_3_0_la_LDFLAGS = $(LDADD)

162 163 164 165 166 167 168 169 170 171 172 173 174 175
if USE_X11
libgdk_3_0_la_LIBADD += x11/libgdk-x11.la
endif # USE_X11

if USE_QUARTZ
libgdk_3_0_la_LIBADD += quartz/libgdk-quartz.la
endif # USE_QUARTZ

if USE_WIN32
libgdk_3_0_la_SOURCES += gdkkeynames.c
libgdk_3_0_la_LIBADD += win32/libgdk-win32.la
libgdk_3_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
libgdk_3_0_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def
endif # USE_WIN32
176

177 178
if HAVE_INTROSPECTION

Matthias Clasen's avatar
Matthias Clasen committed
179
introspection_files = 		\
180
	$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))	\
Matthias Clasen's avatar
Matthias Clasen committed
181 182
	$(gdk_c_sources)	\
        gdkenumtypes.c		\
183
        gdkenumtypes.h
184

Matthias Clasen's avatar
Matthias Clasen committed
185
Gdk-3.0.gir: libgdk-3.0.la Makefile
186
Gdk_3_0_gir_SCANNERFLAGS = --warn-all --c-include="gdk/gdk.h"
187
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
Matthias Clasen's avatar
Matthias Clasen committed
188
Gdk_3_0_gir_LIBS = libgdk-3.0.la
189
Gdk_3_0_gir_FILES = $(introspection_files)
190 191
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += Gdk-3.0.gir
192

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

Matthias Clasen's avatar
Matthias Clasen committed
234
GdkX11-3.0.gir: libgdk-3.0.la Gdk-3.0.gir Makefile
235
GdkX11_3_0_gir_SCANNERFLAGS = --warn-all --strip-prefix=Gdk
236
GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
Matthias Clasen's avatar
Matthias Clasen committed
237
GdkX11_3_0_gir_LIBS = libgdk-3.0.la
238
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
Matthias Clasen's avatar
Matthias Clasen committed
239
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
240
INTROSPECTION_GIRS += GdkX11-3.0.gir
241

242 243
endif # USE_X11

244
girdir = $(datadir)/gir-1.0
Javier Jardon's avatar
Javier Jardon committed
245
gir_DATA = $(INTROSPECTION_GIRS)
246

247
typelibsdir = $(libdir)/girepository-1.0
248
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
249

Javier Jardon's avatar
Javier Jardon committed
250
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
251 252

endif # HAVE_INTROSPECTION
253

254
if OS_WIN32
255
install-def-file: gdk.def
256
	mkdir -p $(DESTDIR)$(libdir)
257
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
258
uninstall-def-file:
259
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
260
else
261 262
install-def-file:
uninstall-def-file:
263 264 265 266 267 268
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
269
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
270 271

install-ms-lib:
272
	mkdir -p $(DESTDIR)$(libdir)
273 274 275 276 277 278 279 280 281
	$(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

282 283
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
284
gdk.def: gdk.symbols
285
	$(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
286

Matthias Clasen's avatar
Matthias Clasen committed
287
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
Matthias Clasen's avatar
Matthias Clasen committed
288
if OS_LINUX
289
TESTS = abicheck.sh
290 291
endif

292
lib_LTLIBRARIES = libgdk-3.0.la
293

294 295
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
296
EXTRA_HEADERS =
297

298 299
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
Matthias Clasen's avatar
Matthias Clasen committed
300
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.0.la
301 302
endif

303
#note: not gdkconfig.h
304 305
BUILT_SOURCES = \
	$(gdk_built_sources)			\
306 307 308
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
309
	@true
310
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
311
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
312
		$(gdk_public_h_sources) ) >> xgen-geth \
313
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
314 315
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
316
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
317
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
318
		$(gdk_public_h_sources) ) > xgen-getc \
319
	&& cp xgen-getc gdkenumtypes.c  \
320
	&& rm -f xgen-getc
321

322
#
323 324
# Marshaller generation
#
325
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
326
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
327 328 329
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
330
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp	\
331 332
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
333

334
gdkconfig.h: stamp-gc-h
335
	$(AM_V_GEN) if test -f gdkconfig.h; then :; \
336
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
337
stamp-gc-h: $(top_builddir)/config.status
338
	$(AM_V_at) cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
339 340
	echo timestamp > stamp-gc-h

341 342 343
dist-hook: ../build/win32/vs9/gdk.vcproj

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
344
	for F in $(libgdk_win32_3_0_la_SOURCES); do \
345 346 347 348 349 350 351 352
		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

353 354
DISTCLEANFILES = gdkconfig.h stamp-gc-h

355
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
356

357
uninstall-local: uninstall-ms-lib uninstall-def-file
358 359 360 361 362 363 364 365
	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
366

Elliot Lee's avatar
Elliot Lee committed
367 368 369 370 371 372
.PHONY: files

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

-include $(top_srcdir)/git.mk