-
Notifications
You must be signed in to change notification settings - Fork 2
/
libjs.make
65 lines (56 loc) · 1.87 KB
/
libjs.make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# This makefile is used to build the Javascript dependency for Oolite
#
# This Makefile is used to download and build the Javascript library
# for use by Oolite.
# Depending on invocation, a debug or release (default) version of the
# library will be built.
#
# To use:
# $ make -f libjs.make debug=(yes|no)
include config.make
LIBJS_SRC_DIR = deps/mozilla/js/src
LIBJS_CONFIG_FLAGS = --disable-shared-js
LIBJS_CONFIG_FLAGS += --enable-threadsafe
LIBJS_CONFIG_FLAGS += --with-system-nspr
LIBJS_CONFIG_FLAGS += --disable-tests
ifeq ($(OO_JAVASCRIPT_TRACE),yes)
LIBJS_CONFIG_FLAGS += --enable-trace-jscalls
endif
ifeq ($(debug),yes)
LIBJS_BUILD_DIR = $(LIBJS_SRC_DIR)/build-debug
LIBJS_CONFIG_FLAGS += --enable-debug
LIBJS_CONFIG_FLAGS += --disable-optimize
LIBJS_BUILD_FLAGS =
else
LIBJS_BUILD_DIR = $(LIBJS_SRC_DIR)/build-release
LIBJS_BUILD_FLAGS =
endif
LIBJS = $(LIBJS_BUILD_DIR)/libjs_static.a
LIBJS_BUILD_STAMP = $(LIBJS_BUILD_DIR)/build_stamp
LIBJS_CONFIG_STAMP = $(LIBJS_BUILD_DIR)/config_stamp
.PHONY: all
all: $(LIBJS)
$(LIBJS): $(LIBJS_BUILD_STAMP)
$(LIBJS_BUILD_STAMP): $(LIBJS_CONFIG_STAMP)
@echo
@echo "Building Javascript library..."
@echo
$(MAKE) -C $(LIBJS_BUILD_DIR) $(LIBJS_BUILD_FLAGS)
touch $@
$(LIBJS_CONFIG_STAMP):
@echo
@echo "Configuring Javascript library..."
@echo
mkdir -p $(LIBJS_BUILD_DIR)
cd $(LIBJS_BUILD_DIR) && ../configure $(LIBJS_CONFIG_FLAGS)
touch $@
.PHONY: clean
clean:
-$(MAKE) -C $(LIBJS_BUILD_DIR) clean
-$(RM) $(LIBJS_BUILD_STAMP)
# This target also removes the configuration status, forcing
# a reconfiguration. Use this after changing LIBJS_CONFIG_FLAGS
.PHONY: distclean
distclean:
-$(RM) -r $(LIBJS_BUILD_DIR)