Source code

Revision control

Other Tools

1
# -*- Mode: makefile -*-
2
#
3
# This Source Code Form is subject to the terms of the Mozilla Public
4
# License, v. 2.0. If a copy of the MPL was not distributed with this
5
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
ifeq (,$(MAKE_VERSION))
8
$(error GNU Make is required)
9
endif
10
make_min_ver := 3.81
11
ifneq ($(make_min_ver),$(firstword $(sort $(make_min_ver) $(MAKE_VERSION))))
12
$(error GNU Make $(make_min_ver) or higher is required)
13
endif
14
15
DASH_R = -r
16
17
# Define keyword generator before rules.mk, see bug 323979 comment 50
18
19
USE_HOST_CXX = 1
20
21
include $(topsrcdir)/config/rules.mk
22
23
ifdef MOZ_VALGRIND
24
ifndef MOZ_ASAN
25
JITTEST_VALGRIND_FLAG = --valgrind
26
endif
27
endif
28
29
ifneq ($(LLVM_SYMBOLIZER),)
30
# Use the LLVM symbolizer when running jit-tests under ASan and TSan, if available
31
ifdef MOZ_ASAN
32
JITTEST_SANITIZER_ENV=ASAN_SYMBOLIZER_PATH='$(LLVM_SYMBOLIZER)'
33
endif
34
ifdef MOZ_TSAN
35
JITTEST_SANITIZER_ENV=TSAN_OPTIONS="external_symbolizer_path=$(LLVM_SYMBOLIZER) handle_segv=0 $$TSAN_OPTIONS"
36
endif
37
ifdef MOZ_MSAN
38
JITTEST_SANITIZER_ENV=MSAN_SYMBOLIZER_PATH='$(LLVM_SYMBOLIZER)'
39
endif
40
endif
41
42
check-js-msg::
43
(cd $(topsrcdir) && $(PYTHON) $(topsrcdir)/config/check_js_msg_encoding.py);
44
45
check-jit-test::
46
$(JITTEST_SANITIZER_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
47
--no-slow --no-progress --format=automation --jitflags=all \
48
$(JITTEST_VALGRIND_FLAG) \
49
$(JITTEST_EXTRA_ARGS) \
50
$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX) $(JITTEST_TEST_ARGS)
51
52
check:: check-js-msg
53
54
check-jstests:
55
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/tests/jstests.py \
56
--no-progress --format=automation --timeout 300 \
57
$(JSTESTS_EXTRA_ARGS) \
58
$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
59
60
# FIXME:
61
# We want to run check-jstests as part of |make check| on all platforms, on
62
# tinderbox. However, some configurations don't work quite right just yet.
63
# Rather than risking regressions in major configurations while fixing these
64
# secondary configuration, we work around them and fix the bugs later.
65
#
66
# Bug 652154: On Windows, SM(!m !t) don't work because of path problems with
67
# their unusual directory layout
68
#
69
# Bug 652155: On Mac, SM(d) doesn't work for unknown reasons
70
71
ifneq ($(OS_ARCH),WINNT)
72
ifndef HAVE_DTRACE
73
#check:: check-jstests
74
endif
75
endif
76
77
DIST_GARBAGE = config.cache config.log config.status* \
78
config/autoconf.mk config/emptyvars.mk \
79
js-config.h js-confdefs.h \
80
backend.mk config/backend.mk devtools/backend.mk editline/backend.mk \
81
gdb/backend.mk jsapi-tests/backend.mk shell/backend.mk tests/backend.mk \
82
backend.RecursiveMakeBackend backend.RecursiveMakeBackend.pp \
83
devtools/rootAnalysis/Makefile
84
85
distclean::
86
$(RM) $(DIST_GARBAGE)
87
88
CFLAGS += $(MOZ_ZLIB_CFLAGS)
89
90
# Silence warnings on AIX/HP-UX from non-GNU compilers
91
ifndef GNU_CC
92
ifeq ($(OS_ARCH),AIX)
93
# Suppress warnings from xlC
94
# 1540-1281: offsetof() on null non-POD types
95
# 1540-1608: anonymous unions using static data members
96
CFLAGS += -qsuppress=1540-1281 -qsuppress=1540-1608
97
CXXFLAGS += -qsuppress=1540-1281 -qsuppress=1540-1608
98
endif
99
ifeq ($(OS_ARCH),HP-UX)
100
# Suppress warnings from aCC
101
# 3055: anonymous unions declaring types
102
# 4189: offsetof() on non-POD types
103
CFLAGS += +W3055,4189
104
CXXFLAGS += +W3055,4189
105
endif
106
endif
107
ifeq ($(OS_ARCH),SunOS)
108
ifeq ($(TARGET_CPU),sparc)
109
110
ifdef GNU_CC
111
CFLAGS += -mcpu=v9
112
CXXFLAGS += -mcpu=v9
113
endif # GNU_CC
114
115
endif
116
endif
117
118
install::
119
$(MAKE) -C build install
120
$(MAKE) -C shell install
121
122
ifdef HAVE_DTRACE
123
javascript-trace.h: $(srcdir)/devtools/javascript-trace.d
124
dtrace -x nolibs -h -s $(srcdir)/devtools/javascript-trace.d -o javascript-trace.h.in
125
sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
126
-e '/const/!s/char \*/const char */g' \
127
javascript-trace.h.in > javascript-trace.h
128
129
# We can't automatically generate dependencies on auto-generated headers;
130
# we have to list them explicitly.
131
$(addsuffix .$(OBJ_SUFFIX),Probes jsinterp jsobj): $(CURDIR)/javascript-trace.h
132
133
ifneq ($(OS_ARCH),Darwin)
134
DTRACE_PROBE_OBJ = js-dtrace.$(OBJ_SUFFIX)
135
$(LIBRARY): $(DTRACE_PROBE_OBJ)
136
$(DTRACE_PROBE_OBJ): $(srcdir)/devtools/javascript-trace.d $(OBJS)
137
dtrace -x nolibs -G -C -s $< -o $@ $(filter-out $<, $^)
138
139
OBJS += $(DTRACE_PROBE_OBJ) # for "make clean"
140
endif # OS_ARCH != Darwin
141
endif # HAVE_DTRACE
142
143
###############################################
144
# Generating source package tarballs
145
# (only possible when tar is found)
146
ifneq (,$(TAR))
147
148
source-package:
149
SRCDIR=$(srcdir) \
150
DIST=$(DIST) \
151
MKDIR=$(MKDIR) \
152
TAR=$(TAR) \
153
AUTOCONF=$(AUTOCONF) \
154
MOZJS_MAJOR_VERSION=$(MOZJS_MAJOR_VERSION) \
155
MOZJS_MINOR_VERSION=$(MOZJS_MINOR_VERSION) \
156
MOZJS_PATCH_VERSION=$(MOZJS_PATCH_VERSION) \
157
MOZJS_ALPHA=$(MOZJS_ALPHA) \
158
$(srcdir)/make-source-package.sh
159
160
clean::
161
DIST=$(DIST) \
162
MOZJS_MAJOR_VERSION=$(MOZJS_MAJOR_VERSION) \
163
MOZJS_MINOR_VERSION=$(MOZJS_MINOR_VERSION) \
164
MOZJS_PATCH_VERSION=$(MOZJS_PATCH_VERSION) \
165
MOZJS_ALPHA=$(MOZJS_ALPHA) \
166
$(srcdir)/make-source-package.sh clean
167
168
endif