2015-02-22 06:43:40 +03:00
|
|
|
#####################
|
|
|
|
|
2015-03-01 18:49:55 +03:00
|
|
|
DEBUG =
|
2015-02-22 06:43:40 +03:00
|
|
|
|
|
|
|
TESTS =
|
|
|
|
|
2015-03-16 15:09:10 +03:00
|
|
|
SOURCES_BASE = types.fs core.fs tokenizer.fs reader.fs env.fs eval.fs \
|
|
|
|
printer.fs readline.fs
|
2015-02-22 06:43:40 +03:00
|
|
|
SOURCES_LISP =
|
2015-02-24 07:22:58 +03:00
|
|
|
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
|
|
|
|
|
|
|
|
TERMINAL_SOURCES = terminal.cs
|
2015-02-22 06:43:40 +03:00
|
|
|
|
|
|
|
#####################
|
|
|
|
|
2015-03-16 15:09:10 +03:00
|
|
|
SRCS = step0_repl.fs step1_read_print.fs step2_eval.fs step3_env.fs
|
2015-02-22 06:43:40 +03:00
|
|
|
|
2015-03-01 18:49:55 +03:00
|
|
|
FSFLAGS = $(if $(strip $(DEBUG)),--debug+,)
|
|
|
|
CSFLAGS = $(if $(strip $(DEBUG)),-debug+,)
|
2015-02-22 06:43:40 +03:00
|
|
|
#####################
|
|
|
|
|
|
|
|
all: $(patsubst %.fs,%.exe,$(SRCS))
|
|
|
|
|
2015-02-24 07:22:58 +03:00
|
|
|
Mono.Terminal.dll: $(TERMINAL_SOURCES)
|
2015-03-01 18:49:55 +03:00
|
|
|
mcs $(CSFLAGS) -target:library $+ -out:$@
|
2015-02-24 07:22:58 +03:00
|
|
|
|
|
|
|
mal.dll: $(SOURCES) Mono.Terminal.dll
|
2015-03-01 18:49:55 +03:00
|
|
|
fsharpc $(FSFLAGS) -o $@ -r Mono.Terminal.dll -a $(SOURCES)
|
2015-02-24 07:22:58 +03:00
|
|
|
|
|
|
|
%.exe: %.fs mal.dll
|
2015-03-01 18:49:55 +03:00
|
|
|
fsharpc $(FSFLAGS) -o $@ -r mal.dll $<
|
2015-02-22 06:43:40 +03:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.dll *.exe *.mdb
|
|
|
|
|
|
|
|
.PHONY: stats tests $(TESTS)
|
|
|
|
|
|
|
|
stats: $(SOURCES)
|
|
|
|
@wc $^
|
|
|
|
stats-lisp: $(SOURCES_LISP)
|
|
|
|
@wc $^
|
|
|
|
|
|
|
|
tests: $(TESTS)
|
|
|
|
|
|
|
|
$(TESTS):
|
|
|
|
@echo "Running $@"; \
|
|
|
|
./$@ || exit 1; \
|