Makefile.am 9.68 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
	gdkmedialib.h		\
25
	gdkwindowimpl.h		\
Tim Janik's avatar
Tim Janik committed
26
	makeenums.pl		\
27 28
	makefile.msc		\
	gdk.symbols		\
29 30
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
31
	abicheck.sh
32

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

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

58 59 60 61 62 63
if USE_MEDIALIB
medialib_sources =  \
    gdkmedialib.c
else
medialib_sources =
endif
64 65 66 67

#
# setup source file variables
#
Owen Taylor's avatar
Started  
Owen Taylor committed
68
#
69
# GDK header files for public installation (non-generated)
Owen Taylor's avatar
Started  
Owen Taylor committed
70
#
71
gdk_public_h_sources =				\
72
	gdk.h					\
73
	gdkapplaunchcontext.h			\
74
	gdkcairo.h				\
75 76
	gdkcolor.h				\
	gdkcursor.h				\
77 78
	gdkdevice.h				\
	gdkdevicemanager.h			\
79
	gdkdisplay.h				\
80
	gdkdisplaymanager.h			\
81 82 83 84 85
	gdkdnd.h				\
	gdkdrawable.h				\
	gdkevents.h				\
	gdkinput.h				\
	gdkkeys.h				\
86
	gdkkeysyms.h				\
87
	gdkkeysyms-compat.h			\
88 89 90
	gdkpango.h				\
	gdkpixbuf.h				\
	gdkpixmap.h				\
91
	gdkprivate.h				\
92
	gdkproperty.h				\
93
	gdkscreen.h				\
94
	gdkselection.h				\
95
	gdkspawn.h				\
96
	gdktestutils.h				\
97 98
	gdktypes.h				\
	gdkvisual.h				\
99
	gdkwindow.h
100

101 102 103
gdk_built_public_sources =			\
	gdkenumtypes.h

104 105 106 107
gdk_private_headers =				\
	gdkinternals.h				\
	gdkdeviceprivate.h			\
	gdkintl.h				\
Benjamin Otte's avatar
Benjamin Otte committed
108
	gdkpoly-generic.h
109

110
gdk_c_sources =                 \
111
	$(medialib_sources)     \
112
	gdk.c			\
113
	gdkapplaunchcontext.c	\
114
	gdkcairo.c		\
115 116
	gdkcolor.c		\
	gdkcursor.c		\
117 118
	gdkdevice.c		\
	gdkdevicemanager.c	\
119
	gdkdisplay.c		\
120
	gdkdisplaymanager.c	\
121
	gdkdnd.c		\
122 123 124
	gdkdraw.c		\
	gdkevents.c     	\
	gdkglobals.c		\
125 126
	gdkkeys.c		\
	gdkkeyuni.c		\
127
	gdkoffscreenwindow.c	\
128
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
129 130
	gdkpixbuf-drawable.c	\
	gdkpixbuf-render.c	\
131
	gdkpixmap.c		\
132
	gdkrectangle.c		\
133
	gdkscreen.c		\
134 135
	gdkselection.c		\
	gdkvisual.c		\
136 137
	gdkwindow.c		\
	gdkwindowimpl.c
138

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

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

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

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

159
libgdk_x11_3_0_la_SOURCES = $(common_sources)
160
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
161
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
162

163
libgdk_quartz_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
164
libgdk_quartz_3_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS)
165
libgdk_quartz_3_0_la_LDFLAGS = $(LDADD)
Anders Carlsson's avatar
Anders Carlsson committed
166

167
libgdk_win32_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
168
libgdk_win32_3_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS)
169 170
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)
171

172 173
if HAVE_INTROSPECTION

Matthias Clasen's avatar
Matthias Clasen committed
174
introspection_files = 		\
175
	$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources))	\
Matthias Clasen's avatar
Matthias Clasen committed
176 177
	$(gdk_c_sources)	\
        gdkenumtypes.c		\
178
        gdkenumtypes.h
179

