Makefile.am 6.79 KB
Newer Older
1 2 3
# http://people.gnome.org/~walters/docs/build-api.txt
.buildapi-allow-builddir:

4 5
-include $(INTROSPECTION_MAKEFILE)

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
6 7
bin_PROGRAMS =
lib_LTLIBRARIES =
8
noinst_HEADERS =
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
9
noinst_LTLIBRARIES =
10
noinst_DATA =
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
11 12 13 14
dist_gjsjs_DATA =
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
15
check_PROGRAMS =
16
check_LTLIBRARIES =
17
TESTS = $(check_PROGRAMS)
18
INTROSPECTION_GIRS =
19
## ACLOCAL_AMFLAGS can be removed for Automake 1.13
20
ACLOCAL_AMFLAGS = -I m4
21 22
AM_CXXFLAGS = $(WARN_CXXFLAGS) $(CODE_COVERAGE_CFLAGS)
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gjs\" $(CODE_COVERAGE_CPPFLAGS)
23
AM_LDFLAGS = $(WARN_LDFLAGS) $(CODE_COVERAGE_LDFLAGS)
24 25 26 27
MAINTAINERCLEANFILES =					\
	$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL)	\
	$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN)	\
	$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL)	\
28
	tap-driver.sh					\
29 30
	$(NULL)
GITIGNOREFILES = INSTALL m4
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
31

32 33 34
gjsjsdir = @gjsjsdir@
gjsoverridedir = $(gjsjsdir)/overrides

35
gjs_public_includedir = $(includedir)/gjs-1.0
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
36 37

########################################################################
38
nobase_gjs_public_include_HEADERS =	\
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
39
	gjs/context.h		\
40
	gjs/coverage.h			\
41 42 43
	gjs/gjs.h			\
	util/error.h			\
	$(NULL)
44

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
45
########################################################################
46
pkgconfig_DATA = gjs-1.0.pc
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
47

48
EXTRA_DIST += gjs-1.0.pc.in
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
49 50 51

########################################################################
gjs_directory_defines = 				\
52
	-DGJS_TOP_SRCDIR=\"$(top_srcdir)\"		\
53
	-DGJS_TOP_BUILDDIR=\"$(top_builddir)\"		\
54
	-DGJS_JS_DIR=\"$(gjsjsdir)\"			\
55
	-DPKGLIBDIR=\"$(pkglibdir)\"
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
56 57 58 59 60 61

########################################################################
lib_LTLIBRARIES += libgjs.la

libgjs_la_CPPFLAGS =		\
	$(AM_CPPFLAGS)		\
Colin Walters's avatar
Colin Walters committed
62
	$(GJS_CFLAGS)	\
63
	$(gjs_directory_defines)\
Colin Walters's avatar
Colin Walters committed
64
	-I$(top_srcdir)/gi	\
65
	-DGJS_COMPILATION
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
66 67
libgjs_la_LDFLAGS = 		\
	-export-symbols-regex "^[^_]" -version-info 0:0:0	\
Johan Dahlin's avatar
Johan Dahlin committed
68
	-no-undefined \
69
	$(NULL)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
70 71 72
libgjs_la_LIBADD = 		\
	$(GJS_LIBS)

73 74 75 76 77
if ENABLE_GTK
libgjs_la_CPPFLAGS += $(GJS_GTK_CFLAGS)
libgjs_la_LIBADD += $(GJS_GTK_LIBS)
endif

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
78
libgjs_la_SOURCES =		\
79 80
	gjs/byteArray.cpp		\
	gjs/context.cpp		\
81
	gjs/context-private.h		\
82
	gjs/importer.cpp		\
Colin Walters's avatar
Colin Walters committed
83
	gjs/gi.h		\
84
	gjs/gi.cpp		\
Cosimo Cecchi's avatar
Cosimo Cecchi committed
85
	gjs/coverage-internal.h	\
86
	gjs/coverage.cpp \
87 88
	gjs/jsapi-constructor-proxy.cpp	\
	gjs/jsapi-constructor-proxy.h	\
89
	gjs/jsapi-private.cpp	\
90
	gjs/jsapi-private.h		\
