Commit | Line | Data |
---|---|---|
1c358979 PS |
1 | ##################### |
2 | ||
6dcc04db | 3 | DEBUG = |
1c358979 PS |
4 | |
5 | TESTS = | |
6 | ||
6d809e32 | 7 | SOURCES_BASE = error.fs types.fs node.fs printer.fs tokenizer.fs reader.fs \ |
4f3f9cd5 | 8 | core.fs env.fs readline.fs |
1c358979 | 9 | SOURCES_LISP = |
ed3a12f5 PS |
10 | SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) |
11 | ||
12 | TERMINAL_SOURCES = terminal.cs | |
1c358979 PS |
13 | |
14 | ##################### | |
15 | ||
a836d8f3 | 16 | SRCS = step0_repl.fs step1_read_print.fs step2_eval.fs step3_env.fs \ |
aa2e1438 | 17 | step4_if_fn_do.fs step5_tco.fs step6_file.fs step7_quote.fs |
1c358979 | 18 | |
8862f80e | 19 | FSFLAGS = $(if $(strip $(DEBUG)),--debug+,--debug- --optimize+ --tailcalls+) |
6dcc04db | 20 | CSFLAGS = $(if $(strip $(DEBUG)),-debug+,) |
1c358979 PS |
21 | ##################### |
22 | ||
23 | all: $(patsubst %.fs,%.exe,$(SRCS)) | |
24 | ||
ed3a12f5 | 25 | Mono.Terminal.dll: $(TERMINAL_SOURCES) |
6dcc04db | 26 | mcs $(CSFLAGS) -target:library $+ -out:$@ |
ed3a12f5 PS |
27 | |
28 | mal.dll: $(SOURCES) Mono.Terminal.dll | |
6dcc04db | 29 | fsharpc $(FSFLAGS) -o $@ -r Mono.Terminal.dll -a $(SOURCES) |
ed3a12f5 PS |
30 | |
31 | %.exe: %.fs mal.dll | |
6dcc04db | 32 | fsharpc $(FSFLAGS) -o $@ -r mal.dll $< |
1c358979 PS |
33 | |
34 | clean: | |
35 | rm -f *.dll *.exe *.mdb | |
36 | ||
37 | .PHONY: stats tests $(TESTS) | |
38 | ||
39 | stats: $(SOURCES) | |
40 | @wc $^ | |
41 | stats-lisp: $(SOURCES_LISP) | |
42 | @wc $^ | |
43 | ||
44 | tests: $(TESTS) | |
45 | ||
46 | $(TESTS): | |
47 | @echo "Running $@"; \ | |
48 | ./$@ || exit 1; \ |