Makefile.am 9.22 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
SUBDIRS = $(gdktarget) . tests
Benjamin Otte's avatar
Benjamin Otte committed
12
DIST_SUBDIRS = win32 x11 quartz tests
Tor Lillqvist's avatar
Tor Lillqvist committed
13

14 15
CLEANFILES =

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

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

40
gtarget=$(gdktarget)
Elliot Lee's avatar
Elliot Lee committed
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
LDADD = \
50
	$(GTK_LINK_FLAGS)						\
51
	-version-info $(LT_VERSION_INFO)		 		\
Owen Taylor's avatar
Owen Taylor committed
52 53 54
	-export-dynamic 						\
	-rpath $(libdir) 						\
	$(no_undefined)							\
55 56
	$(LIBTOOL_EXPORT_OPTIONS)

57 58 59
#
# setup source file variables
#
Owen Taylor's avatar
Started  
Owen Taylor committed
60
#
61
# GDK header files for public installation (non-generated)
Owen Taylor's avatar
Started  
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 75
	gdkdnd.h				\
	gdkevents.h				\
	gdkkeys.h				\
76
	gdkkeysyms.h				\
77
	gdkkeysyms-compat.h			\
78
	gdkmain.h				\
79 80
	gdkpango.h				\
	gdkpixbuf.h				\
81
	gdkprivate.h				\
82
	gdkproperty.h				\
83
	gdkrectangle.h				\
84
	gdkrgba.h				\
85
	gdkscreen.h				\
86
	gdkselection.h				\
87
	gdkspawn.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 99 100
gdk_private_headers =				\
	gdkinternals.h				\
	gdkdeviceprivate.h			\
Matthias Clasen's avatar
Matthias Clasen committed
101
	gdkintl.h
102

103
gdk_c_sources =                 \
104
	gdk.c			\
105
	gdkapplaunchcontext.c	\
106
	gdkcairo.c		\
107 108
	gdkcolor.c		\
	gdkcursor.c		\
109 110
	gdkdevice.c		\
	gdkdevicemanager.c	\
111
	gdkdisplay.c		\
112
	gdkdisplaymanager.c	\
113
	gdkdnd.c		\
114 115
	gdkevents.c     	\
	gdkglobals.c		\
116 117
	gdkkeys.c		\
	gdkkeyuni.c		\
118
	gdkoffscreenwindow.c	\
119
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
120
	gdkpixbuf-drawable.c	\
121
	gdkrectangle.c		\
122
	gdkrgba.c		\
123
	gdkscreen.c		\
124 125
	gdkselection.c		\
	gdkvisual.c		\
126 127
	gdkwindow.c		\
	gdkwindowimpl.c
128

129 130 131 132
gdk_built_sources =				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
133
	$(gdk_built_public_sources)
134

135
#
136
# setup GDK sources and their dependencies
137
#
138

139
gdkincludedir = $(includedir)/gtk-3.0/gdk
140
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
141

Matthias Clasen's avatar
Matthias Clasen committed
142 143 144
common_sources = 		\
	$(gdk_private_headers)	\
	$(gdk_c_sources)	\
145
	gdkenumtypes.c		\
146
	gdkmarshalers.c		\
147
	gdkmarshalers.h
148

Matthias Clasen's avatar
Matthias Clasen committed
149 150 151 152
libgdk_3_0_la_SOURCES = $(common_sources)
libgdk_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
libgdk_3_0_la_LDFLAGS = $(LDADD)

153
libgdk_x11_3_0_la_SOURCES = $(common_sources)
154
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
155
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
156

157
libgdk_quartz_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
158
libgdk_quartz_3_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS)
159
libgdk_quartz_3_0_la_LDFLAGS = $(LDADD)
Anders Carlsson's avatar
Anders Carlsson committed
160

161
libgdk_win32_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
162
libgdk_win32_3_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS)
163 164
libgdk_win32_3_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
libgdk_win32_3_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
165

166 167
if HAVE_INTROSPECTION

Matthias Clasen's avatar
Matthias Clasen committed
168
introspection_files = 		\
169
	$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))	\
Matthias Clasen's avatar
Matthias Clasen committed
170 171
	$(gdk_c_sources)	\
        gdkenumtypes.c		\
172
        gdkenumtypes.h
173

