1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 10:37:58 +03:00
mal/es6/Makefile

45 lines
994 B
Makefile
Raw Normal View History

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
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
2017-09-28 06:10:24 +03:00
all: node_modules
2015-07-31 05:15:55 +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
mal: mal.js
echo "#!/usr/bin/env node" > $@
cat $< >> $@
chmod +x $@
2015-07-31 05:15:55 +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
.PHONY: stats tests $(TESTS)
stats: $(SOURCES)
@wc $^
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
stats-lisp: $(SOURCES_LISP)
@wc $^
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
tests: $(TESTS)
$(TESTS):
@echo "Running $@"; \
node $@ || exit 1; \