Makefile.am 9.34 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
	gdkdnd.h				\
	gdkdrawable.h				\
	gdkevents.h				\
	gdkfont.h				\
	gdkgc.h					\
	gdkimage.h				\
	gdkinput.h				\
	gdkkeys.h				\
90
	gdkkeysyms.h				\
91 92 93
	gdkpango.h				\
	gdkpixbuf.h				\
	gdkpixmap.h				\
94
	gdkprivate.h				\
95 96 97
	gdkproperty.h				\
	gdkregion.h				\
	gdkrgb.h				\
98
	gdkscreen.h				\
99
	gdkselection.h				\
100
	gdkspawn.h				\
101
	gdktestutils.h				\
102 103
	gdktypes.h				\
	gdkvisual.h				\
104
	gdkwindow.h
105

106 107 108 109
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
110
	gdkalias.h
111

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

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

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

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

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

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

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

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

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

194 195
if HAVE_INTROSPECTION

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

203
Gdk-2.0.gir: $(gdktargetlib) Makefile
Johan Dahlin's avatar
Johan Dahlin committed
204 205 206 207 208 209
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
210

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

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

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

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

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

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

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

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

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

Tor Lillqvist's avatar
Tor Lillqvist committed
261

262
lib_LTLIBRARIES = $(gdktargetlib)
263

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

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

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

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

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

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

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

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

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

325 326 327 328 329 330 331 332 333 334 335 336
dist-hook: ../build/win32/vs9/gdk.vcproj

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
	for F in $(libgdk_win32_2_0_la_SOURCES); do \
		case $$F in \
		*.c) echo '   <File RelativePath="..\..\..\gdk\'$$F'" />' \
		     ;; \
		esac; \
	done >libgdk.sourcefiles
	$(CPP) -P - <$(top_srcdir)/build/win32/vs9/gdk.vcprojin >$@
	rm libgdk.sourcefiles

337 338
DISTCLEANFILES = gdkconfig.h stamp-gc-h

339
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
340

341
uninstall-local: uninstall-ms-lib uninstall-def-file
342 343 344 345 346 347 348 349
	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
350

Elliot Lee's avatar
Elliot Lee committed
351 352 353 354 355 356
.PHONY: files

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

-include $(top_srcdir)/git.mk