1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-10 12:47:45 +03:00
mal/fsharp/Makefile

49 lines
1022 B
Makefile

#####################
DEBUG =
TESTS =
SOURCES_BASE = types.fs printer.fs tokenizer.fs reader.fs core.fs env.fs \
eval.fs readline.fs
SOURCES_LISP =
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
TERMINAL_SOURCES = terminal.cs
#####################
SRCS = step0_repl.fs step1_read_print.fs step2_eval.fs step3_env.fs \
step4_if_fn_do.fs step5_tco.fs step6_file.fs step7_quote.fs
FSFLAGS = $(if $(strip $(DEBUG)),--debug+,--debug- --optimize+ --tailcalls+)
CSFLAGS = $(if $(strip $(DEBUG)),-debug+,)
#####################
all: $(patsubst %.fs,%.exe,$(SRCS))
Mono.Terminal.dll: $(TERMINAL_SOURCES)
mcs $(CSFLAGS) -target:library $+ -out:$@
mal.dll: $(SOURCES) Mono.Terminal.dll
fsharpc $(FSFLAGS) -o $@ -r Mono.Terminal.dll -a $(SOURCES)
%.exe: %.fs mal.dll
fsharpc $(FSFLAGS) -o $@ -r mal.dll $<
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; \