Makefile.am 6.48 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 10 11 12 13 14 15
noinst_LTLIBRARIES =
dist_gjsjs_DATA =
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
TEST_PROGS =
check_PROGRAMS = $(TEST_PROGS)
16
INTROSPECTION_GIRS =
17
## ACLOCAL_AMFLAGS can be removed for Automake 1.13
18
ACLOCAL_AMFLAGS = -I m4
19 20
AM_CXXFLAGS = $(WARN_CXXFLAGS)
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gjs\"
21 22 23 24 25 26
MAINTAINERCLEANFILES =					\
	$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL)	\
	$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN)	\
	$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL)	\
	$(NULL)
GITIGNOREFILES = INSTALL m4
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
27

28 29 30
gjsjsdir = @gjsjsdir@
gjsoverridedir = $(gjsjsdir)/overrides

31 32
gjs_public_includedir = $(includedir)/gjs-1.0
gjs_module_includedir = $(includedir)/gjs-1.0
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
33 34

########################################################################
35
nobase_gjs_public_include_HEADERS =	\
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
36
	gjs/context.h		\
37 38 39
	gjs/gjs.h

nobase_gjs_module_include_HEADERS =	\
40
	gjs/gjs-module.h	\
41
	gjs/compat.h		\
42
	gjs/coverage.h \
43
	gjs/byteArray.h		\
44
	gjs/importer.h		\
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
45
	gjs/jsapi-util.h	\
46
	gjs/runtime.h		\
47
	gjs/type-module.h	\
48
	gjs/mem.h		\
49 50 51 52
	gjs/native.h	\
	gi/ns.h	        \
	gi/object.h	\
	gi/foreign.h	\
53
	gi/fundamental.h	\
54 55 56 57 58 59 60 61 62
	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	\
63
	gi/keep-alive.h	\
64
	gi/interface.h	\
65 66
	gi/gtype.h	\
	gi/gerror.h
67

68
noinst_HEADERS +=		\
69
	gjs/jsapi-private.h	\
70
	gjs/context-private.h	\
71
	gi/proxyutils.h		\
72
	util/crash.h		\
73
	util/hash-x32.h		\
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
74 75 76 77 78 79
	util/error.h		\
	util/glib.h		\
	util/log.h		\
	util/misc.h

########################################################################
80
pkgconfig_DATA = gjs-1.0.pc gjs-internals-1.0.pc
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
81 82

EXTRA_DIST += 			\
83 84
	gjs-1.0.pc.in           \
	gjs-internals-1.0.pc.in
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
85 86 87

########################################################################
gjs_directory_defines = 				\
88
	-DGJS_TOP_SRCDIR=\"$(top_srcdir)\"		\
89 90
	-DGJS_TOP_BUILDDIR=\"$(top_builddir)\"		\
	-DGJS_JS_DIR=\"$(gjsjsdir)\"                    \
91
	-DPKGLIBDIR=\"$(pkglibdir)\"
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
92 93 94 95 96 97

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

libgjs_la_CPPFLAGS =		\
	$(AM_CPPFLAGS)		\
Colin Walters's avatar
Colin Walters committed
98
	$(GJS_CFLAGS)	\
99
	$(gjs_directory_defines)\
Colin Walters's avatar
Colin Walters committed
100
	-I$(top_srcdir)/gi	\
101
	-DGJS_COMPILATION
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
102 103
libgjs_la_LDFLAGS = 		\
	-export-symbols-regex "^[^_]" -version-info 0:0:0	\
Johan Dahlin's avatar
Johan Dahlin committed
104
	-no-undefined \
105
	-rdynamic
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
106 107 108
libgjs_la_LIBADD = 		\
	$(GJS_LIBS)

109 110 111 112 113
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
114
libgjs_la_SOURCES =		\
115 116 117
	gjs/byteArray.cpp		\
	gjs/context.cpp		\
	gjs/importer.cpp		\
Colin Walters's avatar
Colin Walters committed
118
	gjs/gi.h		\
119
	gjs/gi.cpp		\
Cosimo Cecchi's avatar
Cosimo Cecchi committed
120
	gjs/coverage-internal.h	\
121
	gjs/coverage.cpp \
122
	gjs/jsapi-private.cpp	\
123 124 125 126 127 128 129 130 131 132 133
	gjs/jsapi-util.cpp	\
	gjs/jsapi-dynamic-class.cpp \
	gjs/jsapi-util-array.cpp	\
	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	\
134
	modules/modules.h	\
