Merge pull request #330 from omarroth/update-crystal
[jackhill/mal.git] / crystal / Makefile
1 STEPS = 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
5 STEP1_DEPS = $(STEP0_DEPS) reader.cr printer.cr
6 STEP2_DEPS = $(STEP1_DEPS) types.cr
7 STEP3_DEPS = $(STEP2_DEPS) env.cr
8 STEP4_DEPS = $(STEP3_DEPS) core.cr error.cr
9
10 STEP_BINS = $(STEPS:%.cr=%)
11 LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS))
12
13 all: $(STEP_BINS)
14
15 dist: mal
16
17 mal: $(LAST_STEP_BIN)
18 cp $< $@
19
20 $(STEP_BINS): %: %.cr
21 crystal build --release $<
22
23 step0_repl: $(STEP0_DEPS)
24 step1_read_print: $(STEP1_DEPS)
25 step2_eval: $(STEP2_DEPS)
26 step3_env: $(STEP3_DEPS)
27 step4_if_fn_do step5_tco step6_file step7_quote step8_macros step9_try stepA_mal: $(STEP4_DEPS)
28
29 clean:
30 rm -rf $(STEP_BINS) mal .crystal
31
32 stats: types.cr error.cr reader.cr printer.cr env.cr core.cr stepA_mal.cr
33 @wc $^
34 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
35 stats-lisp: env.cr core.cr stepA_mal.cr
36 @wc $^
37 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
38
39 .PHONY: all clean stats stats-lisp
40