Commit | Line | Data |
---|---|---|
31690700 | 1 | |
cc021efe | 2 | TESTS = tests/types.js tests/reader.js |
31690700 | 3 | |
5245b079 | 4 | SOURCES_BASE = node_readline.js types.js reader.js printer.js interop.js |
90f618cb | 5 | SOURCES_LISP = env.js core.js stepA_mal.js |
712af9ef | 6 | SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) |
e4393504 | 7 | WEB_SOURCES = $(SOURCES:node_readline.js=jq_readline.js) |
31690700 | 8 | |
2a368ba6 JM |
9 | STEPS = step0_repl.js step1_read_print.js step2_eval.js step3_env.js \ |
10 | step4_if_fn_do.js step5_tco.js step6_file.js \ | |
11 | step7_quote.js step8_macros.js step9_try.js stepA_mal.js | |
12 | ||
5245b079 JM |
13 | all: node_modules |
14 | ||
8e2d4a4c | 15 | dist: mal.js mal web/mal.js |
e47ddca2 WB |
16 | |
17 | node_modules: | |
18 | npm install | |
31690700 | 19 | |
2a368ba6 JM |
20 | $(STEPS): node_modules |
21 | ||
31690700 | 22 | mal.js: $(SOURCES) |
31690700 | 23 | cat $+ | grep -v "= *require('./" >> $@ |
8e2d4a4c JM |
24 | |
25 | mal: mal.js | |
26 | echo "#!/usr/bin/env node" > $@ | |
27 | cat $< >> $@ | |
31690700 JM |
28 | chmod +x $@ |
29 | ||
e4393504 | 30 | web/mal.js: $(WEB_SOURCES) |
31690700 JM |
31 | cat $+ | grep -v "= *require('./" > $@ |
32 | ||
33 | clean: | |
e4393504 | 34 | rm -f mal.js web/mal.js |
2a368ba6 | 35 | rm -rf node_modules |
31690700 | 36 | |
c4269f9b | 37 | .PHONY: tests $(TESTS) |
31690700 JM |
38 | |
39 | tests: $(TESTS) | |
40 | ||
41 | $(TESTS): | |
42 | @echo "Running $@"; \ | |
43 | node $@ || exit 1; \ |