aboutsummaryrefslogtreecommitdiff
path: root/cs/Makefile
blob: 00280968ac7f243b866403c927be60cd79b7c944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#####################

TESTS =

SOURCES = readline.cs types.cs reader.cs printer.cs \
	  step0_repl.cs step1_read_print.cs
OTHER_SOURCES = getline.cs

#####################

FLAGS = -debug+

OBJS =
LIB_SRCS = $(filter-out step%,$(OTHER_SOURCES) $(SOURCES))

#####################

all: mal.exe $(patsubst %.cs,%.exe,$(filter step%,$(SOURCES)))

mal.exe: $(patsubst %.cs,%.exe,$(word $(words $(SOURCES)),$(SOURCES)))
	cp $< $@

mal.dll: $(LIB_SRCS)
	mcs $(FLAGS) -target:library $+ -out:$@

%.exe: %.cs mal.dll
	mcs $(FLAGS) -r:mal.dll $<

clean:
	rm -f *.dll *.exe *.mbd

.PHONY: stats tests $(TESTS)

stats: $(SOURCES)
	@wc $^

tests: $(TESTS)

$(TESTS):
	@echo "Running $@"; \
	./$@ || exit 1; \