91 92
	gjs/jsapi-util.cpp	\
	gjs/jsapi-dynamic-class.cpp \
93
	gjs/jsapi-util-args.h		\
94 95 96 97 98 99 100 101
	gjs/jsapi-util-error.cpp	\
	gjs/jsapi-util-string.cpp	\
	gjs/mem.cpp		\
	gjs/native.cpp		\
	gjs/runtime.cpp		\
	gjs/stack.cpp		\
	gjs/type-module.cpp	\
	modules/modules.cpp	\
102
	modules/modules.h	\
103 104
	util/error.cpp		\
	util/hash-x32.cpp		\
105
	util/hash-x32.h			\
106
	util/glib.cpp		\
107
	util/glib.h			\
108
	util/log.cpp		\
109 110 111 112
	util/log.h			\
	util/misc.cpp			\
	util/misc.h			\
	$(NULL)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
113

Colin Walters's avatar
Colin Walters committed
114 115 116
# For historical reasons, some files live in gi/
libgjs_la_SOURCES += \
	gi/gjs_gi_trace.h \
117 118 119 120 121 122 123 124 125
	gi/arg.cpp	\
	gi/boxed.cpp	\
	gi/closure.cpp	\
	gi/enumeration.cpp	\
	gi/function.cpp	\
	gi/keep-alive.cpp	\
	gi/ns.cpp	\
	gi/object.cpp	\
	gi/foreign.cpp	\
126
	gi/fundamental.cpp	\
127 128
	gi/param.cpp	\
	gi/proxyutils.cpp	\
129
	gi/proxyutils.h		\
130
	gi/repo.cpp	\
131
	gi/union.cpp	\
132
	gi/value.cpp	\
133 134 135
	gi/interface.cpp	\
	gi/gtype.cpp	\
	gi/gerror.cpp
Colin Walters's avatar
Colin Walters committed
136

137
# Also, these files used to be a separate library
138
libgjs_private_source_files = \
139
	libgjs-private/gjs-gdbus-wrapper.cpp	\
140
	libgjs-private/gjs-gdbus-wrapper.h	\
141
	libgjs-private/gjs-util.cpp		\
142 143
	libgjs-private/gjs-util.h		\
	libgjs-private/gjs-gtk-util.h
144 145 146 147 148 149 150

if ENABLE_GTK
libgjs_private_source_files += 			\
	libgjs-private/gjs-gtk-util.c		\
	$(NULL)
endif

151
libgjs_la_SOURCES += $(libgjs_private_source_files)
152

153 154 155 156 157
# These used to be public headers for external modules
libgjs_la_SOURCES +=		\
	gjs/byteArray.h		\
	gjs/importer.h		\
	gjs/jsapi-util.h	\
158
	gjs/jsapi-wrapper.h	\
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
	gjs/runtime.h		\
	gjs/type-module.h	\
	gjs/mem.h		\
	gjs/native.h		\
	gi/ns.h	        	\
	gi/object.h		\
	gi/foreign.h		\
	gi/fundamental.h	\
	gi/param.h		\
	gi/repo.h		\
	gi/union.h		\
	gi/value.h		\
	gi/arg.h		\
	gi/boxed.h		\
	gi/closure.h		\
	gi/enumeration.h	\
	gi/function.h		\
	gi/keep-alive.h		\
	gi/interface.h		\
	gi/gtype.h		\
	gi/gerror.h		\
	$(NULL)

182 183 184
GjsPrivate-1.0.gir: libgjs.la
GjsPrivate_1_0_gir_LIBS = libgjs.la
GjsPrivate_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
185
GjsPrivate_1_0_gir_FILES = $(libgjs_private_source_files)
186 187 188 189 190 191
GjsPrivate_1_0_gir_SCANNERFLAGS =	\
	--identifier-prefix=Gjs		\
	--symbol-prefix=gjs_		\
	--warn-all			\
	$(WARN_SCANNERFLAGS)		\
	$(NULL)
192

193 194 195 196
if ENABLE_GTK
GjsPrivate_1_0_gir_INCLUDES += Gtk-3.0
endif

197
INTROSPECTION_GIRS += GjsPrivate-1.0.gir
198