135 136 137 138 139 140
	util/error.cpp		\
	util/hash-x32.cpp		\
	util/glib.cpp		\
	util/crash.cpp		\
	util/log.cpp		\
	util/misc.cpp
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
141

Colin Walters's avatar
Colin Walters committed
142 143 144
# For historical reasons, some files live in gi/
libgjs_la_SOURCES += \
	gi/gjs_gi_trace.h \
145 146 147 148 149 150 151 152 153
	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	\
154
	gi/fundamental.cpp	\
155 156 157 158 159 160 161 162
	gi/param.cpp	\
	gi/proxyutils.cpp	\
        gi/repo.cpp	\
	gi/union.cpp	\
        gi/value.cpp	\
	gi/interface.cpp	\
	gi/gtype.cpp	\
	gi/gerror.cpp
Colin Walters's avatar
Colin Walters committed
163

164
# Also, these files used to be a separate library
165
libgjs_private_source_files = \
166
	libgjs-private/gjs-gdbus-wrapper.cpp	\
167
	libgjs-private/gjs-gdbus-wrapper.h	\
168
	libgjs-private/gjs-util.cpp		\
169 170
	libgjs-private/gjs-util.h		\
	libgjs-private/gjs-gtk-util.h
171 172 173 174 175 176 177

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

178
libgjs_la_SOURCES += $(libgjs_private_source_files)
179

180 181 182
GjsPrivate-1.0.gir: libgjs.la
GjsPrivate_1_0_gir_LIBS = libgjs.la
GjsPrivate_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
183
GjsPrivate_1_0_gir_FILES = $(libgjs_private_source_files)
184
GjsPrivate_1_0_gir_SCANNERFLAGS = --identifier-prefix=Gjs --symbol-prefix=gjs_ --warn-all
185

186 187 188 189
if ENABLE_GTK
GjsPrivate_1_0_gir_INCLUDES += Gtk-3.0
endif

190
INTROSPECTION_GIRS += GjsPrivate-1.0.gir
191

Colin Walters's avatar
Colin Walters committed
192 193 194 195 196 197 198 199 200 201
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

202 203
tapset_in_files = gjs/gjs.stp.in
EXTRA_DIST += $(tapset_in_files)
204 205
if ENABLE_SYSTEMTAP
gjs/gjs.stp: gjs/gjs.stp.in Makefile
206
	$(AM_V_GEN)$(MKDIR_P) $(@D) && \
207
	$(SED) -e s,@EXPANDED_LIBDIR@,$(libdir), < $< > $@.tmp && mv $@.tmp $@
208
tapsetdir   = $(datadir)/systemtap/tapset
209 210 211
tapset_DATA = $(tapset_in_files:.stp.in=.stp)
endif

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
212 213
include Makefile-modules.am
include Makefile-examples.am
214

215
typelibdir = $(pkglibdir)/girepository-1.0
216 217
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)

Giovanni Campagna's avatar
Giovanni Campagna committed
218 219
CLEANFILES += $(INTROSPECTION_GIRS) $(typelib_DATA)

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
220 221 222
########################################################################
bin_PROGRAMS += gjs-console

223 224
gjs_console_CPPFLAGS = 		\
	$(AM_CPPFLAGS)		\
225
        $(GOBJECT_CFLAGS)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
226
gjs_console_LDADD =		\
227 228
	$(GOBJECT_LIBS)		\
	libgjs.la
229
gjs_console_LDFLAGS = -rdynamic
230
gjs_console_SOURCES = gjs/console.cpp
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
231

232
install-exec-hook:
233
	(cd $(DESTDIR)$(bindir) && $(LN_S) -f gjs-console$(EXEEXT) gjs$(EXEEXT))
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
234 235

include Makefile-test.am
236
include Makefile-insttest.am
237

238
EXTRA_DIST += autogen.sh COPYING.LGPL
Colin Walters's avatar
Colin Walters committed
239

240 241 242 243 244 245 246 247 248
# 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
249

250 251 252
# Customize to taste
TAG_PREFIX=GJS_
COMPRESSION=.bz2
253

254 255 256 257

PACKAGE=@PACKAGE@
VERSION=@VERSION@
DISTNAME=$(PACKAGE)-$(VERSION).tar$(COMPRESSION)
258
TAG_VERSION := $(shell echo $(VERSION) | $(SED) s/\\\./_/g)
259 260 261 262 263 264 265 266

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
267 268 269
	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
270 271
	scp $(DISTNAME) master.gnome.org:
	ssh master.gnome.org install-module $(DISTNAME)
272 273

-include $(top_srcdir)/git.mk