-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
90 lines (62 loc) · 3.16 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
# ------------------------------------------------------------
# file listings
# ------------------------------------------------------------
SOURCES := ast.sml main.sml pretty.sml verify.sml eval.sml mach.sml \
parser.sml pretty-rep.sml token.sml defn.sml logerr.sml native.sml
EV_TESTS := tests/exec.es
# ------------------------------------------------------------
# make functions
# ------------------------------------------------------------
sml=$(shell echo -e 'TextIO.output (TextIO.stdErr, $(strip $(1)));' | (sml >/dev/null) 2>&1)
anchorhome=$(call sml,valOf((\#get (CM.Anchor.anchor "$(strip $(1))")())))
# ------------------------------------------------------------
# build parameters
# ------------------------------------------------------------
HEAP_SUFFIX := $(call sml,SMLofNJ.SysInfo.getHeapSuffix())
MLBUILD := ml-build
#ifneq ($(call anchorhome,smlnj-tdp),)
# TODO: uncomment this once everyone is using the latest SML/NJ svn sources
#MLBUILD_ARGS=-Ctdp.instrument=true -DBACKTRACE \$$smlnj-tdp/back-trace.cm
#endif
# ------------------------------------------------------------
# targets
# ------------------------------------------------------------
.PHONY: check checktc checkev wc clean cleanml profile
es4.heap.$(HEAP_SUFFIX): $(wildcard *.sml) lexer.lex pretty-cvt.sml
$(MLBUILD) $(MLBUILD_ARGS) es4.cm Main.main es4.heap
pretty-cvt.sml: tools/gen-pretty.heap.$(HEAP_SUFFIX) ast.sml
cd tools && sml @SMLload=gen-pretty.heap ../ast.sml ../pretty-cvt.sml
tools/gen-pretty.heap.$(HEAP_SUFFIX): tools/gen-pretty.cm tools/gen-convert.sml tools/gen-pretty.sml tools/quasiquote.sml tools/smlast.sml
cd tools && $(MLBUILD) $(MLBUILD_ARGS) gen-pretty.cm GenPretty.main gen-pretty.heap
tools/unit.heap.$(HEAP_SUFFIX): tools/unit.cm tools/unit.sml $(wildcard *.sml) pretty-cvt.sml
cd tools && $(MLBUILD) $(MLBUILD_ARGS) unit.cm UnitTests.main unit.heap
# TODO: "check" should do all the *.test files, not just parse tests
check: tools/unit.heap.$(HEAP_SUFFIX) es4.heap.$(HEAP_SUFFIX)
sml @SMLload=tools/unit.heap $(TRACE) tests/parse.test
checktc: tools/unit.heap.$(HEAP_SUFFIX) es4.heap.$(HEAP_SUFFIX)
sml @SMLload=tools/unit.heap $(TRACE) tests/tc.test
checkev: tools/unit.heap.$(HEAP_SUFFIX) es4.heap.$(HEAP_SUFFIX)
sml @SMLload=tools/unit.heap $(TRACE) tests/exec/exec.test
checklth: tools/unit.heap.$(HEAP_SUFFIX) es4.heap.$(HEAP_SUFFIX)
sml @SMLload=tools/unit.heap $(TRACE) tests/lth_tests/lth_tests.test
smoketest: es4.heap.$(HEAP_SUFFIX)
sml @SMLload=es4.heap $(TRACE) -ev tests/spidermonkey/ecma/shell.js tests/spidermonkey/ecma/Boolean/15.6.1.js
dump-heap-for-running: es4.heap.$(HEAP_SUFFIX)
sml @SMLload=es4.heap $(TRACE) -dump run.heap
# Do *not* give this dependencies to see if the heap is up-to-date.
run-dumped:
sml @SMLload=run.heap $(TRACE) $(FILE)
# Obsolete now?
run:
sml @SMLload=es4.heap $(TRACE) -ev $(FILE)
repl: es4.heap.$(HEAP_SUFFIX)
perl repl-with-readline.pl
replNoReadline: es4.heap.$(HEAP_SUFFIX)
sml @SMLload=es4.heap -r
wc:
wc ${SOURCES}
clean:
rm -rf .cm tools/.cm es4.heap.$(HEAP_SUFFIX) tools/gen-pretty.heap.$(HEAP_SUFFIX)
profile:
touch multiname.sml mach.sml eval.sml
sml -Ctdp.instrument=true profile.sml 2>&1 | tee profile.txt