Makefile.am 7.67 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		\
Matthias Clasen's avatar
2.7.0  
Matthias Clasen committed
20
	gdkaliasdef.c		\
21 22
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
23 24
	abicheck.sh		\
	pltcheck.sh
25

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

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

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

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

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

#
# setup source file variables
#
Owen Taylor's avatar
Started  
Owen Taylor committed
62
#
63
# GDK header files for public installation (non-generated)
Owen Taylor's avatar
Started  
Owen Taylor committed
64
#
65
gdk_public_h_sources =				\
66
	gdk.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 85 86 87
	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				\
	gdkproperty.h				\
	gdkregion.h				\
	gdkrgb.h				\
88
	gdkscreen.h				\
89
	gdkselection.h				\
90
	gdkspawn.h				\
91
	gdktestutils.h				\
92 93
	gdktypes.h				\
	gdkvisual.h				\
94
	gdkwindow.h
95

96
gdk_headers =                     \
97 98
	$(gdk_public_h_sources)   \
	gdkenumtypes.h		  \
99 100
	gdkprivate.h		  \
	gdkalias.h
101

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

#
137
# setup GDK sources and their dependencies
138
#
139

140 141
gdkincludedir = $(includedir)/gtk-2.0/gdk
gdkinclude_HEADERS = $(gdk_headers)
142

Matthias Clasen's avatar
2.7.0  
Matthias Clasen committed
143
# gdkmarshalers.c is not here because it is currently an empty file
144
common_sources =                \
145 146
	$(gdk_c_sources)	\
	gdkenumtypes.c		\
147
	gdkmarshalers.h
148

149 150 151 152 153
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)

154
libgdk_x11_2_0_la_SOURCES = $(common_sources)
155 156 157 158
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
159 160 161 162 163
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)

164 165 166
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
167
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
168
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols gdk.def $(LDADD)
169 170

if OS_WIN32
171
install-def-file: gdk.def
172
	$(INSTALL) gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def
173 174
uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/gdk-win32-2.0.def
175
else
176 177
install-def-file:
uninstall-def-file:
178 179 180 181 182 183
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
184
	lib -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
185 186 187 188 189 190 191 192 193 194 195

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

196
gdk.def: gdk.symbols
197
	(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') > gdk.def
198 199

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

202 203 204
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
205
if OS_LINUX
206
TESTS = abicheck.sh pltcheck.sh
207 208
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
209

210
lib_LTLIBRARIES = $(gdktargetlib)
211

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

214 215
MAINTAINERCLEANFILES = gdkenumtypes.h stamp-gdkenumtypes.h gdkenumtypes.c \
  gdkmarshalers.h gdkmarshalers.c
Matt Wilson's avatar
Matt Wilson committed
216
EXTRA_HEADERS =
217 218 219 220

#
# Rule to install gdkconfig.h header file
#
221
configexecincludedir = $(libdir)/gtk-2.0/include
222
#configexecinclude_DATA = gdkconfig.h
223

224
install-exec-local: gdkconfig.h
225 226 227 228
	$(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
229

230 231 232 233 234
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

235
#note: not gdkconfig.h
236
BUILT_SOURCES =					\
237
	gdkalias.h				\
238
	gdkaliasdef.c				\
239 240 241 242 243 244 245
	gdkenumtypes.h				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
246
	@true
247 248
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
249
		$(gdk_public_h_sources) ) >> xgen-geth \
250
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
251 252
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
253 254
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
255
		$(gdk_public_h_sources) ) > xgen-getc \
256
	&& cp xgen-getc gdkenumtypes.c  \
257
	&& rm -f xgen-getc
258

259 260 261
# 
# Marshaller generation
#
262 263 264 265 266
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
267
	(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
268 269
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
270

271
gdkconfig.h: stamp-gc-h
272 273
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
274 275
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
276 277
	echo timestamp > stamp-gc-h

278 279
DISTCLEANFILES = gdkconfig.h stamp-gc-h

280
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
281

282
uninstall-local: uninstall-ms-lib uninstall-def-file
283 284 285 286 287 288 289 290
	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
291

Elliot Lee's avatar
Elliot Lee committed
292 293 294 295 296 297
.PHONY: files

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