Makefile.am 9.49 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 = $(gdktarget) . tests
DIST_SUBDIRS = win32 x11 quartz directfb 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 29
	makefile.msc		\
	gdk.symbols		\
	makegdkalias.pl		\
30 31
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
32 33
	abicheck.sh		\
	pltcheck.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 39
	-I$(top_srcdir)			\
	-I$(top_builddir)/gdk		\
40 41
	$(GTK_DEBUG_FLAGS) 		\
	$(GDK_DEP_CFLAGS)
42

43
gtarget=$(gdktarget)
Elliot Lee's avatar
Elliot Lee committed
44

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

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

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

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

105 106 107 108
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
109
	gdkalias.h
110

111 112 113 114
gdk_private_headers =				\
	gdkinternals.h				\
	gdkdeviceprivate.h			\
	gdkintl.h				\
Benjamin Otte's avatar
Benjamin Otte committed
115
	gdkpoly-generic.h
116

117
gdk_c_sources =                 \
118
	$(medialib_sources)     \
119
	gdk.c			\
120
	gdkapplaunchcontext.c	\
121
	gdkcairo.c		\
122 123
	gdkcolor.c		\
	gdkcursor.c		\
124 125
	gdkdevice.c		\
	gdkdevicemanager.c	\
126
	gdkdisplay.c		\
127
	gdkdisplaymanager.c	\
128
	gdkdnd.c		\
129 130 131 132 133
	gdkdraw.c		\
	gdkevents.c     	\
	gdkgc.c			\
	gdkglobals.c		\
	gdkimage.c		\
134 135
	gdkkeys.c		\
	gdkkeyuni.c		\
136
	gdkoffscreenwindow.c	\
137
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
138 139
	gdkpixbuf-drawable.c	\
	gdkpixbuf-render.c	\
140
	gdkpixmap.c		\
141
	gdkrectangle.c		\
142
	gdkrgb.c		\
143
	gdkscreen.c		\
144 145
	gdkselection.c		\
	gdkvisual.c		\
146 147
	gdkwindow.c		\
	gdkwindowimpl.c
148

149 150 151 152 153 154 155 156
gdk_built_sources =				\
	gdkaliasdef.c				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	$(gdk_built_public_sources)		\
	$(gdk_built_private_headers)

157
#
158
# setup GDK sources and their dependencies
159
#
160

161
gdkincludedir = $(includedir)/gtk-3.0/gdk
162
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
163

164
common_sources =                \
165 166
	$(gdk_private_headers)      \
    $(gdk_c_sources)	\
167
	gdkenumtypes.c		\
168
	gdkmarshalers.c		\
169
	gdkmarshalers.h
170

171 172
libgdk_directfb_3_0_la_SOURCES = $(common_sources)
libgdk_directfb_3_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS)
173
libgdk_directfb_3_0_la_LDFLAGS = $(LDADD)
174

175
libgdk_x11_3_0_la_SOURCES = $(common_sources)
176
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
177
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
178

179
libgdk_quartz_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
180
libgdk_quartz_3_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS)
181
libgdk_quartz_3_0_la_LDFLAGS = $(LDADD)
Anders Carlsson's avatar
Anders Carlsson committed
182

183
libgdk_win32_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
184
libgdk_win32_3_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS)
185 186
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)
187

188 189
if HAVE_INTROSPECTION

190 191 192 193
introspection_files = \
		$(gdk_public_h_sources) \
		$(gdk_c_sources) \
        gdkenumtypes.c \
194
        gdkenumtypes.h
195

196
Gdk-3.0.gir: $(gdktargetlib) Makefile
197 198
Gdk_3_0_gir_SCANNERFLAGS = --strip-prefix=Gdk
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0
199 200 201 202
Gdk_3_0_gir_LIBS = $(gdktargetlib)
Gdk_3_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += Gdk-3.0.gir
203

204 205 206 207 208
if USE_X11
x11_introspection_files = \
        x11/*.c \
        x11/gdkx.h

Colin Walters's avatar
Colin Walters committed
209
GdkX11-3.0.gir: $(gdktargetlib) Gdk-3.0.gir Makefile
210 211
GdkX11_3_0_gir_SCANNERFLAGS = --strip-prefix=gdk_x11
GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
212 213
GdkX11_3_0_gir_LIBS = $(gdktargetlib)
GdkX11_3_0_gir_FILES = $(addprefix $(srcdir)/,$(x11_introspection_files))
Matthias Clasen's avatar
Matthias Clasen committed
214
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
215 216 217
INTROSPECTION_GIRS += GdkX11-3.0.gir
endif # USE_X11

218
girdir = $(datadir)/gir-1.0
Javier Jardon's avatar
Javier Jardon committed
219
gir_DATA = $(INTROSPECTION_GIRS)
220

221
typelibsdir = $(libdir)/girepository-1.0
222
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
223

Javier Jardon's avatar
Javier Jardon committed
224
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
225 226

endif # HAVE_INTROSPECTION
227

228
if OS_WIN32
229
install-def-file: gdk.def
230
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
231
uninstall-def-file:
232
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
233
else
234 235
install-def-file:
uninstall-def-file:
236 237 238 239 240 241
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
242
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
243 244 245 246 247 248 249 250 251 252 253

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

254 255
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
256
gdk.def: gdk.symbols
257
	(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
258 259

gdkalias.h: gdk.symbols
260
	 $(PERL) $(srcdir)/makegdkalias.pl < $(srcdir)/gdk.symbols > gdkalias.h
261

262 263 264
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
265
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
Matthias Clasen's avatar
Matthias Clasen committed
266
if OS_LINUX
267
TESTS = abicheck.sh pltcheck.sh
268 269
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
270

271
lib_LTLIBRARIES = $(gdktargetlib)
272

273
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la libgdk-directfb-3.0.la
274

275 276
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
277
EXTRA_HEADERS =
278 279 280 281

#
# Rule to install gdkconfig.h header file
#
282
configexecincludedir = $(libdir)/gtk-3.0/include
283
#configexecinclude_DATA = gdkconfig.h
284

285
install-exec-local: gdkconfig.h
286 287 288 289
	$(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
290

291 292 293 294 295
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

296
#note: not gdkconfig.h
297 298
BUILT_SOURCES = \
	$(gdk_built_sources)			\
299 300 301
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
302
	@true
303 304
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
305
		$(gdk_public_h_sources) ) >> xgen-geth \
306
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
307 308
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
309 310
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
311
		$(gdk_public_h_sources) ) > xgen-getc \
312
	&& cp xgen-getc gdkenumtypes.c  \
313
	&& rm -f xgen-getc
314

315 316 317
# 
# Marshaller generation
#
318
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
Matthias Clasen's avatar
Matthias Clasen committed
319
	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
320 321 322
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
Matthias Clasen's avatar
Matthias Clasen committed
323
	(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
324 325
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
326

327
gdkconfig.h: stamp-gc-h
328 329
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
330 331
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
332 333
	echo timestamp > stamp-gc-h

334 335 336
dist-hook: ../build/win32/vs9/gdk.vcproj

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
337
	for F in $(libgdk_win32_3_0_la_SOURCES); do \
338 339 340 341 342 343 344 345
		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

346 347
DISTCLEANFILES = gdkconfig.h stamp-gc-h

348
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
349

350
uninstall-local: uninstall-ms-lib uninstall-def-file
351 352 353 354 355 356 357 358
	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
359

Elliot Lee's avatar
Elliot Lee committed
360 361 362 363 364 365
.PHONY: files

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

-include $(top_srcdir)/git.mk