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

13 14
SUBDIRS = $(gdktarget) . tests
DIST_SUBDIRS = win32 x11 quartz directfb tests
Tor Lillqvist's avatar
Tor Lillqvist committed
15

16 17
CLEANFILES =

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

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

46
gtarget=$(gdktarget)
Elliot Lee's avatar
Elliot Lee committed
47

Tor Lillqvist's avatar
Tor Lillqvist committed
48 49 50 51
if PLATFORM_WIN32
no_undefined = -no-undefined
endif

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

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

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

109 110 111 112
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
113
	gdkalias.h
114

115 116 117 118 119
gdk_private_headers =				\
	gdkinternals.h				\
	gdkdeviceprivate.h			\
	gdkintl.h				\
	gdkpoly-generic.h			\
120 121
	gdkregion-generic.h

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

157 158 159 160 161 162 163 164
gdk_built_sources =				\
	gdkaliasdef.c				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	$(gdk_built_public_sources)		\
	$(gdk_built_private_headers)

165
#
166
# setup GDK sources and their dependencies
167
#
168

169
gdkincludedir = $(includedir)/gtk-3.0/gdk
170
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
171

172
common_sources =                \
173 174
	$(gdk_private_headers)      \
    $(gdk_c_sources)	\
175
	gdkenumtypes.c		\
176
	gdkmarshalers.c		\
177
	gdkmarshalers.h
178

179 180
libgdk_directfb_3_0_la_SOURCES = $(common_sources) 
libgdk_directfb_3_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS) \
181
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
182
libgdk_directfb_3_0_la_LDFLAGS = $(LDADD)
183

184 185
libgdk_x11_3_0_la_SOURCES = $(common_sources)
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS) \
186
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
187
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
188

189 190
libgdk_quartz_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
libgdk_quartz_3_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS) \
Anders Carlsson's avatar
Anders Carlsson committed
191
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
192
libgdk_quartz_3_0_la_LDFLAGS = $(LDADD)
Anders Carlsson's avatar
Anders Carlsson committed
193

194 195
libgdk_win32_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
libgdk_win32_3_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \
196
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
197 198
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)
199

200 201
if HAVE_INTROSPECTION

202 203 204 205
introspection_files = \
		$(gdk_public_h_sources) \
		$(gdk_c_sources) \
        gdkenumtypes.c \
206
        gdkenumtypes.h
207

208 209
Gdk-3.0.gir: $(gdktargetlib) Makefile
Gdk_3_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf
210
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-3.0 Pango-1.0
211 212 213 214
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
215

216 217 218 219 220 221 222 223 224 225
if USE_X11
x11_introspection_files = \
        x11/*.c \
        x11/gdkx.h

GdkX11-3.0.gir: $(gdktargetlib) Makefile
GdkX11_3_0_gir_SCANNERFLAGS = --strip-prefix=gdk_x11 --add-include-path=../gdk-pixbuf
GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-3.0 Pango-1.0 xlib-2.0
GdkX11_3_0_gir_LIBS = $(gdktargetlib)
GdkX11_3_0_gir_FILES = $(addprefix $(srcdir)/,$(x11_introspection_files))
Matthias Clasen's avatar
Matthias Clasen committed
226
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
227 228 229
INTROSPECTION_GIRS += GdkX11-3.0.gir
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
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
243
uninstall-def-file:
244
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
245
else
246 247
install-def-file:
uninstall-def-file:
248 249 250 251 252 253
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
254
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
255 256 257 258 259 260 261 262 263 264 265

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

266 267
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
268
gdk.def: gdk.symbols
269
	(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
270 271

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

274 275 276
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

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

Tor Lillqvist's avatar
Tor Lillqvist committed
282

283
lib_LTLIBRARIES = $(gdktargetlib)
284

285
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la libgdk-directfb-3.0.la
286

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

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

297
install-exec-local: gdkconfig.h
298 299 300 301
	$(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
302

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

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

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

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

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

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

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

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

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

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

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

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

-include $(top_srcdir)/git.mk