Commit | Line | Data |
---|---|---|
c150ec41 JM |
1 | SOURCES_BASE = Readline.hs Types.hs Reader.hs Printer.hs |
2 | SOURCES_LISP = Env.hs Core.hs step9_try.hs | |
b76aa73b JM |
3 | SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) |
4 | ||
5 | ##################### | |
6 | ||
fa9a9758 | 7 | SRCS = step0_repl.hs step1_read_print.hs step2_eval.hs step3_env.hs \ |
2988d38e | 8 | step4_if_fn_do.hs step5_tco.hs step6_file.hs step7_quote.hs \ |
90f618cb | 9 | step8_macros.hs step9_try.hs stepA_mal.hs |
fa9a9758 | 10 | OTHER_SRCS = Readline.hs Types.hs Reader.hs Printer.hs Env.hs Core.hs |
b76aa73b JM |
11 | BINS = $(SRCS:%.hs=%) |
12 | ||
13 | ##################### | |
14 | ||
15 | all: $(BINS) mal | |
16 | ||
17 | mal: $(word $(words $(BINS)),$(BINS)) | |
18 | cp $< $@ | |
19 | ||
20 | $(BINS): %: %.hs $(OTHER_SRCS) | |
21 | ghc --make $< -o $@ | |
22 | ||
23 | clean: | |
24 | rm -f $(BINS) mal *.hi *.o | |
25 | ||
26 | .PHONY: stats stats-lisp tests $(TESTS) | |
27 | ||
28 | stats: $(SOURCES) | |
29 | @wc $^ | |
f15b4021 | 30 | @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*--|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" |
b76aa73b JM |
31 | stats-lisp: $(SOURCES_LISP) |
32 | @wc $^ | |
f15b4021 | 33 | @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*--|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" |