Makefile.am 8 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		\
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
	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 102
	gdkprivate.h				\
	gdkwindowimpl.h				\
103
	gdkalias.h
104

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Tor Lillqvist's avatar
Tor Lillqvist committed
224

225
lib_LTLIBRARIES = $(gdktargetlib)
226

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

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

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

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

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

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

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

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

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

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

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

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

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

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