Merge pull request #143 from dubek/add-gensym
[jackhill/mal.git] / rpython / Makefile
1
2 RPYTHON = rpython
3
4 UPPER_STEPS = step4_if_fn_do step5_tco step6_file step7_quote step8_macros step9_try stepA_mal
5 STEPS = step0_repl step1_read_print step2_eval step3_env $(UPPER_STEPS)
6
7 SOURCES_BASE = mal_readline.py mal_types.py reader.py printer.py
8 SOURCES_LISP = env.py core.py stepA_mal.py
9 SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
10
11 all: $(STEPS)
12
13 %: %.py
14 $(RPYTHON) --output=$@ $<
15
16 STEP0_DEPS = mal_readline.py
17 STEP1_DEPS = $(STEP0_DEPS) mal_types.py reader.py printer.py
18 STEP3_DEPS = $(STEP1_DEPS) env.py
19 STEP4_DEPS = $(STEP3_DEPS) core.py
20
21 step0_repl: $(STEP0_DEPS)
22 step1_read_print step2_eval: $(STEP1_DEPS)
23 step3_env: $(STEP3_DEPS)
24 $(UPPER_STEPS): $(STEP4_DEPS)
25
26 .PHONY: clean stats stats-lisp
27
28 clean:
29 rm -f $(STEPS) *.pyc
30 rm -rf __pycache__
31
32 stats: $(SOURCES)
33 @wc $^
34 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
35 stats-lisp: $(SOURCES_LISP)
36 @wc $^
37 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
38