Colin Walters's avatar
Colin Walters committed
199 200 201 202 203 204 205 206 207 208
if ENABLE_DTRACE
gjs_gi_probes.h: gi/gjs_gi_probes.d
	$(DTRACE) -C -h -s $< -o $@
gjs_gi_probes.o: gi/gjs_gi_probes.d
	$(DTRACE) -G -s $< -o $@
BUILT_SOURCES += gjs_gi_probes.h gjs_gi_probes.o
libgjs_la_LIBADD += gjs_gi_probes.o
endif
EXTRA_DIST += gi/gjs_gi_probes.d

209 210
tapset_in_files = gjs/gjs.stp.in
EXTRA_DIST += $(tapset_in_files)
211 212
if ENABLE_SYSTEMTAP
gjs/gjs.stp: gjs/gjs.stp.in Makefile
213
	$(AM_V_GEN)$(MKDIR_P) $(@D) && \
214
	$(SED) -e s,@EXPANDED_LIBDIR@,$(libdir), < $< > $@.tmp && mv $@.tmp $@
215
tapsetdir   = $(datadir)/systemtap/tapset
216 217 218
tapset_DATA = $(tapset_in_files:.stp.in=.stp)
endif

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
219 220
include Makefile-modules.am
include Makefile-examples.am
221

222
typelibdir = $(pkglibdir)/girepository-1.0
223 224
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)

Giovanni Campagna's avatar
Giovanni Campagna committed
225 226
CLEANFILES += $(INTROSPECTION_GIRS) $(typelib_DATA)

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
227 228 229
########################################################################
bin_PROGRAMS += gjs-console

230 231
gjs_console_CPPFLAGS = 		\
	$(AM_CPPFLAGS)		\
232 233
	$(GJS_CONSOLE_CFLAGS)	\
	$(NULL)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
234
gjs_console_LDADD =		\
235
	$(GJS_CONSOLE_LIBS)	\
236
	libgjs.la
237
gjs_console_LDFLAGS = -rdynamic
238
gjs_console_SOURCES = gjs/console.cpp
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
239

240
install-exec-hook:
241
	(cd $(DESTDIR)$(bindir) && $(LN_S) -f gjs-console$(EXEEXT) gjs$(EXEEXT))
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
242 243

include Makefile-test.am
244
include Makefile-insttest.am
245

246 247 248 249 250 251 252 253 254
EXTRA_DIST +=				\
	autogen.sh			\
	COPYING.LGPL			\
	doc/ByteArray.md		\
	doc/cairo.md			\
	doc/Class_Framework.md		\
	doc/SpiderMonkey_Memory.md	\
	doc/Style_Guide.md		\
	$(NULL)
Colin Walters's avatar
Colin Walters committed
255

256 257 258 259 260 261 262 263 264
# Colin's handy Makefile bits for:
# 1) stuffing tarballs with pre-generated scripts from your workstation
# 2) bumping configure.ac version post-release
# 3) tagging correctly in git
# 4) uploading to gnome.org
# To use:
#  $ make check
#  $ make dist
#  $ make prepare-minor-release
265

266 267 268
# Customize to taste
TAG_PREFIX=GJS_
COMPRESSION=.bz2
269

270 271 272 273

PACKAGE=@PACKAGE@
VERSION=@VERSION@
DISTNAME=$(PACKAGE)-$(VERSION).tar$(COMPRESSION)
274
TAG_VERSION := $(shell echo $(VERSION) | $(SED) s/\\\./_/g)
275 276 277 278 279 280 281 282

prepare-release-tag: Makefile
	git tag -m "Tag $(TAG_VERSION)" -a $(TAG_PREFIX)$(TAG_VERSION)

prepare-minor-release: $(DISTNAME) prepare-release-tag Makefile
	env top_srcdir=$(top_srcdir) python $(top_srcdir)/verbump.py

upload-release: $(DISTNAME) Makefile
283 284 285
	git log origin/master..master
	@echo -n "Ok to push? [y/N] "; read ans; test x$$ans == xy || exit 1
	git push --tags origin master:master
286 287
	scp $(DISTNAME) master.gnome.org:
	ssh master.gnome.org install-module $(DISTNAME)
288 289

-include $(top_srcdir)/git.mk