Makefile.am 8.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
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		\
16
	gdkwindowimpl.h		\
Tim Janik's avatar
Tim Janik committed
17
	makeenums.pl		\
18 19 20
	makefile.msc		\
	gdk.symbols		\
	makegdkalias.pl		\
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 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
	gdkdisplaymanager.h			\
72 73 74 75 76 77 78 79 80
	gdkdnd.h				\
	gdkdrawable.h				\
	gdkevents.h				\
	gdkfont.h				\
	gdkgc.h					\
	gdki18n.h				\
	gdkimage.h				\
	gdkinput.h				\
	gdkkeys.h				\
81
	gdkkeysyms.h				\
82 83 84
	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
	gdkdisplaymanager.c	\
112
	gdkdnd.c		\
113 114 115 116 117 118 119
	gdkdraw.c		\
	gdkevents.c     	\
	gdkfont.c		\
	gdkgc.c			\
	gdkglobals.c		\
	gdkimage.c		\
	gdkinternals.h  	\
120
	gdkintl.h		\
121 122
	gdkkeys.c		\
	gdkkeyuni.c		\
123
	gdkoffscreenwindow.c	\
124
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
125 126
	gdkpixbuf-drawable.c	\
	gdkpixbuf-render.c	\
127
	gdkpixmap.c		\
128 129
	gdkpoly-generic.h	\
	gdkpolyreg-generic.c	\
130
	gdkrectangle.c		\
131 132
	gdkregion-generic.c	\
	gdkregion-generic.h	\
133
	gdkrgb.c		\
134
	gdkscreen.c		\
135 136
	gdkselection.c		\
	gdkvisual.c		\
137 138
	gdkwindow.c		\
	gdkwindowimpl.c
139

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

148
#
149
# setup GDK sources and their dependencies
150
#
151

152
gdkincludedir = $(includedir)/gtk-2.0/gdk
153
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
154

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

161 162 163 164 165
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)

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

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

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

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

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

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

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

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

Tor Lillqvist's avatar
Tor Lillqvist committed
223

224
lib_LTLIBRARIES = $(gdktargetlib)
225

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

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

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

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

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

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

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

268 269 270
# 
# Marshaller generation
#
271 272 273 274 275
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
276
	(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
277 278
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
279

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

287 288
DISTCLEANFILES = gdkconfig.h stamp-gc-h

289
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
290

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

Elliot Lee's avatar
Elliot Lee committed
301 302 303 304 305 306
.PHONY: files

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

-include $(top_srcdir)/git.mk