Makefile.am 7.72 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
	gdkapplaunchcontext.h			\
68
	gdkcairo.h				\
69 70
	gdkcolor.h				\
	gdkcursor.h				\
71
	gdkdisplay.h				\
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
	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				\
89
	gdkscreen.h				\
90
	gdkselection.h				\
91
	gdkspawn.h				\
92
	gdktestutils.h				\
93 94
	gdktypes.h				\
	gdkvisual.h				\
95
	gdkwindow.h
96

97
gdk_headers =                     \
98 99
	$(gdk_public_h_sources)   \
	gdkenumtypes.h		  \
100 101
	gdkprivate.h		  \
	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
# setup GDK sources and their dependencies
140
#
141

142 143
gdkincludedir = $(includedir)/gtk-2.0/gdk
gdkinclude_HEADERS = $(gdk_headers)
144

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

151 152 153 154 155
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)

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

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

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

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

198
gdk.def: gdk.symbols
199
	(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
200 201

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

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

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

Tor Lillqvist's avatar
Tor Lillqvist committed
211

212
lib_LTLIBRARIES = $(gdktargetlib)
213

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

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

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

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

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

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

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

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

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

280 281
DISTCLEANFILES = gdkconfig.h stamp-gc-h

282
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
283

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

Elliot Lee's avatar
Elliot Lee committed
294 295 296 297 298 299
.PHONY: files

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