Makefile.am 6.1 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
INTROSPECTION_GIRS =
18
## ACLOCAL_AMFLAGS can be removed for Automake 1.13
19
ACLOCAL_AMFLAGS = -I m4
20 21
AM_CFLAGS = $(WARN_CFLAGS) $(CODE_COVERAGE_CFLAGS)
AM_CXXFLAGS = $(WARN_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS)
22
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gjs\" $(CODE_COVERAGE_CPPFLAGS)
23
AM_LDFLAGS = $(WARN_LDFLAGS) $(CODE_COVERAGE_LIBS)
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 39 40
include gjs-srcs.mk
########################################################################
nobase_gjs_public_include_HEADERS = $(gjs_public_headers)
41

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
42
########################################################################
43
pkgconfig_DATA = gjs-1.0.pc
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
44

45
EXTRA_DIST += gjs-1.0.pc.in
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
46

47 48 49 50 51 52
valgrinddir = $(datadir)/gjs-1.0/valgrind
dist_valgrind_DATA = installed-tests/extra/gjs.supp

lsandir = $(datadir)/gjs-1.0/lsan
dist_lsan_DATA = installed-tests/extra/lsan.supp

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

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

libgjs_la_CPPFLAGS =		\
	$(AM_CPPFLAGS)		\
Colin Walters's avatar
Colin Walters committed
65
	$(GJS_CFLAGS)	\
66
	$(gjs_directory_defines)\
Colin Walters's avatar
Colin Walters committed
67
	-I$(top_srcdir)/gi	\
68
	-DGJS_COMPILATION
69
libgjs_la_LDFLAGS = 			\
70
	$(AM_LDFLAGS)			\
71 72 73
	-export-symbols-regex "^[^_]"	\
	-version-info 0:0:0		\
	$(NO_UNDEFINED_FLAG)		\
74
	$(NULL)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
75 76 77
libgjs_la_LIBADD = 		\
	$(GJS_LIBS)

78 79 80 81 82
if ENABLE_GTK
libgjs_la_CPPFLAGS += $(GJS_GTK_CFLAGS)
libgjs_la_LIBADD += $(GJS_GTK_LIBS)
endif

83 84 85 86
# Please see gjs-srcs.mk for brief expanations
# of the layout of the sources due to historical
# reasons
libgjs_la_SOURCES = $(gjs_srcs)
Colin Walters's avatar
Colin Walters committed
87

88 89
if ENABLE_PROFILER
libgjs_la_SOURCES += $(gjs_sysprof_srcs)
90
libgjs_la_LIBADD += $(LIB_TIMER_TIME)
91 92
endif

93
# Also, these files used to be a separate library
94
libgjs_private_source_files = $(gjs_private_srcs)
95 96

if ENABLE_GTK
97
libgjs_private_source_files += $(gjs_gtk_private_srcs)
98 99
endif

100
libgjs_la_SOURCES += $(libgjs_private_source_files)
101

102 103 104
GjsPrivate-1.0.gir: libgjs.la
GjsPrivate_1_0_gir_LIBS = libgjs.la
GjsPrivate_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
105
GjsPrivate_1_0_gir_CFLAGS = -I$(top_srcdir)
106
GjsPrivate_1_0_gir_FILES = $(libgjs_private_source_files)
107 108 109 110 111 112
GjsPrivate_1_0_gir_SCANNERFLAGS =	\
	--identifier-prefix=Gjs		\
	--symbol-prefix=gjs_		\
	--warn-all			\
	$(WARN_SCANNERFLAGS)		\
	$(NULL)
113

114 115 116 117
if ENABLE_GTK
GjsPrivate_1_0_gir_INCLUDES += Gtk-3.0
endif

118
INTROSPECTION_GIRS += GjsPrivate-1.0.gir
119

Colin Walters's avatar
Colin Walters committed
120 121 122 123 124 125 126 127 128 129
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