180
Gdk-3.0.gir: $(gdktargetlib) Makefile
181
Gdk_3_0_gir_SCANNERFLAGS = --warn-all
182
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
183
Gdk_3_0_gir_LIBS = $(gdktargetlib)
184
Gdk_3_0_gir_FILES = $(introspection_files)
185 186
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += Gdk-3.0.gir
187

188
if USE_X11
Matthias Clasen's avatar
Matthias Clasen committed
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 216 217 218 219 220 221 222 223 224 225
x11_introspection_files = 		\
	x11/checksettings.c		\
	x11/gdkapplaunchcontext-x11.c	\
	x11/gdkasync.c			\
	x11/gdkcolor-x11.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/gdkdrawable-x11.c		\
	x11/gdkeventsource.c		\
	x11/gdkeventtranslator.c	\
	x11/gdkgeometry-x11.c		\
	x11/gdkglobals-x11.c		\
	x11/gdkim-x11.c			\
	x11/gdkinput.c			\
	x11/gdkkeys-x11.c		\
	x11/gdkmain-x11.c		\
	x11/gdkpixmap-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		\
226 227
        x11/gdkx.h

Colin Walters's avatar
Colin Walters committed
228
GdkX11-3.0.gir: $(gdktargetlib) Gdk-3.0.gir Makefile
229
GdkX11_3_0_gir_SCANNERFLAGS = --warn-all --strip-prefix=Gdk
230
GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
231
GdkX11_3_0_gir_LIBS = $(gdktargetlib)
232
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
Matthias Clasen's avatar
Matthias Clasen committed
233
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
234 235 236
INTROSPECTION_GIRS += GdkX11-3.0.gir
endif # USE_X11

237
girdir = $(datadir)/gir-1.0
Javier Jardon's avatar
Javier Jardon committed
238
gir_DATA = $(INTROSPECTION_GIRS)
239

240
typelibsdir = $(libdir)/girepository-1.0
241
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
242

Javier Jardon's avatar
Javier Jardon committed
243
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
244 245

endif # HAVE_INTROSPECTION
246

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

install-ms-lib:
	$(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

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

Matthias Clasen's avatar
Matthias Clasen committed
278
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
Matthias Clasen's avatar
Matthias Clasen committed
279
if OS_LINUX
280
TESTS = abicheck.sh
281 282
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
283

284
lib_LTLIBRARIES = $(gdktargetlib)
285

Benjamin Otte's avatar
Benjamin Otte committed
286
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la
287

288 289
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
290
EXTRA_HEADERS =
291 292 293 294

#
# Rule to install gdkconfig.h header file
#
295
configexecincludedir = $(libdir)/gtk-3.0/include
296
#configexecinclude_DATA = gdkconfig.h
297

298
install-exec-local: gdkconfig.h
299 300 301 302
	$(mkinstalldirs) $(DESTDIR)$(configexecincludedir)
	file=$(DESTDIR)$(configexecincludedir)/gdkconfig.h; \
	if test -r $$file && cmp -s gdkconfig.h $$file; then :; \
	else $(INSTALL_DATA) gdkconfig.h $$file; fi
303

304 305 306 307 308
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

309
#note: not gdkconfig.h
310 311
BUILT_SOURCES = \
	$(gdk_built_sources)			\
312 313 314
	gdkconfig.h

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

328 329 330
# 
# Marshaller generation
#
331
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
Matthias Clasen's avatar
Matthias Clasen committed
332
	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
333 334 335
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
336
	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp	\
337 338
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
339

340
gdkconfig.h: stamp-gc-h
341 342
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
343 344
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
345 346
	echo timestamp > stamp-gc-h

347 348 349
dist-hook: ../build/win32/vs9/gdk.vcproj

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

359 360
DISTCLEANFILES = gdkconfig.h stamp-gc-h

361
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
362

363
uninstall-local: uninstall-ms-lib uninstall-def-file
364 365 366 367 368 369 370 371
	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
372

Elliot Lee's avatar
Elliot Lee committed
373 374 375 376 377 378
.PHONY: files

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

-include $(top_srcdir)/git.mk