2017-09-28 06:10:24 +03:00
|
|
|
SOURCES_BASE = node_readline.js types.mjs reader.mjs printer.mjs
|
|
|
|
SOURCES_LISP = env.mjs core.mjs stepA_mal.mjs
|
2015-08-05 06:20:58 +03:00
|
|
|
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
|
2015-07-31 05:15:55 +03:00
|
|
|
|
2017-09-28 06:10:24 +03:00
|
|
|
STEPS = step0_repl.mjs step1_read_print.mjs step2_eval.mjs step3_env.mjs \
|
|
|
|
step4_if_fn_do.mjs step5_tco.mjs step6_file.mjs \
|
|
|
|
step7_quote.mjs step8_macros.mjs step9_try.mjs stepA_mal.mjs
|
2015-08-05 06:20:58 +03:00
|
|
|
|
2017-09-28 06:10:24 +03:00
|
|
|
all: node_modules
|
2015-07-31 05:15:55 +03:00
|
|
|
|
2016-02-24 09:45:40 +03:00
|
|
|
dist: mal.js mal
|
2016-02-15 05:57:31 +03:00
|
|
|
|
2017-09-28 06:10:24 +03:00
|
|
|
node_modules:
|
|
|
|
npm install
|
|
|
|
|
|
|
|
$(STEPS): node_modules
|
2016-02-15 05:57:31 +03:00
|
|
|
|
2017-09-28 06:10:24 +03:00
|
|
|
mal.js: $(SOURCES)
|
|
|
|
cat $+ | sed 's/^export //' | grep -v "^import " >> $@
|
2016-02-15 05:57:31 +03:00
|
|
|
|
2016-02-24 09:45:40 +03:00
|
|
|
mal: mal.js
|
|
|
|
echo "#!/usr/bin/env node" > $@
|
|
|
|
cat $< >> $@
|
|
|
|
chmod +x $@
|
2015-07-31 05:15:55 +03:00
|
|
|
|
2015-08-05 06:20:58 +03:00
|
|
|
|
2015-07-31 05:15:55 +03:00
|
|
|
clean:
|
2017-09-28 06:10:24 +03:00
|
|
|
rm -f mal.js mal
|
|
|
|
rm -rf node_modules
|
2015-08-05 06:20:58 +03:00
|
|
|
|
|
|
|
.PHONY: stats tests $(TESTS)
|
|
|
|
|
|
|
|
stats: $(SOURCES)
|
|
|
|
@wc $^
|
2015-10-27 06:33:49 +03:00
|
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
2015-08-05 06:20:58 +03:00
|
|
|
stats-lisp: $(SOURCES_LISP)
|
|
|
|
@wc $^
|
2015-10-27 06:33:49 +03:00
|
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
2015-08-05 06:20:58 +03:00
|
|
|
|
|
|
|
tests: $(TESTS)
|
|
|
|
|
|
|
|
$(TESTS):
|
|
|
|
@echo "Running $@"; \
|
|
|
|
node $@ || exit 1; \
|