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

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

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

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

35
gtarget=$(gdktarget)
Elliot Lee's avatar
Elliot Lee committed
36

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

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

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

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

97 98 99 100
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
101
	gdkalias.h
102

103
gdk_c_sources =                 \
104
	$(medialib_sources)     \
105
	gdk.c			\
106
	gdkapplaunchcontext.c	\
107
	gdkcairo.c		\
108 109
	gdkcolor.c		\
	gdkcursor.c		\
110
	gdkdisplay.c		\
111
	gdkdnd.c		\
112 113 114 115 116
	gdkdraw.c		\
	gdkevents.c     	\
	gdkfont.c		\
	gdkgc.c			\
	gdkglobals.c		\
Havoc Pennington's avatar
Havoc Pennington committed
117
	gdkkeys.c		\
118 119 120
	gdkkeyuni.c		\
	gdkimage.c		\
	gdkinternals.h  	\
121 122
	gdkintl.h		\
	gdkdisplaymanager.c	\
123
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
124 125
	gdkpixbuf-drawable.c	\
	gdkpixbuf-render.c	\
126
	gdkpixmap.c		\
127 128
	gdkpoly-generic.h	\
	gdkpolyreg-generic.c	\
129 130
	gdkrgb.c		\
	gdkrectangle.c		\
131 132
	gdkregion-generic.c	\
	gdkregion-generic.h	\
133
	gdkscreen.c		\
134 135
	gdkselection.c		\
	gdkvisual.c		\
136
	gdkwindow.c
137

138 139 140 141 142 143 144 145
gdk_built_sources =				\
	gdkaliasdef.c				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	$(gdk_built_public_sources)		\
	$(gdk_built_private_headers)

146
#
147
# setup GDK sources and their dependencies
148
#
149

150
gdkincludedir = $(includedir)/gtk-2.0/gdk
151
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
152

Matthias Clasen's avatar
2.7.0  
Matthias Clasen committed
153
# gdkmarshalers.c is not here because it is currently an empty file
154
common_sources =                \
155 156
	$(gdk_c_sources)	\
	gdkenumtypes.c		\
157
	gdkmarshalers.h
158

159 160 161 162 163
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)

164
libgdk_x11_2_0_la_SOURCES = $(common_sources)
165 166 167 168
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
169 170 171 172 173
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)

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

if OS_WIN32
181
install-def-file: gdk.def
182
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def
183 184
uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/gdk-win32-2.0.def
185
else
186 187
install-def-file:
uninstall-def-file:
188 189 190 191 192 193
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
194
	lib -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
195 196 197 198 199 200 201 202 203 204 205

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

206 207
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
208
gdk.def: gdk.symbols
209
	(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
210 211

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

214 215 216
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
217
if OS_LINUX
218
TESTS = abicheck.sh pltcheck.sh
219 220
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
221

222
lib_LTLIBRARIES = $(gdktargetlib)
223

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

226 227
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
228
EXTRA_HEADERS =
229 230 231 232

#
# Rule to install gdkconfig.h header file
#
233
configexecincludedir = $(libdir)/gtk-2.0/include
234
#configexecinclude_DATA = gdkconfig.h
235

236
install-exec-local: gdkconfig.h
237 238 239 240
	$(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
241

242 243 244 245 246
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

247
#note: not gdkconfig.h
248 249
BUILT_SOURCES = \
	$(gdk_built_sources)			\
250 251 252
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
253
	@true
254 255
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
256
		$(gdk_public_h_sources) ) >> xgen-geth \
257
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
258 259
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
260 261
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
262
		$(gdk_public_h_sources) ) > xgen-getc \
263
	&& cp xgen-getc gdkenumtypes.c  \
264
	&& rm -f xgen-getc
265

266 267 268
# 
# Marshaller generation
#
269 270 271 272 273
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
	$(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
274
	(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
275 276
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
277

278
gdkconfig.h: stamp-gc-h
279 280
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
281 282
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
283 284
	echo timestamp > stamp-gc-h

285 286
DISTCLEANFILES = gdkconfig.h stamp-gc-h

287
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
288

289
uninstall-local: uninstall-ms-lib uninstall-def-file
290 291 292 293 294 295 296 297
	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
298

Elliot Lee's avatar
Elliot Lee committed
299 300 301 302 303 304
.PHONY: files

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