2014-03-25 01:32:24 +04:00
|
|
|
|
2014-04-28 02:58:48 +04:00
|
|
|
TESTS = tests/types.js tests/reader.js
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2016-02-18 09:33:19 +03:00
|
|
|
SOURCES_BASE = node_readline.js types.js reader.js printer.js interop.js
|
2015-02-28 20:09:54 +03:00
|
|
|
SOURCES_LISP = env.js core.js stepA_mal.js
|
2014-04-11 04:27:42 +04:00
|
|
|
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
|
2014-04-26 23:19:49 +04:00
|
|
|
WEB_SOURCES = $(SOURCES:node_readline.js=jq_readline.js)
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2017-09-15 07:39:00 +03:00
|
|
|
STEPS = step0_repl.js step1_read_print.js step2_eval.js step3_env.js \
|
|
|
|
step4_if_fn_do.js step5_tco.js step6_file.js \
|
|
|
|
step7_quote.js step8_macros.js step9_try.js stepA_mal.js
|
|
|
|
|
2016-02-18 09:33:19 +03:00
|
|
|
all: node_modules
|
|
|
|
|
2016-02-24 09:45:40 +03:00
|
|
|
dist: mal.js mal web/mal.js
|
2014-04-22 20:44:26 +04:00
|
|
|
|
|
|
|
node_modules:
|
|
|
|
npm install
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2017-09-15 07:39:00 +03:00
|
|
|
$(STEPS): node_modules
|
|
|
|
|
2014-03-25 01:32:24 +04:00
|
|
|
mal.js: $(SOURCES)
|
|
|
|
cat $+ | grep -v "= *require('./" >> $@
|
2016-02-24 09:45:40 +03:00
|
|
|
|
|
|
|
mal: mal.js
|
|
|
|
echo "#!/usr/bin/env node" > $@
|
|
|
|
cat $< >> $@
|
2014-03-25 01:32:24 +04:00
|
|
|
chmod +x $@
|
|
|
|
|
2014-04-26 23:19:49 +04:00
|
|
|
web/mal.js: $(WEB_SOURCES)
|
2014-03-25 01:32:24 +04:00
|
|
|
cat $+ | grep -v "= *require('./" > $@
|
|
|
|
|
|
|
|
clean:
|
2014-04-26 23:19:49 +04:00
|
|
|
rm -f mal.js web/mal.js
|
2017-09-15 07:39:00 +03:00
|
|
|
rm -rf node_modules
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2019-03-21 07:32:35 +03:00
|
|
|
.PHONY: tests $(TESTS)
|
2014-03-25 01:32:24 +04:00
|
|
|
|
|
|
|
tests: $(TESTS)
|
|
|
|
|
|
|
|
$(TESTS):
|
|
|
|
@echo "Running $@"; \
|
|
|
|
node $@ || exit 1; \
|