-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMakefile
107 lines (82 loc) · 2.45 KB
/
Makefile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
TOP=$(shell pwd)
include $(TOP)/build/config.mk
SUBDIRS=external-deps node-compat node-llvm ejs-llvm lib runtime
STAGE1_EXE = ejs.exe.stage1
STAGE2_EXE = ejs.exe.stage2
STAGE3_EXE = ejs.exe.stage3
# run git submodule magic if somebody is antsy and doesn't type the magic incantation before typing make
all-local:: ensure-submodules
NODE_PATH?=$(shell $(MAKE) --no-print-directory -C test node-path)
all-hook:: stage1
install-local::
@$(MKDIR) $(bindir)
$(INSTALL) -c ejs.exe $(bindir)/ejs
clean-local::
@rm -f $(STAGE1_EXE) $(STAGE2_EXE) $(STAGE3_EXE) ejs.exe
TARNAME=$(PRODUCT_name)-$(PRODUCT_VERSION)
TARFILE=$(TARNAME).tar.gz
DISTROOT=$(TOP)
TAR_EXCLUDES= \
--exclude .circleci \
--exclude .git \
--exclude .gitmodules \
--exclude .gitignore \
--exclude .deps \
--exclude host-config.mk \
--exclude host-config.js \
--exclude host-config-es6.js \
--exclude $(TARFILE) \
--exclude $(TARNAME)
dist-hook:: ensure-submodules
@echo creating $(DISTROOT)/$(TARNAME).tar.gz
@rm -rf $(DISTROOT)/$(TARNAME)
@$(MKDIR) $(DISTROOT)/$(TARNAME)
@COPYFILE_DISABLE=1 tar -c $(TAR_EXCLUDES) * | tar -C $(DISTROOT)/$(TARNAME) -xp
@(cd $(DISTROOT); \
COPYFILE_DISABLE=1 tar -czf $(TARFILE) $(TARNAME))
@rm -rf $(DISTROOT)/$(TARNAME)
@ls -l $(DISTROOT)/$(TARFILE)
check:
@$(MAKE) -C test $@
check-%:
@$(MAKE) -C test $@
bootstrap: stage3
MODULE_DIRS = --moduledir $(TOP)/node-compat --moduledir $(TOP)/ejs-llvm
lib/generated:
@$(MAKE) -C lib
stage0:
@echo DONE
stage1: $(STAGE1_EXE)
@cp $(STAGE1_EXE) ejs.exe
@ls -l ejs.exe
@echo DONE
stage2: $(STAGE2_EXE)
@cp $(STAGE2_EXE) ejs.exe
@ls -l ejs.exe
@echo DONE
stage3: $(STAGE3_EXE)
@cp $(STAGE3_EXE) ejs.exe
@ls -l ejs.exe
@echo DONE
$(STAGE1_EXE): lib/generated
@echo Building stage 1
@NODE_PATH="$(NODE_PATH)" ./ejs --srcdir --leave-temp $(MODULE_DIRS) ejs-es6.js
@mv ejs-es6.js.exe $@
$(STAGE2_EXE): $(STAGE1_EXE) lib/*.js lib/*.js.in
@echo Building stage 2
@./$(STAGE1_EXE) --srcdir --leave-temp $(MODULE_DIRS) ejs-es6.js
@mv ejs-es6.js.exe $@
$(STAGE3_EXE): $(STAGE2_EXE) lib/*.js lib/*.js.in
@echo Building stage 3
@./$(STAGE2_EXE) --srcdir --leave-temp $(MODULE_DIRS) ejs-es6.js
@mv ejs-es6.js.exe $@
echo-command-line:
@echo ./ejs.exe --leave-temp $(MODULE_DIRS) ejs-es6.js
osx-tarball:
$(MAKE) -C release osx-tarball
ensure-submodules:
@if [ ! -f pcre/configure.ac ]; then \
git submodule init; \
git submodule update; \
fi
include $(TOP)/build/build.mk