Add link to Rust implementation by Tim Morgan.
[jackhill/mal.git] / crystal / Makefile
CommitLineData
86fe6314 1STEPS = step0_repl.cr step1_read_print.cr step2_eval.cr step3_env.cr \
2 step4_if_fn_do.cr step5_tco.cr step6_file.cr step7_quote.cr \
3 step8_macros.cr step9_try.cr stepA_mal.cr
4
a821cd72
JM
5STEP0_DEPS = readline.cr
6STEP1_DEPS = $(STEP0_DEPS) reader.cr printer.cr
7STEP2_DEPS = $(STEP1_DEPS) types.cr
8STEP3_DEPS = $(STEP2_DEPS) env.cr
9STEP4_DEPS = $(STEP3_DEPS) core.cr error.cr
10
86fe6314 11STEP_BINS = $(STEPS:%.cr=%)
12LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS))
13
b6dc3e37
JM
14all: $(STEP_BINS)
15
16dist: mal
86fe6314 17
18mal: $(LAST_STEP_BIN)
19 cp $< $@
20
a821cd72 21$(STEP_BINS): %: %.cr
d10848bb 22 crystal compile --release $<
86fe6314 23
a821cd72
JM
24step0_repl: $(STEP0_DEPS)
25step1_read_print: $(STEP1_DEPS)
26step2_eval: $(STEP2_DEPS)
27step3_env: $(STEP3_DEPS)
28step4_if_fn_do step5_tco step6_file step7_quote step8_macros step9_try stepA_mal: $(STEP4_DEPS)
29
86fe6314 30clean:
31 rm -rf $(STEP_BINS) mal .crystal
32
abff2fa8 33stats: types.cr error.cr readline.cr reader.cr printer.cr env.cr core.cr stepA_mal.cr
86fe6314 34 @wc $^
f15b4021 35 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
86fe6314 36stats-lisp: env.cr core.cr stepA_mal.cr
37 @wc $^
f15b4021 38 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
86fe6314 39
40.PHONY: all clean stats stats-lisp
41