Makefile.am 9 KB
Newer Older
1
## Makefile.am for gtk+/gdk
2
include $(top_srcdir)/Makefile.decl
3
-include $(INTROSPECTION_MAKEFILE)
Johan Dahlin's avatar
Johan Dahlin committed
4 5 6 7 8 9 10
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
   --add-include-path=../gdk-pixbuf
INTROSPECTION_COMPILER_ARGS = \
   --includedir=$(srcdir) \
   --includedir=. \
   --includedir=../gdk-pixbuf
Elliot Lee's avatar
Elliot Lee committed
11

12 13
SUBDIRS = $(gdktarget) . tests
DIST_SUBDIRS = win32 x11 quartz directfb tests
Tor Lillqvist's avatar
Tor Lillqvist committed
14

15 16
CLEANFILES =

17
EXTRA_DIST +=			\
18 19 20
	keynames.txt		\
	keyname-table.h		\
	gen-keyname-table.pl	\
21
	gdkconfig.h.win32 	\
22
	gdkkeysyms-update.pl	\
23
	gdk.def 		\
24
	gdkmarshalers.list	\
25
	gdkmedialib.h		\
26
	gdkwindowimpl.h		\
Tim Janik's avatar
Tim Janik committed
27
	makeenums.pl		\
28 29 30
	makefile.msc		\
	gdk.symbols		\
	makegdkalias.pl		\
31 32
	gdkenumtypes.c.template	\
	gdkenumtypes.h.template	\
33 34
	abicheck.sh		\
	pltcheck.sh
35

36
INCLUDES =                              \
Owen Taylor's avatar
Owen Taylor committed
37
	-DG_LOG_DOMAIN=\"Gdk\"		\
Manish Singh's avatar
Manish Singh committed
38
	-DGDK_COMPILATION		\
Owen Taylor's avatar
Owen Taylor committed
39 40 41
	-I$(top_srcdir)			\
	-I$(top_builddir)/gdk		\
	-I$(top_srcdir)/gdk-pixbuf 	\
42 43
	$(GTK_DEBUG_FLAGS) 		\
	$(GDK_DEP_CFLAGS)
44

45
gtarget=$(gdktarget)
Elliot Lee's avatar
Elliot Lee committed
46

Tor Lillqvist's avatar
Tor Lillqvist committed
47 48 49 50
if PLATFORM_WIN32
no_undefined = -no-undefined
endif

51
# libtool stuff: set version and export symbols for resolving
52 53
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
# we use the general approach here
54 55
LDADD = \
	-version-info $(LT_VERSION_INFO)		 		\
Owen Taylor's avatar
Owen Taylor committed
56 57 58
	-export-dynamic 						\
	-rpath $(libdir) 						\
	$(no_undefined)							\
59 60
	$(LIBTOOL_EXPORT_OPTIONS)

61 62 63 64 65 66
if USE_MEDIALIB
medialib_sources =  \
    gdkmedialib.c
else
medialib_sources =
endif
67 68 69 70

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

107 108 109 110
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
111
	gdkalias.h
112

113 114
gdk_private_headers =   \
	gdkinternals.h \
115 116
	gdkintl.h \
    gdkpoly-generic.h	\
117 118
	gdkregion-generic.h

119
gdk_c_sources =                 \
120
	$(medialib_sources)     \
121
	gdk.c			\
122
	gdkapplaunchcontext.c	\
123
	gdkcairo.c		\
124 125
	gdkcolor.c		\
	gdkcursor.c		\
126
	gdkdisplay.c		\
127
	gdkdisplaymanager.c	\
128
	gdkdnd.c		\
129 130 131 132 133 134
	gdkdraw.c		\
	gdkevents.c     	\
	gdkfont.c		\
	gdkgc.c			\
	gdkglobals.c		\
	gdkimage.c		\
135 136
	gdkkeys.c		\
	gdkkeyuni.c		\
137
	gdkoffscreenwindow.c	\
138
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
139 140
	gdkpixbuf-drawable.c	\
	gdkpixbuf-render.c	\
141
	gdkpixmap.c		\
142
	gdkpolyreg-generic.c	\
143
	gdkrectangle.c		\
144
	gdkregion-generic.c	\
145
	gdkrgb.c		\
146
	gdkscreen.c		\
147 148
	gdkselection.c		\
	gdkvisual.c		\
