1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-17 16:47:22 +03:00
mal/js/Makefile

51 lines
1.1 KiB
Makefile
Raw Normal View History

TESTS = tests/types.js tests/reader.js
SOURCES_BASE = node_readline.js types.js reader.js printer.js interop.js
SOURCES_LISP = env.js core.js stepA_mal.js
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
WEB_SOURCES = $(SOURCES:node_readline.js=jq_readline.js)
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
all: node_modules
dist: mal.js mal web/mal.js
node_modules:
npm install
2017-09-15 07:39:00 +03:00
$(STEPS): node_modules
mal.js: $(SOURCES)
cat $+ | grep -v "= *require('./" >> $@
mal: mal.js
echo "#!/usr/bin/env node" > $@
cat $< >> $@
chmod +x $@
web/mal.js: $(WEB_SOURCES)
cat $+ | grep -v "= *require('./" > $@
clean:
rm -f mal.js web/mal.js
2017-09-15 07:39:00 +03:00
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; \