Makefile.am 8.88 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
gdk_c_sources =                 \
106
	$(medialib_sources)     \
107
	gdk.c			\
108
	gdkapplaunchcontext.c	\
109
	gdkcairo.c		\
110 111
	gdkcolor.c		\
	gdkcursor.c		\
112
	gdkdisplay.c		\
113
	gdkdisplaymanager.c	\
114
	gdkdnd.c		\
115 116 117 118 119 120 121
	gdkdraw.c		\
	gdkevents.c     	\
	gdkfont.c		\
	gdkgc.c			\
	gdkglobals.c		\
	gdkimage.c		\
	gdkinternals.h  	\
122
	gdkintl.h		\
123 124
	gdkkeys.c		\
	gdkkeyuni.c		\
125
	gdkoffscreenwindow.c	\
126
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
127 128
	gdkpixbuf-drawable.c	\
	gdkpixbuf-render.c	\
129
	gdkpixmap.c		\
130 131
	gdkpoly-generic.h	\
	gdkpolyreg-generic.c	\
132
	gdkrectangle.c		\
133 134
	gdkregion-generic.c	\
	gdkregion-generic.h	\
135
	gdkrgb.c		\
136
	gdkscreen.c		\
137 138
	gdkselection.c		\
	gdkvisual.c		\
139 140
	gdkwindow.c		\
	gdkwindowimpl.c
141

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

150
#
151
# setup GDK sources and their dependencies
152
#
153

154
gdkincludedir = $(includedir)/gtk-2.0/gdk
155
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
156

157
common_sources =                \
158 159
	$(gdk_c_sources)	\
	gdkenumtypes.c		\
160
	gdkmarshalers.c		\
161
	gdkmarshalers.h
162

163 164 165 166 167
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)

168
libgdk_x11_2_0_la_SOURCES = $(common_sources)
169 170 171 172
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
173 174 175 176 177
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)

178 179 180
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
181
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
182
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
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
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

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

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

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

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

249 250 251
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
252
if OS_LINUX
253
TESTS = abicheck.sh pltcheck.sh
254 255
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
256

257
lib_LTLIBRARIES = $(gdktargetlib)
258

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

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

#
# Rule to install gdkconfig.h header file
#
268
configexecincludedir = $(libdir)/gtk-2.0/include
269
#configexecinclude_DATA = gdkconfig.h
270

271
install-exec-local: gdkconfig.h
272 273 274 275
	$(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
276

277 278 279 280 281
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

282
#note: not gdkconfig.h
283 284
BUILT_SOURCES = \
	$(gdk_built_sources)			\
285 286 287
	gdkconfig.h

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

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

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

320 321
DISTCLEANFILES = gdkconfig.h stamp-gc-h

322
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
323

324
uninstall-local: uninstall-ms-lib uninstall-def-file
325 326 327 328 329 330 331 332
	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
333

Elliot Lee's avatar
Elliot Lee committed
334 335 336 337 338 339
.PHONY: files

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

-include $(top_srcdir)/git.mk