Makefile.am 9.36 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-3.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
libgdk_directfb_3_0_la_SOURCES = $(common_sources) 
libgdk_directfb_3_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS) \
175
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
176
libgdk_directfb_3_0_la_LDFLAGS = $(LDADD)
177

178 179
libgdk_x11_3_0_la_SOURCES = $(common_sources)
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS) \
180
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
181
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
182

183 184
libgdk_quartz_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
libgdk_quartz_3_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS) \
Anders Carlsson's avatar
Anders Carlsson committed
185
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
186
libgdk_quartz_3_0_la_LDFLAGS = $(LDADD)
Anders Carlsson's avatar
Anders Carlsson committed
187

188 189
libgdk_win32_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
libgdk_win32_3_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \
190
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
191 192
libgdk_win32_3_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
libgdk_win32_3_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 202
        x11/*.c \
        x11/gdkx.h
203

204 205
Gdk-3.0.gir: $(gdktargetlib) Makefile
Gdk_3_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf
206
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-3.0 Pango-1.0 xlib-2.0
207 208 209 210
Gdk_3_0_gir_LIBS = $(gdktargetlib)
Gdk_3_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += Gdk-3.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-3.0.def
224
uninstall-def-file:
225
	-rm $(DESTDIR)$(libdir)/gdk-win32-3.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

265
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la libgdk-directfb-3.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-3.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 328
dist-hook: ../build/win32/vs9/gdk.vcproj

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
329
	for F in $(libgdk_win32_3_0_la_SOURCES); do \
330 331 332 333 334 335 336 337
		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

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

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

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

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

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

-include $(top_srcdir)/git.mk