aboutsummaryrefslogtreecommitdiff
path: root/ocaml/Makefile
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-01-22 15:55:22 -0500
committerChouser <chouser@n01se.net>2015-01-30 12:54:42 -0500
commit81e073cf2044d0e3cfbcc03a81dcba605a945fe5 (patch)
tree3bb06d75003aa9c80c869ee9db354e2910824e37 /ocaml/Makefile
parent921a951fe4d088e60ce25866344bd534420f9ec6 (diff)
downloadmal-81e073cf2044d0e3cfbcc03a81dcba605a945fe5.tar.gz
mal-81e073cf2044d0e3cfbcc03a81dcba605a945fe5.zip
Ocaml: made minor fixes, mostly to Makefile
Diffstat (limited to 'ocaml/Makefile')
-rw-r--r--ocaml/Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/ocaml/Makefile b/ocaml/Makefile
index a526ecf..c905b2e 100644
--- a/ocaml/Makefile
+++ b/ocaml/Makefile
@@ -2,18 +2,20 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml
MODULES = types.ml reader.ml printer.ml
LIBS = str.cma
-BINS = $(STEPS:%.ml=%)
+STEP_BINS = $(STEPS:%.ml=%)
+LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS))
+MODULE_BINS = $(MODULES:%.ml=%.cmo)
-all: $(BINS) mal
+all: $(STEP_BINS) mal
-mal: $(word $(words $(BINS)),$(BINS))
+mal: $(LAST_STEP_BIN)
cp $< $@
repl: $(MODULES)
- rlwrap ocaml $(LIBS) $(MODULES:%.ml=%.cmo)
+ rlwrap ocaml $(LIBS) $(MODULE_BINS)
-$(BINS): %: %.ml $(MODULES)
+$(STEP_BINS): %: %.ml $(MODULES)
ocamlc $(LIBS) $(MODULES) $< -o $@
clean:
- rm -f $(BINS) mal *.cmi *.cmo
+ rm -f $(STEP_BINS) mal *.cmi *.cmo