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 | ||
b18969c0 | 25 | all: mal.exe $(patsubst %.cs,%.exe,$(SRCS)) |
afde2df0 | 26 | |
53beaa0a | 27 | mal.exe: $(patsubst %.cs,%.exe,$(word $(words $(SOURCES)),$(SOURCES))) |
afde2df0 JM |
28 | cp $< $@ |
29 | ||
53beaa0a JM |
30 | mal.dll: $(LIB_SRCS) |
31 | mcs $(FLAGS) -target:library $+ -out:$@ | |
afde2df0 | 32 | |
53beaa0a JM |
33 | %.exe: %.cs mal.dll |
34 | mcs $(FLAGS) -r:mal.dll $< | |
afde2df0 JM |
35 | |
36 | clean: | |
86b689f3 | 37 | rm -f *.dll *.exe *.mdb |
afde2df0 JM |
38 | |
39 | .PHONY: stats tests $(TESTS) | |
40 | ||
41 | stats: $(SOURCES) | |
42 | @wc $^ | |
f15b4021 | 43 | @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" |
712af9ef JM |
44 | stats-lisp: $(SOURCES_LISP) |
45 | @wc $^ | |
f15b4021 | 46 | @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]" |
afde2df0 JM |
47 | |
48 | tests: $(TESTS) | |
49 | ||
50 | $(TESTS): | |
51 | @echo "Running $@"; \ | |
52 | ./$@ || exit 1; \ |