Commit | Line | Data |
---|---|---|
afde2df0 JM |
1 | ##################### |
2 | ||
edc3b064 JM |
3 | DEBUG = |
4 | ||
afde2df0 JM |
5 | TESTS = |
6 | ||
712af9ef | 7 | SOURCES_BASE = readline.cs types.cs reader.cs printer.cs |
90f618cb | 8 | SOURCES_LISP = env.cs core.cs stepA_mal.cs |
712af9ef | 9 | SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) |
b18969c0 | 10 | |
53beaa0a | 11 | OTHER_SOURCES = getline.cs |
afde2df0 JM |
12 | |
13 | ##################### | |
14 | ||
afdf531e | 15 | SRCS = step0_repl.cs step1_read_print.cs step2_eval.cs step3_env.cs \ |
faa20db2 | 16 | step4_if_fn_do.cs step5_tco.cs step6_file.cs step7_quote.cs \ |
90f618cb | 17 | step8_macros.cs step9_try.cs stepA_mal.cs |
53beaa0a | 18 | |
53beaa0a | 19 | LIB_SRCS = $(filter-out step%,$(OTHER_SOURCES) $(SOURCES)) |
afde2df0 | 20 | |
edc3b064 | 21 | FLAGS = $(if $(strip $(DEBUG)),-debug+,) |
b18969c0 | 22 | |
afde2df0 JM |
23 | ##################### |
24 | ||
b6dc3e37 JM |
25 | all: $(patsubst %.cs,%.exe,$(SRCS)) |
26 | ||
27 | dist: mal.exe | |
afde2df0 | 28 | |
53beaa0a | 29 | mal.exe: $(patsubst %.cs,%.exe,$(word $(words $(SOURCES)),$(SOURCES))) |
afde2df0 JM |
30 | cp $< $@ |
31 | ||
53beaa0a JM |
32 | mal.dll: $(LIB_SRCS) |
33 | mcs $(FLAGS) -target:library $+ -out:$@ | |
afde2df0 | 34 | |
53beaa0a JM |
35 | %.exe: %.cs mal.dll |
36 | mcs $(FLAGS) -r:mal.dll $< | |
afde2df0 JM |
37 | |
38 | clean: | |
86b689f3 | 39 | rm -f *.dll *.exe *.mdb |
afde2df0 JM |
40 | |
41 | .PHONY: stats tests $(TESTS) | |
42 | ||
43 | stats: $(SOURCES) | |
44 | @wc $^ | |
f15b4021 | 45 | @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" |
712af9ef JM |
46 | stats-lisp: $(SOURCES_LISP) |
47 | @wc $^ | |
f15b4021 | 48 | @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" |
afde2df0 JM |
49 | |
50 | tests: $(TESTS) | |
51 | ||
52 | $(TESTS): | |
53 | @echo "Running $@"; \ | |
54 | ./$@ || exit 1; \ |