fsharp: step 2: Factored out funcs into Core module.
[jackhill/mal.git] / fsharp / Makefile
1 #####################
2
3 DEBUG =
4
5 TESTS =
6
7 SOURCES_BASE = types.fs core.fs tokenizer.fs reader.fs eval.fs printer.fs readline.fs
8 SOURCES_LISP =
9 SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
10
11 TERMINAL_SOURCES = terminal.cs
12
13 #####################
14
15 SRCS = step0_repl.fs step1_read_print.fs step2_eval.fs
16
17 FSFLAGS = $(if $(strip $(DEBUG)),--debug+,)
18 CSFLAGS = $(if $(strip $(DEBUG)),-debug+,)
19 #####################
20
21 all: $(patsubst %.fs,%.exe,$(SRCS))
22
23 Mono.Terminal.dll: $(TERMINAL_SOURCES)
24 mcs $(CSFLAGS) -target:library $+ -out:$@
25
26 mal.dll: $(SOURCES) Mono.Terminal.dll
27 fsharpc $(FSFLAGS) -o $@ -r Mono.Terminal.dll -a $(SOURCES)
28
29 %.exe: %.fs mal.dll
30 fsharpc $(FSFLAGS) -o $@ -r mal.dll $<
31
32 clean:
33 rm -f *.dll *.exe *.mdb
34
35 .PHONY: stats tests $(TESTS)
36
37 stats: $(SOURCES)
38 @wc $^
39 stats-lisp: $(SOURCES_LISP)
40 @wc $^
41
42 tests: $(TESTS)
43
44 $(TESTS):
45 @echo "Running $@"; \
46 ./$@ || exit 1; \