| 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) && $(PYTHON3) $(topsrcdir)/config/check_js_msg_encoding.py); |
| 44 |
|
| 45 |
check-jit-test:: |
| 46 |
$(JITTEST_SANITIZER_ENV) $(PYTHON3) -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$(BIN_SUFFIX) $(JITTEST_TEST_ARGS) |
| 51 |
|
| 52 |
check:: check-js-msg |
| 53 |
|
| 54 |
check-jstests: |
| 55 |
$(PYTHON3) -u $(srcdir)/tests/jstests.py \ |
| •56 |
--no-progress --format=automation --timeout 600 \ |
| 57 |
$(JSTESTS_EXTRA_ARGS) \ |
| 58 |
$(DIST)/bin/js$(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 |
CFLAGS += $(MOZ_ZLIB_CFLAGS) |
| 78 |
|
| 79 |
ifeq ($(OS_ARCH),SunOS) |
| 80 |
ifeq ($(TARGET_CPU),sparc) |
| 81 |
|
| 82 |
ifneq ($(CC_TYPE),clang-cl) |
| 83 |
CFLAGS += -mcpu=v9 |
| 84 |
CXXFLAGS += -mcpu=v9 |
| 85 |
endif # !clang-cl |
| 86 |
|
| 87 |
endif |
| 88 |
endif |
| 89 |
|
| 90 |
install:: |
| 91 |
$(MAKE) -C build install |
| 92 |
$(MAKE) -C shell install |
| 93 |
|
| 94 |
ifdef HAVE_DTRACE |
| 95 |
javascript-trace.h: $(srcdir)/devtools/javascript-trace.d |
| 96 |
dtrace -x nolibs -h -s $(srcdir)/devtools/javascript-trace.d -o javascript-trace.h.in |
| 97 |
sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \ |
| 98 |
-e '/const/!s/char \*/const char */g' \ |
| 99 |
javascript-trace.h.in > javascript-trace.h |
| 100 |
|
| 101 |
# We can't automatically generate dependencies on auto-generated headers; |
| 102 |
# we have to list them explicitly. |
| 103 |
$(addsuffix .$(OBJ_SUFFIX),Probes jsinterp jsobj): $(CURDIR)/javascript-trace.h |
| 104 |
|
| 105 |
ifneq ($(OS_ARCH),Darwin) |
| 106 |
DTRACE_PROBE_OBJ = js-dtrace.$(OBJ_SUFFIX) |
| 107 |
$(LIBRARY): $(DTRACE_PROBE_OBJ) |
| 108 |
$(DTRACE_PROBE_OBJ): $(srcdir)/devtools/javascript-trace.d $(OBJS) |
| 109 |
dtrace -x nolibs -G -C -s $< -o $@ $(filter-out $<, $^) |
| 110 |
|
| 111 |
OBJS += $(DTRACE_PROBE_OBJ) |
| 112 |
endif # OS_ARCH != Darwin |
| 113 |
endif # HAVE_DTRACE |
| 114 |
|
| 115 |
############################################### |
| 116 |
# Generating source package tarballs |
| 117 |
# (only possible when tar is found) |
| 118 |
ifneq (,$(TAR)) |
| 119 |
|
| 120 |
source-package: |
| 121 |
SRCDIR=$(srcdir) \ |
| 122 |
DIST=$(DIST) \ |
| 123 |
MKDIR=$(MKDIR) \ |
| 124 |
TAR=$(TAR) \ |
| 125 |
M4=$(M4) \ |
| 126 |
AWK=$(AWK) \ |
| 127 |
MOZJS_MAJOR_VERSION=$(MOZJS_MAJOR_VERSION) \ |
| 128 |
MOZJS_MINOR_VERSION=$(MOZJS_MINOR_VERSION) \ |
| 129 |
MOZJS_PATCH_VERSION=$(MOZJS_PATCH_VERSION) \ |
| 130 |
MOZJS_ALPHA=$(MOZJS_ALPHA) \ |
| 131 |
$(srcdir)/make-source-package.sh |
| 132 |
|
| 133 |
endif |