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-07-03 20:07:57 +03:00
|
|
|
SOURCES_BASE = types.fs error.fs node.fs printer.fs tokenizer.fs reader.fs \
|
2015-10-08 05:46:12 +03:00
|
|
|
readline.fs
|
|
|
|
SOURCES_LISP = core.fs env.fs stepA_mal.fs
|
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-26 08:17:46 +03:00
|
|
|
SRCS = step0_repl.fs step1_read_print.fs step2_eval.fs step3_env.fs \
|
2015-07-03 17:57:15 +03:00
|
|
|
step4_if_fn_do.fs step5_tco.fs step6_file.fs step7_quote.fs \
|
2015-07-04 04:02:58 +03:00
|
|
|
step8_macros.fs step9_try.fs stepA_mal.fs
|
2015-10-08 05:46:12 +03:00
|
|
|
DLL_SOURCES = $(filter-out stepA_mal.fs,$(SOURCES))
|
2015-02-22 06:43:40 +03:00
|
|
|
|
2015-04-05 06:01:05 +03:00
|
|
|
FSFLAGS = $(if $(strip $(DEBUG)),--debug+,--debug- --optimize+ --tailcalls+)
|
2015-03-01 18:49:55 +03:00
|
|
|
CSFLAGS = $(if $(strip $(DEBUG)),-debug+,)
|
2015-02-22 06:43:40 +03:00
|
|
|
#####################
|
|
|
|
|
|
|
|
all: $(patsubst %.fs,%.exe,$(SRCS))
|
|
|
|
|
2016-02-24 09:45:40 +03:00
|
|
|
dist: mal.exe mal
|
2016-02-18 09:33:19 +03:00
|
|
|
|
|
|
|
mal.exe: stepA_mal.exe
|
|
|
|
cp $< $@
|
|
|
|
|
2016-02-24 09:45:40 +03:00
|
|
|
# NOTE/WARNING: static linking triggers mono libraries LGPL
|
|
|
|
# distribution requirements.
|
|
|
|
# http://www.mono-project.com/archived/guiderunning_mono_applications/
|
|
|
|
mal: $(patsubst %.fs,%.exe,$(word $(words $(SOURCES)),$(SOURCES))) Mono.Terminal.dll mal.dll
|
|
|
|
mkbundle --static -o $@ $+ --deps
|
|
|
|
|
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
|
|
|
|
2015-10-08 05:46:12 +03:00
|
|
|
mal.dll: $(DLL_SOURCES) Mono.Terminal.dll
|
|
|
|
fsharpc $(FSFLAGS) -o $@ -r Mono.Terminal.dll -a $(DLL_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:
|
2016-02-24 09:45:40 +03:00
|
|
|
rm -f mal *.dll *.exe *.mdb
|
2015-02-22 06:43:40 +03:00
|
|
|
|
|
|
|
.PHONY: stats tests $(TESTS)
|
|
|
|
|
|
|
|
stats: $(SOURCES)
|
|
|
|
@wc $^
|
2015-10-27 06:33:49 +03:00
|
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
2015-02-22 06:43:40 +03:00
|
|
|
stats-lisp: $(SOURCES_LISP)
|
|
|
|
@wc $^
|
2015-10-27 06:33:49 +03:00
|
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
2015-02-22 06:43:40 +03:00
|
|
|
|
|
|
|
tests: $(TESTS)
|
|
|
|
|
|
|
|
$(TESTS):
|
|
|
|
@echo "Running $@"; \
|
|
|
|
./$@ || exit 1; \
|