Makefile.am 8.94 KB
Newer Older
1
## Makefile.am for gtk+/gdk
2
include $(top_srcdir)/Makefile.decl
Elliot Lee's avatar
Elliot Lee committed
3

4 5
SUBDIRS = $(gdktarget) . tests
DIST_SUBDIRS = win32 x11 quartz directfb tests
Tor Lillqvist's avatar
Tor Lillqvist committed
6

7 8
CLEANFILES =

9
EXTRA_DIST +=			\
10 11 12
	keynames.txt		\
	keyname-table.h		\
	gen-keyname-table.pl	\
13
	gdkconfig.h.win32 	\
14
	gdkkeysyms-update.pl	\
15
	gdk.def 		\
16
	gdkmarshalers.list	\
17
	gdkmedialib.h		\
18
	gdkwindowimpl.h		\
Tim Janik's avatar
Tim Janik committed
19
	makeenums.pl		\
20 21 22
	makefile.msc		\
	gdk.symbols		\
	makegdkalias.pl		\
23 24
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
25 26
	abicheck.sh		\
	pltcheck.sh
27

28
INCLUDES =                              \
Owen Taylor's avatar
Owen Taylor committed
29
	-DG_LOG_DOMAIN=\"Gdk\"		\
Manish Singh's avatar
Manish Singh committed
30
	-DGDK_COMPILATION		\
Owen Taylor's avatar
Owen Taylor committed
31 32 33
	-I$(top_srcdir)			\
	-I$(top_builddir)/gdk		\
	-I$(top_srcdir)/gdk-pixbuf 	\
34 35
	$(GTK_DEBUG_FLAGS) 		\
	$(GDK_DEP_CFLAGS)
36

37
gtarget=$(gdktarget)
Elliot Lee's avatar
Elliot Lee committed
38

Tor Lillqvist's avatar
Tor Lillqvist committed
39 40 41 42
if PLATFORM_WIN32
no_undefined = -no-undefined
endif

43
# libtool stuff: set version and export symbols for resolving
44 45
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
# we use the general approach here
46 47
LDADD = \
	-version-info $(LT_VERSION_INFO)		 		\
Owen Taylor's avatar
Owen Taylor committed
48 49 50
	-export-dynamic 						\
	-rpath $(libdir) 						\
	$(no_undefined)							\
51 52
	$(LIBTOOL_EXPORT_OPTIONS)

53 54 55 56 57 58
if USE_MEDIALIB
medialib_sources =  \
    gdkmedialib.c
else
medialib_sources =
endif
59 60 61 62

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

99 100 101 102
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
103
	gdkalias.h
104

105 106
gdk_private_headers =   \
	gdkinternals.h \
107 108
	gdkintl.h \
    gdkpoly-generic.h	\
109 110
	gdkregion-generic.h

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

144 145 146 147 148 149 150 151
gdk_built_sources =				\
	gdkaliasdef.c				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	$(gdk_built_public_sources)		\
	$(gdk_built_private_headers)

152
#
153
# setup GDK sources and their dependencies
154
#
155

156
gdkincludedir = $(includedir)/gtk-2.0/gdk
157
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
158

159
common_sources =                \
160 161
	$(gdk_private_headers)      \
    $(gdk_c_sources)	\
162
	gdkenumtypes.c		\
163
	gdkmarshalers.c		\
164
	gdkmarshalers.h
165

166 167 168 169 170
libgdk_directfb_2_0_la_SOURCES = $(common_sources) 
libgdk_directfb_2_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS) \
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
libgdk_directfb_2_0_la_LDFLAGS = $(LDADD)

171
libgdk_x11_2_0_la_SOURCES = $(common_sources)
172 173 174 175
libgdk_x11_2_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS) \
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
libgdk_x11_2_0_la_LDFLAGS = $(LDADD)

Anders Carlsson's avatar
Anders Carlsson committed
176 177 178 179 180
libgdk_quartz_2_0_la_SOURCES = $(common_sources) gdkkeynames.c
libgdk_quartz_2_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS) \
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
libgdk_quartz_2_0_la_LDFLAGS = $(LDADD)

181 182 183
libgdk_win32_2_0_la_SOURCES = $(common_sources) gdkkeynames.c
libgdk_win32_2_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
Tor Lillqvist's avatar
Tor Lillqvist committed
184
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
185
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
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 216 217
if HAVE_INTROSPECTION
BUILT_GIRSOURCES =

Gdk-2.0.gir: $(INTROSPECTION_SCANNER) $(gdktargetlib) Makefile
	$(INTROSPECTION_SCANNER) -v \
		--namespace Gdk --nsversion=2.0 --strip-prefix=Gdk \
		$(INCLUDES) \
		--include=Gio-2.0 \
		--add-include-path=../gdk-pixbuf \
		--include=GdkPixbuf-2.0 \
		--include=Pango-1.0 \
		--library=$(gdktargetlib) \
		--libtool="$(LIBTOOL)" \
	        --output $@ \
		$(gdk_public_h_sources) \
		$(gdk_c_sources) gdkenumtypes.c gdkenumtypes.h
BUILT_GIRSOURCES += Gdk-2.0.gir

girdir = $(datadir)/gir-1.0
gir_DATA = $(BUILT_GIRSOURCES)

typelibsdir = $(libdir)/girepository-1.0/

typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)

%.typelib: %.gir $(INTROSPECTION_COMPILER)
	$(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. --includedir=../gdk-pixbuf $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)

CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
endif

218
if OS_WIN32
219
install-def-file: gdk.def
220
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def
221 222
uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/gdk-win32-2.0.def
223
else
224 225
install-def-file:
uninstall-def-file:
226 227 228 229 230 231
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
232
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
233 234 235 236 237 238 239 240 241 242 243

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

244 245
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
246
gdk.def: gdk.symbols
247
	(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
248 249

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

252 253 254
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
255
if OS_LINUX
256
TESTS = abicheck.sh pltcheck.sh
257 258
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
259

260
lib_LTLIBRARIES = $(gdktargetlib)
261

Matthias Clasen's avatar
Matthias Clasen committed
262
EXTRA_LTLIBRARIES = libgdk-x11-2.0.la libgdk-win32-2.0.la libgdk-quartz-2.0.la libgdk-directfb-2.0.la
263

264 265
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
266
EXTRA_HEADERS =
267 268 269 270

#
# Rule to install gdkconfig.h header file
#
271
configexecincludedir = $(libdir)/gtk-2.0/include
272
#configexecinclude_DATA = gdkconfig.h
273

274
install-exec-local: gdkconfig.h
275 276 277 278
	$(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
279

280 281 282 283 284
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

285
#note: not gdkconfig.h
286 287
BUILT_SOURCES = \
	$(gdk_built_sources)			\
288 289 290
	gdkconfig.h

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

304 305 306
# 
# Marshaller generation
#
307
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
Matthias Clasen's avatar
Matthias Clasen committed
308
	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
309 310 311
	&& 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
312
	(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
313 314
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
315

316
gdkconfig.h: stamp-gc-h
317 318
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
319 320
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
321 322
	echo timestamp > stamp-gc-h

323 324
DISTCLEANFILES = gdkconfig.h stamp-gc-h

325
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
326

327
uninstall-local: uninstall-ms-lib uninstall-def-file
328 329 330 331 332 333 334 335
	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
336

Elliot Lee's avatar
Elliot Lee committed
337 338 339 340 341 342
.PHONY: files

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

-include $(top_srcdir)/git.mk