130 131
tapset_in_files = gjs/gjs.stp.in
EXTRA_DIST += $(tapset_in_files)
132 133
if ENABLE_SYSTEMTAP
gjs/gjs.stp: gjs/gjs.stp.in Makefile
134
	$(AM_V_GEN)$(MKDIR_P) $(@D) && \
135
	$(SED) -e s,@EXPANDED_LIBDIR@,$(libdir), < $< > $@.tmp && mv $@.tmp $@
136
tapsetdir   = $(datadir)/systemtap/tapset
137 138 139
tapset_DATA = $(tapset_in_files:.stp.in=.stp)
endif

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
140 141
include Makefile-modules.am
include Makefile-examples.am
142

143
typelibdir = $(pkglibdir)/girepository-1.0
144 145
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)

Giovanni Campagna's avatar
Giovanni Campagna committed
146 147
CLEANFILES += $(INTROSPECTION_GIRS) $(typelib_DATA)

Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
148 149 150
########################################################################
bin_PROGRAMS += gjs-console

151 152
gjs_console_CPPFLAGS = 		\
	$(AM_CPPFLAGS)		\
153 154
	$(GJS_CONSOLE_CFLAGS)	\
	$(NULL)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
155
gjs_console_LDADD =		\
156
	$(GJS_CONSOLE_LIBS)	\
157
	libgjs.la
158
gjs_console_LDFLAGS = $(AM_LDFLAGS) -rdynamic
159
gjs_console_SOURCES = $(gjs_console_srcs)
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
160

161
install-exec-hook:
162
	(cd $(DESTDIR)$(bindir) && $(LN_S) -f gjs-console$(EXEEXT) gjs$(EXEEXT))
Lucas Almeida Rocha's avatar
Lucas Almeida Rocha committed
163 164

include Makefile-test.am
165
include Makefile-insttest.am
166

167 168 169 170 171
EXTRA_DIST +=					\
	autogen.sh				\
	COPYING.LGPL				\
	doc/ByteArray.md			\
	doc/cairo.md				\
Philip Chimento's avatar
Philip Chimento committed
172
	doc/Hacking.md				\
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
	doc/SpiderMonkey_Memory.md		\
	doc/Style_Guide.md			\
	win32/build-rules-msvc.mak		\
	win32/config-msvc.mak			\
	win32/config.h.win32			\
	win32/create-lists-msvc.mak		\
	win32/create-lists.bat			\
	win32/detectenv-msvc.mak		\
	win32/generate-msvc.mak			\
	win32/gjs-introspection-msvc.mak	\
	win32/info-msvc.mak			\
	win32/install.mak			\
	win32/introspection-msvc.mak		\
	win32/Makefile.vc			\
	win32/README.txt			\
188
	$(NULL)
Colin Walters's avatar
Colin Walters committed
189

190 191 192 193 194 195 196 197 198
# 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
199

200 201 202
# Customize to taste
TAG_PREFIX=GJS_
COMPRESSION=.bz2
203

204
DISTCLEANFILES=gjs-*.syscap
205 206 207 208

PACKAGE=@PACKAGE@
VERSION=@VERSION@
DISTNAME=$(PACKAGE)-$(VERSION).tar$(COMPRESSION)
209
TAG_VERSION := $(shell echo $(VERSION) | $(SED) s/\\\./_/g)
210 211 212 213 214 215 216 217

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
218 219 220
	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
221 222
	scp $(DISTNAME) master.gnome.org:
	ssh master.gnome.org install-module $(DISTNAME)
223

224 225 226 227 228

CPPCHECK=cppcheck
### cppcheck static code analysis
#
cppcheck:
229 230 231
	$(CPPCHECK) --inline-suppr \
		--enable=warning,performance,portability,information,missingInclude \
		--force -q $(top_srcdir) -I $(top_builddir)
232

233
-include $(top_srcdir)/git.mk