3194c73524f43b8ae7041a7b465d911cc5a8405e
[jackhill/mal.git] / cs / Makefile
1 #####################
2
3 TESTS =
4
5 SOURCES = readline.cs types.cs reader.cs printer.cs env.cs core.cs \
6 step6_file.cs
7
8 OTHER_SOURCES = getline.cs
9
10 #####################
11
12 SRCS = step0_repl.cs step1_read_print.cs step2_eval.cs step3_env.cs \
13 step4_if_fn_do.cs step5_tco.cs step6_file.cs
14
15 LIB_SRCS = $(filter-out step%,$(OTHER_SOURCES) $(SOURCES))
16
17 FLAGS = -debug+
18
19 #####################
20
21 all: mal.exe $(patsubst %.cs,%.exe,$(SRCS))
22
23 mal.exe: $(patsubst %.cs,%.exe,$(word $(words $(SOURCES)),$(SOURCES)))
24 cp $< $@
25
26 mal.dll: $(LIB_SRCS)
27 mcs $(FLAGS) -target:library $+ -out:$@
28
29 %.exe: %.cs mal.dll
30 mcs $(FLAGS) -r:mal.dll $<
31
32 clean:
33 rm -f *.dll *.exe *.mbd
34
35 .PHONY: stats tests $(TESTS)
36
37 stats: $(SOURCES)
38 @wc $^
39
40 tests: $(TESTS)
41
42 $(TESTS):
43 @echo "Running $@"; \
44 ./$@ || exit 1; \