Makefile.am 8.93 KB
Newer Older
1
## Makefile.am for gtk+/gdk
2
include $(top_srcdir)/Makefile.decl
Johan Dahlin's avatar
Johan Dahlin committed
3 4 5 6 7 8 9 10
include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
   --add-include-path=../gdk-pixbuf
INTROSPECTION_COMPILER_ARGS = \
   --includedir=$(srcdir) \
   --includedir=. \
   --includedir=../gdk-pixbuf
Elliot Lee's avatar
Elliot Lee committed
11

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

15 16
CLEANFILES =

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

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

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

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

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

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

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

107 108 109 110
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
111
	gdkalias.h
112

113 114
gdk_private_headers =   \
	gdkinternals.h \
115 116
	gdkintl.h \
    gdkpoly-generic.h	\
117 118
	gdkregion-generic.h

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

152 153 154 155 156 157 158 159
gdk_built_sources =				\
	gdkaliasdef.c				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	$(gdk_built_public_sources)		\
	$(gdk_built_private_headers)

160
#
161
# setup GDK sources and their dependencies
162
#
163

164
gdkincludedir = $(includedir)/gtk-2.0/gdk
165
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
166

167
common_sources =                \
168 169
	$(gdk_private_headers)      \
    $(gdk_c_sources)	\
170
	gdkenumtypes.c		\
171
	gdkmarshalers.c		\
172
	gdkmarshalers.h
173

174 175 176 177 178
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)

179
libgdk_x11_2_0_la_SOURCES = $(common_sources)
180 181 182 183
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
184 185 186 187 188
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)

189 190 191
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
192
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
193
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
194

195 196
if HAVE_INTROSPECTION

197 198 199 200 201 202
introspection_files = \
		$(gdk_public_h_sources) \
		$(gdk_c_sources) \
        gdkenumtypes.c \
        gdkenumtypes.h

Johan Dahlin's avatar
Johan Dahlin committed
203 204 205 206 207 208
Gdk_2_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf
Gdk_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0
Gdk_2_0_gir_LIBS = $(gdktargetlib)
Gdk_2_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
Gdk_2_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += Gdk-2.0.gir
209

210
girdir = $(datadir)/gir-1.0
Johan Dahlin's avatar
Johan Dahlin committed
211
dist_gir_DATA = $(INTROSPECTION_GIRS)
212

213
typelibsdir = $(libdir)/girepository-1.0
Johan Dahlin's avatar
Johan Dahlin committed
214
typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
215

Johan Dahlin's avatar
Johan Dahlin committed
216
CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
217 218
endif

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

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

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

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

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

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

Tor Lillqvist's avatar
Tor Lillqvist committed
260

261
lib_LTLIBRARIES = $(gdktargetlib)
262

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-include $(top_srcdir)/git.mk