Makefile.am 9.03 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
if HAVE_INTROSPECTION
BUILT_GIRSOURCES =

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

196 197 198 199 200 201 202 203 204 205 206
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 $@ \
207
		$(addprefix $(srcdir)/,$(introspection_files))
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
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

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

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

249 250
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
251
gdk.def: gdk.symbols
252
	(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
253 254

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

257 258 259
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
260
if OS_LINUX
261
TESTS = abicheck.sh pltcheck.sh
262 263
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
264

265
lib_LTLIBRARIES = $(gdktargetlib)
266

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

269 270
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
271
EXTRA_HEADERS =
272 273 274 275

#
# Rule to install gdkconfig.h header file
#
276
configexecincludedir = $(libdir)/gtk-2.0/include
277
#configexecinclude_DATA = gdkconfig.h
278

279
install-exec-local: gdkconfig.h
280 281 282 283
	$(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
284

285 286 287 288 289
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

290
#note: not gdkconfig.h
291 292
BUILT_SOURCES = \
	$(gdk_built_sources)			\
293 294 295
	gdkconfig.h

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

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

321
gdkconfig.h: stamp-gc-h
322 323
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
324 325
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
326 327
	echo timestamp > stamp-gc-h

328 329
DISTCLEANFILES = gdkconfig.h stamp-gc-h

330
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
331

332
uninstall-local: uninstall-ms-lib uninstall-def-file
333 334 335 336 337 338 339 340
	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
341

Elliot Lee's avatar
Elliot Lee committed
342 343 344 345 346 347
.PHONY: files

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

-include $(top_srcdir)/git.mk