Makefile.am 9.47 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 81
	gdkdevice.h				\
	gdkdevicemanager.h			\
82
	gdkdisplay.h				\
83
	gdkdisplaymanager.h			\
84 85 86 87 88 89 90 91
	gdkdnd.h				\
	gdkdrawable.h				\
	gdkevents.h				\
	gdkfont.h				\
	gdkgc.h					\
	gdkimage.h				\
	gdkinput.h				\
	gdkkeys.h				\
92
	gdkkeysyms.h				\
93 94 95
	gdkpango.h				\
	gdkpixbuf.h				\
	gdkpixmap.h				\
96
	gdkprivate.h				\
97 98 99
	gdkproperty.h				\
	gdkregion.h				\
	gdkrgb.h				\
100
	gdkscreen.h				\
101
	gdkselection.h				\
102
	gdkspawn.h				\
103
	gdktestutils.h				\
104 105
	gdktypes.h				\
	gdkvisual.h				\
106
	gdkwindow.h
107

108 109 110 111
gdk_built_public_sources =			\
	gdkenumtypes.h

gdk_built_private_headers =			\
112
	gdkalias.h
113

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

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

156 157 158 159 160 161 162 163
gdk_built_sources =				\
	gdkaliasdef.c				\
	gdkenumtypes.c				\
	gdkmarshalers.h 			\
	gdkmarshalers.c				\
	$(gdk_built_public_sources)		\
	$(gdk_built_private_headers)

164
#
165
# setup GDK sources and their dependencies
166
#
167

168
gdkincludedir = $(includedir)/gtk-3.0/gdk
169
gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources)
170

171
common_sources =                \
172 173
	$(gdk_private_headers)      \
    $(gdk_c_sources)	\
174
	gdkenumtypes.c		\
175
	gdkmarshalers.c		\
176
	gdkmarshalers.h
177

178 179
libgdk_directfb_3_0_la_SOURCES = $(common_sources) 
libgdk_directfb_3_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS) \
180
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
181
libgdk_directfb_3_0_la_LDFLAGS = $(LDADD)
182

183 184
libgdk_x11_3_0_la_SOURCES = $(common_sources)
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS) \
185
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
186
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
187

188 189
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
190
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
191
libgdk_quartz_3_0_la_LDFLAGS = $(LDADD)
Anders Carlsson's avatar
Anders Carlsson committed
192

193 194
libgdk_win32_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
libgdk_win32_3_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \
195
  $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
196 197
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)
198

199 200
if HAVE_INTROSPECTION

201 202 203 204
introspection_files = \
		$(gdk_public_h_sources) \
		$(gdk_c_sources) \
        gdkenumtypes.c \
205
        gdkenumtypes.h \
206 207
        x11/*.c \
        x11/gdkx.h
208

209 210
Gdk-3.0.gir: $(gdktargetlib) Makefile
Gdk_3_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf
211
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-3.0 Pango-1.0 xlib-2.0
212 213 214 215
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
216

217
girdir = $(datadir)/gir-1.0
Johan Dahlin's avatar
Johan Dahlin committed
218
dist_gir_DATA = $(INTROSPECTION_GIRS)
219

220
typelibsdir = $(libdir)/girepository-1.0
221
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
222

Johan Dahlin's avatar
Johan Dahlin committed
223
CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
224 225
endif

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

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

252 253
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
254
gdk.def: gdk.symbols
255
	(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
256 257

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

260 261 262
gdkaliasdef.c: gdk.symbols
	 $(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c

Matthias Clasen's avatar
Matthias Clasen committed
263
if OS_LINUX
264
TESTS = abicheck.sh pltcheck.sh
265 266
endif

Tor Lillqvist's avatar
Tor Lillqvist committed
267

268
lib_LTLIBRARIES = $(gdktargetlib)
269

270
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la libgdk-directfb-3.0.la
271

272 273
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
Matt Wilson's avatar
Matt Wilson committed
274
EXTRA_HEADERS =
275 276 277 278

#
# Rule to install gdkconfig.h header file
#
279
configexecincludedir = $(libdir)/gtk-3.0/include
280
#configexecinclude_DATA = gdkconfig.h
281

282
install-exec-local: gdkconfig.h
283 284 285 286
	$(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
287

288 289 290 291 292
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

293
#note: not gdkconfig.h
294 295
BUILT_SOURCES = \
	$(gdk_built_sources)			\
296 297 298
	gdkconfig.h

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

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

324
gdkconfig.h: stamp-gc-h
325 326
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
327 328
stamp-gc-h: $(top_builddir)/config.status
	cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkconfig.h
329 330
	echo timestamp > stamp-gc-h

331 332 333
dist-hook: ../build/win32/vs9/gdk.vcproj

../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
334
	for F in $(libgdk_win32_3_0_la_SOURCES); do \
335 336 337 338 339 340 341 342
		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

343 344
DISTCLEANFILES = gdkconfig.h stamp-gc-h

345
install-data-local: install-ms-lib install-def-file
Tor Lillqvist's avatar
Tor Lillqvist committed
346

347
uninstall-local: uninstall-ms-lib uninstall-def-file
348 349 350 351 352 353 354 355
	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
356

Elliot Lee's avatar
Elliot Lee committed
357 358 359 360 361 362
.PHONY: files

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

-include $(top_srcdir)/git.mk