2015-01-24 04:05:03 +03:00
|
|
|
STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \
|
2014-01-30 05:05:05 +04:00
|
|
|
step4_if_fn_do.ml step5_tco.ml step6_file.ml step7_quote.ml \
|
2015-01-30 08:17:57 +03:00
|
|
|
step8_macros.ml step9_try.ml stepA_interop.ml
|
2015-01-24 04:05:03 +03:00
|
|
|
MODULES = types.ml reader.ml printer.ml env.ml core.ml
|
2015-01-30 20:38:32 +03:00
|
|
|
LIBS = str.cmxa unix.cmxa
|
2015-01-24 00:55:06 +03:00
|
|
|
MAL_LIB = mal_lib.cmxa
|
2015-01-22 10:59:48 +03:00
|
|
|
|
2015-01-22 23:55:22 +03:00
|
|
|
STEP_BINS = $(STEPS:%.ml=%)
|
|
|
|
LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS))
|
2015-01-22 10:59:48 +03:00
|
|
|
|
2015-01-22 23:55:22 +03:00
|
|
|
all: $(STEP_BINS) mal
|
2015-01-22 10:59:48 +03:00
|
|
|
|
2015-01-22 23:55:22 +03:00
|
|
|
mal: $(LAST_STEP_BIN)
|
2015-01-22 10:59:48 +03:00
|
|
|
cp $< $@
|
|
|
|
|
2015-01-24 00:55:06 +03:00
|
|
|
# ocaml repl apparently needs bytecode, not native, compilation.
|
|
|
|
# Just do it all right here:
|
|
|
|
repl:
|
|
|
|
ocamlc -c $(LIBS:%.cmxa=%.cma) $(MODULES) $(STEPS)
|
|
|
|
rlwrap ocaml $(LIBS:%.cmxa=%.cma) $(MODULES:%.ml=%.cmo)
|
2015-01-22 10:59:48 +03:00
|
|
|
|
2015-01-24 00:55:06 +03:00
|
|
|
$(MAL_LIB): $(MODULES)
|
|
|
|
ocamlopt -a $(MODULES) -o $@
|
|
|
|
|
|
|
|
$(STEP_BINS): %: %.ml $(MAL_LIB)
|
|
|
|
ocamlopt $(LIBS) $(MAL_LIB) $< -o $@
|
2015-01-22 10:59:48 +03:00
|
|
|
|
|
|
|
clean:
|
2015-01-24 00:55:06 +03:00
|
|
|
rm -f $(STEP_BINS) mal mal_lib.* *.cmo *.cmx *.cmi *.o
|
|
|
|
|
2015-01-30 22:26:00 +03:00
|
|
|
stats: $(MODULES) stepA_interop.ml
|
|
|
|
@wc $^
|
|
|
|
|
|
|
|
stats-lisp: env.ml core.ml stepA_interop.ml
|
|
|
|
@wc $^
|
|
|
|
|
|
|
|
.PHONY: all repl clean stats stats-lisp
|