aboutsummaryrefslogtreecommitdiff
path: root/js/Makefile
blob: 2b7aa88bc26b948ebc5adfd47e7844df716689be (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

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

SOURCES = node_readline.js types.js reader.js printer.js \
	  env.js core.js stepA_more.js
WEB_SOURCES = $(SOURCES:node_readline.js=josh_readline.js)

all: mal.js mal_web.js

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

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

clean:
	rm -f mal.js mal_web.js

.PHONY: stats tests $(TESTS)

stats: $(SOURCES)
	@wc $^

tests: $(TESTS)

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