Merge pull request #319 from chr15m/refactor-php-web-runner
[jackhill/mal.git] / groovy / Makefile
CommitLineData
a9cd6543
JM
1CLASSES = types.class reader.class printer.class env.class core.class
2
3SOURCES_BASE = types.groovy reader.groovy printer.groovy
4SOURCES_LISP = env.groovy core.groovy stepA_mal.groovy
5SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
6
7all: ${CLASSES}
8
8e2d4a4c
JM
9dist: mal.jar
10
de3f3ed1
JM
11step1_read_print.groovy: types.class reader.class printer.class
12step2_eval.groovy: types.class reader.class printer.class
13step3_env.groovy: types.class reader.class printer.class env.class
14step4_if_fn_do.groovy step6_file.groovy step7_quote.groovy step8_macros.groovy step9_try.groovy stepA_mal.groovy: ${CLASSES}
44aef1f4 15
a9cd6543
JM
16types.class: types.groovy
17 groovyc $<
18
19env.class: env.groovy
20 groovyc $<
21
22reader.class: reader.groovy
23 groovyc $<
24
25printer.class: printer.groovy
26 groovyc $<
27
28core.class: core.groovy types.class reader.class printer.class
29 groovyc $<
30
8e2d4a4c
JM
31mal.jar: ${CLASSES}
32 groovyc stepA_mal.groovy
33 GROOVY_HOME=/usr/share/groovy groovy GroovyWrapper -d $@ -m stepA_mal
34
35SHELL := bash
36mal: mal.jar
37 cat <(echo -e '#!/bin/sh\nexec java -jar "$$0" "$$@"') mal.jar > $@
38 chmod +x mal
39
a9cd6543 40clean:
8e2d4a4c
JM
41 rm -f *.class classes/* mal.jar mal
42 rmdir classes || true
a9cd6543
JM
43
44.PHONY: stats tests
45
46stats: $(SOURCES)
47 @wc $^
f15b4021 48 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
a9cd6543
JM
49stats-lisp: $(SOURCES_LISP)
50 @wc $^
f15b4021 51 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"