load-file: accept empty file or final comment, return nil
[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
5STEP1_DEPS = $(STEP0_DEPS) reader.cr printer.cr
6STEP2_DEPS = $(STEP1_DEPS) types.cr
7STEP3_DEPS = $(STEP2_DEPS) env.cr
8STEP4_DEPS = $(STEP3_DEPS) core.cr error.cr
9
86fe6314 10STEP_BINS = $(STEPS:%.cr=%)
11LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS))
12
b6dc3e37
JM
13all: $(STEP_BINS)
14
15dist: mal
86fe6314 16
17mal: $(LAST_STEP_BIN)
18 cp $< $@
19
a821cd72 20$(STEP_BINS): %: %.cr
5185c56e 21 crystal build --release $<
86fe6314 22
a821cd72
JM
23step0_repl: $(STEP0_DEPS)
24step1_read_print: $(STEP1_DEPS)
25step2_eval: $(STEP2_DEPS)
26step3_env: $(STEP3_DEPS)
27step4_if_fn_do step5_tco step6_file step7_quote step8_macros step9_try stepA_mal: $(STEP4_DEPS)
28
86fe6314 29clean:
30 rm -rf $(STEP_BINS) mal .crystal
31
c4269f9b 32.PHONY: all clean
86fe6314 33