aboutsummaryrefslogtreecommitdiff
path: root/js/Makefile
blob: 98c429145fca1c7b763a7b60e6bb818e08d7d306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

TESTS = tests/types.js tests/reader.js

SOURCES_BASE = node_readline.js types.js reader.js printer.js
SOURCES_LISP = env.js core.js stepA_mal.js
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
WEB_SOURCES = $(SOURCES:node_readline.js=jq_readline.js)

all: node_modules mal.js web/mal.js

node_modules:
	npm install

mal.js: $(SOURCES)
	echo "#!/usr/bin/env node" > $@
	cat $+ | grep -v "= *require('./" >> $@
	chmod +x $@

web/mal.js: $(WEB_SOURCES)
	cat $+ | grep -v "= *require('./" > $@

clean:
	rm -f mal.js web/mal.js

.PHONY: stats tests $(TESTS)

stats: $(SOURCES)
	@wc $^
stats-lisp: $(SOURCES_LISP)
	@wc $^

tests: $(TESTS)

$(TESTS):
	@echo "Running $@"; \
	node $@ || exit 1; \