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