Matthias Clasen's avatar
Matthias Clasen committed
174
Gdk-3.0.gir: libgdk-3.0.la Makefile
175
Gdk_3_0_gir_SCANNERFLAGS = --warn-all
176
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
Matthias Clasen's avatar
Matthias Clasen committed
177
Gdk_3_0_gir_LIBS = libgdk-3.0.la
178
Gdk_3_0_gir_FILES = $(introspection_files)
179 180
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += Gdk-3.0.gir
181

182
if USE_X11
Matthias Clasen's avatar
Matthias Clasen committed
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
x11_introspection_files = 		\
	x11/checksettings.c		\
	x11/gdkapplaunchcontext-x11.c	\
	x11/gdkasync.c			\
	x11/gdkcursor-x11.c		\
	x11/gdkdevice-core.c		\
	x11/gdkdevicemanager-core.c	\
	x11/gdkdevicemanager-x11.c	\
	x11/gdkdevicemanager-xi2.c	\
	x11/gdkdevicemanager-xi.c	\
	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/gdkglobals-x11.c		\
	x11/gdkim-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/gdkspawn-x11.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		\
216 217
        x11/gdkx.h

Matthias Clasen's avatar
Matthias Clasen committed
218
GdkX11-3.0.gir: libgdk-3.0.la Gdk-3.0.gir Makefile
219
GdkX11_3_0_gir_SCANNERFLAGS = --warn-all --strip-prefix=Gdk
220
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
221
GdkX11_3_0_gir_LIBS = libgdk-3.0.la
222
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
Matthias Clasen's avatar
Matthias Clasen committed
223
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
224
INTROSPECTION_GIRS += GdkX11-3.0.gir
225 226 227

introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files))

228 229
endif # USE_X11

230
girdir = $(datadir)/gir-1.0
Javier Jardon's avatar
Javier Jardon committed
231
gir_DATA = $(INTROSPECTION_GIRS)
232

233
typelibsdir = $(libdir)/girepository-1.0
234
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
235

Javier Jardon's avatar
Javier Jardon committed
236
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
237 238

endif # HAVE_INTROSPECTION
239

240
if OS_WIN32
241
install-def-file: gdk.def
242
	mkdir -p $(DESTDIR)$(libdir)
243
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
244
uninstall-def-file:
245
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
246
else
247 248
install-def-file:
uninstall-def-file:
249 250 251 252 253 254
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
255
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
256 257

install-ms-lib:
258
	mkdir -p $(DESTDIR)$(libdir)
259 260 261 262 263 264 265 266 267
	$(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

268 269
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
270
gdk.def: gdk.symbols
271
	(echo -e EXPORTS; $(CPP) -P -DGDK_WINDOWING_WIN32 - <$(srcdir)/gdk.symbols | sed -e '/^$$/d' -e 's/^/	/' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gdk.def
272

Matthias Clasen's avatar
Matthias Clasen committed
273
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
Matthias Clasen's avatar
Matthias Clasen committed
274
if OS_LINUX
275
TESTS = abicheck.sh
276 277
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
278

Matthias Clasen's avatar
Matthias Clasen committed
279
noinst_LTLIBRARIES = libgdk-3.0.la
280

281 282
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
283
EXTRA_HEADERS =
284

285 286
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
Matthias Clasen's avatar
Matthias Clasen committed
287
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.0.la
288 289
endif

290
#note: not gdkconfig.h
291 292
BUILT_SOURCES = \
	$(gdk_built_sources)			\
293 294 295
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
296
	@true
297 298
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
299
		$(gdk_public_h_sources) ) >> xgen-geth \
300
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
301 302
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
303 304
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
305
		$(gdk_public_h_sources) ) > xgen-getc \
306
	&& cp xgen-getc gdkenumtypes.c  \
307
	&& rm -f xgen-getc
308

309 310 311
# 
# Marshaller generation
#
312
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
Matthias Clasen's avatar
Matthias Clasen committed
313
	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
314 315 316
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
317
	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp	\
318 319
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
320

321
gdkconfig.h: stamp-gc-h
322 323
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
324 325
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
326 327
	echo timestamp > stamp-gc-h

328 329 330
dist-hook: ../build/win32/vs9/gdk.vcproj

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
331
	for F in $(libgdk_win32_3_0_la_SOURCES); do \
332 333 334 335 336 337 338 339
		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

340 341
DISTCLEANFILES = gdkconfig.h stamp-gc-h

342
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
343

344
uninstall-local: uninstall-ms-lib uninstall-def-file
345 346 347 348 349 350 351 352
	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
353

Elliot Lee's avatar
Elliot Lee committed
354 355 356 357 358 359
.PHONY: files

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

-include $(top_srcdir)/git.mk