mirror of
https://github.com/kanaka/mal.git
synced 2024-09-21 02:27:10 +03:00
8e2d4a4ccb
Also in this commit: - fix *ARGV* setup in erlang and racket. - print startup message in fsharp Dist/packaging support for most implementations and also generate a */mal standalone app for most languages. The following implementations still have ability to generate a single */mal standalone application: - guile - julia - matlab (mkoctfile doesn't actually package up source files) - swift - vb (mkbundle error) Also, the following are mostly packaged into a single file but need some module dependencies - coffee: requires node_modules/ffi - es6: requires node_modules/ffi - js: requires node_modules/ffi - lua: module 'readline' not found - miniMAL: cannot find module '/mal/node_readline.js' - r: needs lib directory
64 lines
1.7 KiB
Makefile
64 lines
1.7 KiB
Makefile
#####################
|
|
|
|
DEBUG =
|
|
|
|
TESTS =
|
|
|
|
SOURCES_BASE = types.fs error.fs node.fs printer.fs tokenizer.fs reader.fs \
|
|
readline.fs
|
|
SOURCES_LISP = core.fs env.fs stepA_mal.fs
|
|
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 \
|
|
step8_macros.fs step9_try.fs stepA_mal.fs
|
|
DLL_SOURCES = $(filter-out stepA_mal.fs,$(SOURCES))
|
|
|
|
FSFLAGS = $(if $(strip $(DEBUG)),--debug+,--debug- --optimize+ --tailcalls+)
|
|
CSFLAGS = $(if $(strip $(DEBUG)),-debug+,)
|
|
#####################
|
|
|
|
all: $(patsubst %.fs,%.exe,$(SRCS))
|
|
|
|
dist: mal.exe mal
|
|
|
|
mal.exe: stepA_mal.exe
|
|
cp $< $@
|
|
|
|
# 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
|
|
|
|
Mono.Terminal.dll: $(TERMINAL_SOURCES)
|
|
mcs $(CSFLAGS) -target:library $+ -out:$@
|
|
|
|
mal.dll: $(DLL_SOURCES) Mono.Terminal.dll
|
|
fsharpc $(FSFLAGS) -o $@ -r Mono.Terminal.dll -a $(DLL_SOURCES)
|
|
|
|
%.exe: %.fs mal.dll
|
|
fsharpc $(FSFLAGS) -o $@ -r mal.dll $<
|
|
|
|
clean:
|
|
rm -f mal *.dll *.exe *.mdb
|
|
|
|
.PHONY: stats tests $(TESTS)
|
|
|
|
stats: $(SOURCES)
|
|
@wc $^
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
|
stats-lisp: $(SOURCES_LISP)
|
|
@wc $^
|
|
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
|
|
|
|
tests: $(TESTS)
|
|
|
|
$(TESTS):
|
|
@echo "Running $@"; \
|
|
./$@ || exit 1; \
|