149 150
	gdkwindow.c		\
	gdkwindowimpl.c
151

152 153 154 155 156 157 158 159
gdk_built_sources =				\
	gdkaliasdef.c				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	$(gdk_built_public_sources)		\
	$(gdk_built_private_headers)

160
#
161
# setup GDK sources and their dependencies
162
#
163

164
gdkincludedir = $(includedir)/gtk-2.0/gdk
165
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
166

167
common_sources =                \
168 169
	$(gdk_private_headers)      \
    $(gdk_c_sources)	\
170
	gdkenumtypes.c		\
171
	gdkmarshalers.c		\
172
	gdkmarshalers.h
173

174 175 176 177 178
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)

179
libgdk_x11_2_0_la_SOURCES = $(common_sources)
180 181 182 183
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
184 185 186 187 188
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)

189 190 191
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
192
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
193
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
194

195 196
if HAVE_INTROSPECTION

197 198 199 200
introspection_files = \
		$(gdk_public_h_sources) \
		$(gdk_c_sources) \
        gdkenumtypes.c \
201
        gdkenumtypes.h \
202
        $(srcdir)/x11/*.c
203

204
Gdk-2.0.gir: $(gdktargetlib) Makefile
Johan Dahlin's avatar
Johan Dahlin committed
205 206 207 208 209 210
Gdk_2_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf
Gdk_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0
Gdk_2_0_gir_LIBS = $(gdktargetlib)
Gdk_2_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
Gdk_2_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += Gdk-2.0.gir
211

212
girdir = $(datadir)/gir-1.0
Johan Dahlin's avatar
Johan Dahlin committed
213
dist_gir_DATA = $(INTROSPECTION_GIRS)
214

215
typelibsdir = $(libdir)/girepository-1.0
216
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
217

Johan Dahlin's avatar
Johan Dahlin committed
218
CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
219 220
endif

221
if OS_WIN32
222
install-def-file: gdk.def
223
	$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def
224 225
uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/gdk-win32-2.0.def
226
else
227 228
install-def-file:
uninstall-def-file:
229 230 231 232 233 234
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
235
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
236 237 238 239 240 241 242 243 244 245 246

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

247 248
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
249
gdk.def: gdk.symbols
250
	(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
251 252

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

255 256 257
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
258
if OS_LINUX
259
TESTS = abicheck.sh pltcheck.sh
260 261
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
262

263
lib_LTLIBRARIES = $(gdktargetlib)
264

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

267 268
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
269
EXTRA_HEADERS =
270 271 272 273

#
# Rule to install gdkconfig.h header file
#
274
configexecincludedir = $(libdir)/gtk-2.0/include
275
#configexecinclude_DATA = gdkconfig.h
276

277
install-exec-local: gdkconfig.h
278 279 280 281
	$(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
282

283 284 285 286 287
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

288
#note: not gdkconfig.h
289 290
BUILT_SOURCES = \
	$(gdk_built_sources)			\
291 292 293
	gdkconfig.h

gdkenumtypes.h: stamp-gdkenumtypes.h
294
	@true
295 296
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.h.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
297
		$(gdk_public_h_sources) ) >> xgen-geth \
298
	&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
299 300
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
301 302
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) gdkenumtypes.c.template
	( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
303
		$(gdk_public_h_sources) ) > xgen-getc \
304
	&& cp xgen-getc gdkenumtypes.c  \
305
	&& rm -f xgen-getc
306

307 308 309
# 
# Marshaller generation
#
310
gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
Matthias Clasen's avatar
Matthias Clasen committed
311
	$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --header > gdkmarshalers-h.tmp \
312 313 314
	&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
	|| ( rm -f gdkmarshalers-h.tmp && exit 1)
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
Matthias Clasen's avatar
Matthias Clasen committed
315
	(echo "#include \"gdkalias.h\""; $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp	\
316 317
	&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
	|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
318

319
gdkconfig.h: stamp-gc-h
320 321
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
322 323
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
324 325
	echo timestamp > stamp-gc-h

326 327
DISTCLEANFILES = gdkconfig.h stamp-gc-h

328
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
329

330
uninstall-local: uninstall-ms-lib uninstall-def-file
331 332 333 334 335 336 337 338
	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
339

Elliot Lee's avatar
Elliot Lee committed
340 341 342 343 344 345
.PHONY: files

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

-include $(top_srcdir)/git.mk