awk-es6, Makefile: dist ruiles
[jackhill/mal.git] / cs / Makefile
CommitLineData
afde2df0
JM
1#####################
2
edc3b064
JM
3DEBUG =
4
afde2df0
JM
5TESTS =
6
712af9ef 7SOURCES_BASE = readline.cs types.cs reader.cs printer.cs
90f618cb 8SOURCES_LISP = env.cs core.cs stepA_mal.cs
712af9ef 9SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
b18969c0 10
53beaa0a 11OTHER_SOURCES = getline.cs
afde2df0
JM
12
13#####################
14
afdf531e 15SRCS = 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 19LIB_SRCS = $(filter-out step%,$(OTHER_SOURCES) $(SOURCES))
afde2df0 20
edc3b064 21FLAGS = $(if $(strip $(DEBUG)),-debug+,)
b18969c0 22
afde2df0
JM
23#####################
24
b6dc3e37
JM
25all: $(patsubst %.cs,%.exe,$(SRCS))
26
27dist: mal.exe
afde2df0 28
53beaa0a 29mal.exe: $(patsubst %.cs,%.exe,$(word $(words $(SOURCES)),$(SOURCES)))
afde2df0
JM
30 cp $< $@
31
53beaa0a
JM
32mal.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
38clean:
86b689f3 39 rm -f *.dll *.exe *.mdb
afde2df0
JM
40
41.PHONY: stats tests $(TESTS)
42
43stats: $(SOURCES)
44 @wc $^
f15b4021 45 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
712af9ef
JM
46stats-lisp: $(SOURCES_LISP)
47 @wc $^
f15b4021 48 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
afde2df0
JM
49
50tests: $(TESTS)
51
52$(TESTS):
53 @echo "Running $@"; \
54 ./$@ || exit 1; \