From 59d10e1bd703f65e12fef85bceef4204f82685fb Mon Sep 17 00:00:00 2001 From: Chouser Date: Thu, 22 Jan 2015 02:59:48 -0500 Subject: Ocaml: Added step 1, missing some optional functionality --- ocaml/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ocaml/Makefile (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile new file mode 100644 index 0000000..a46b82a --- /dev/null +++ b/ocaml/Makefile @@ -0,0 +1,16 @@ +STEPS = step0_repl.ml step1_read_print.ml +MODULES = types.ml reader.ml printer.ml +LIBS = str.cma + +BINS = $(STEPS:%.ml=%) + +all: $(BINS) mal oc + +mal: $(word $(words $(BINS)),$(BINS)) + cp $< $@ + +$(BINS): %: %.ml $(MODULES) + ocamlc $(LIBS) $(MODULES) $< -o $@ + +clean: + rm -f $(BINS) mal *.cmi *.cmo -- cgit v1.2.3 From 921a951fe4d088e60ce25866344bd534420f9ec6 Mon Sep 17 00:00:00 2001 From: Chouser Date: Thu, 22 Jan 2015 02:59:48 -0500 Subject: Ocaml: Add step 2, nothing optional --- ocaml/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index a46b82a..a526ecf 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,14 +1,17 @@ -STEPS = step0_repl.ml step1_read_print.ml +STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml MODULES = types.ml reader.ml printer.ml LIBS = str.cma BINS = $(STEPS:%.ml=%) -all: $(BINS) mal oc +all: $(BINS) mal mal: $(word $(words $(BINS)),$(BINS)) cp $< $@ +repl: $(MODULES) + rlwrap ocaml $(LIBS) $(MODULES:%.ml=%.cmo) + $(BINS): %: %.ml $(MODULES) ocamlc $(LIBS) $(MODULES) $< -o $@ -- cgit v1.2.3 From 81e073cf2044d0e3cfbcc03a81dcba605a945fe5 Mon Sep 17 00:00:00 2001 From: Chouser Date: Thu, 22 Jan 2015 15:55:22 -0500 Subject: Ocaml: made minor fixes, mostly to Makefile --- ocaml/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ocaml/Makefile') 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 -- cgit v1.2.3 From 67736cf90b4f977b4b3ca3801e079040fc9fc0c9 Mon Sep 17 00:00:00 2001 From: Chouser Date: Fri, 23 Jan 2015 08:17:35 -0500 Subject: Ocaml: Add step 3 --- ocaml/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index c905b2e..f7df3a7 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,5 +1,5 @@ -STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml -MODULES = types.ml reader.ml printer.ml +STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml +MODULES = types.ml reader.ml printer.ml env.ml LIBS = str.cma STEP_BINS = $(STEPS:%.ml=%) -- cgit v1.2.3 From 79ba3d608878cf99d4a61960ae0a29e2e4a96745 Mon Sep 17 00:00:00 2001 From: Chouser Date: Fri, 23 Jan 2015 16:55:06 -0500 Subject: Ocaml: Finally fix race conditions in compilation Also, use native compilation for everything except Ocaml REPL. --- ocaml/Makefile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index f7df3a7..5e8b62a 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,21 +1,29 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml MODULES = types.ml reader.ml printer.ml env.ml -LIBS = str.cma +LIBS = str.cmxa +MAL_LIB = mal_lib.cmxa STEP_BINS = $(STEPS:%.ml=%) LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS)) -MODULE_BINS = $(MODULES:%.ml=%.cmo) all: $(STEP_BINS) mal mal: $(LAST_STEP_BIN) cp $< $@ -repl: $(MODULES) - rlwrap ocaml $(LIBS) $(MODULE_BINS) +# 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) -$(STEP_BINS): %: %.ml $(MODULES) - ocamlc $(LIBS) $(MODULES) $< -o $@ +$(MAL_LIB): $(MODULES) + ocamlopt -a $(MODULES) -o $@ + +$(STEP_BINS): %: %.ml $(MAL_LIB) + ocamlopt $(LIBS) $(MAL_LIB) $< -o $@ clean: - rm -f $(STEP_BINS) mal *.cmi *.cmo + rm -f $(STEP_BINS) mal mal_lib.* *.cmo *.cmx *.cmi *.o + +.PHONY: all repl clean -- cgit v1.2.3 From de04357cd5f2954e2d682abb97ca2b3b90ea75d1 Mon Sep 17 00:00:00 2001 From: Chouser Date: Fri, 23 Jan 2015 20:05:03 -0500 Subject: Ocaml: Add string functions --- ocaml/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index 5e8b62a..bad3f60 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,5 +1,6 @@ -STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml -MODULES = types.ml reader.ml printer.ml env.ml +STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ + step4_if_fn_do.ml +MODULES = types.ml reader.ml printer.ml env.ml core.ml LIBS = str.cmxa MAL_LIB = mal_lib.cmxa -- cgit v1.2.3 From 44d4e31fc8387a52918992ed40bd4b20d7646f39 Mon Sep 17 00:00:00 2001 From: Chouser Date: Tue, 27 Jan 2015 11:30:05 -0500 Subject: Ocaml: Add step 5, TCO worked automatically in Ocaml --- ocaml/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index bad3f60..299b2c4 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,5 +1,5 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ - step4_if_fn_do.ml + step4_if_fn_do.ml step5_tco.ml MODULES = types.ml reader.ml printer.ml env.ml core.ml LIBS = str.cmxa MAL_LIB = mal_lib.cmxa -- cgit v1.2.3 From 776cf577064c2676e33987546f10c2be80b26344 Mon Sep 17 00:00:00 2001 From: Chouser Date: Wed, 28 Jan 2015 13:13:44 -0500 Subject: Ocaml: Finish adding step 6 --- ocaml/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index 299b2c4..ced6df4 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,5 +1,5 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ - step4_if_fn_do.ml step5_tco.ml + step4_if_fn_do.ml step5_tco.ml step6_file.ml MODULES = types.ml reader.ml printer.ml env.ml core.ml LIBS = str.cmxa MAL_LIB = mal_lib.cmxa -- cgit v1.2.3 From efb850b5d5f8072c95fd0dc67383ffa308504f7b Mon Sep 17 00:00:00 2001 From: Chouser Date: Wed, 28 Jan 2015 23:43:21 -0500 Subject: Ocaml: Add step 7 --- ocaml/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index ced6df4..be51a88 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,5 +1,5 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ - step4_if_fn_do.ml step5_tco.ml step6_file.ml + step4_if_fn_do.ml step5_tco.ml step6_file.ml step7_quote.ml MODULES = types.ml reader.ml printer.ml env.ml core.ml LIBS = str.cmxa MAL_LIB = mal_lib.cmxa -- cgit v1.2.3 From fb21afa71b4f73fa9c05c47e6b1c0f45d2144069 Mon Sep 17 00:00:00 2001 From: Chouser Date: Wed, 29 Jan 2014 20:05:05 -0500 Subject: OCaml: Add Step 8 --- ocaml/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index be51a88..b52c69b 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,5 +1,6 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ - step4_if_fn_do.ml step5_tco.ml step6_file.ml step7_quote.ml + step4_if_fn_do.ml step5_tco.ml step6_file.ml step7_quote.ml \ + step8_macros.ml MODULES = types.ml reader.ml printer.ml env.ml core.ml LIBS = str.cmxa MAL_LIB = mal_lib.cmxa -- cgit v1.2.3 From ecd3b6d8e551dd87934142b0323d9b75134bbea9 Mon Sep 17 00:00:00 2001 From: Chouser Date: Thu, 29 Jan 2015 23:29:54 -0500 Subject: OCaml: Add step 9 --- ocaml/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index b52c69b..a7c78fd 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,6 +1,6 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ step4_if_fn_do.ml step5_tco.ml step6_file.ml step7_quote.ml \ - step8_macros.ml + step8_macros.ml step9_try.ml MODULES = types.ml reader.ml printer.ml env.ml core.ml LIBS = str.cmxa MAL_LIB = mal_lib.cmxa -- cgit v1.2.3 From fd3adc525489857e2db66fd905e829d38364f777 Mon Sep 17 00:00:00 2001 From: Chouser Date: Fri, 30 Jan 2015 00:17:57 -0500 Subject: OCaml: self-hosting --- ocaml/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index a7c78fd..e5b0ac2 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,6 +1,6 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ step4_if_fn_do.ml step5_tco.ml step6_file.ml step7_quote.ml \ - step8_macros.ml step9_try.ml + step8_macros.ml step9_try.ml stepA_interop.ml MODULES = types.ml reader.ml printer.ml env.ml core.ml LIBS = str.cmxa MAL_LIB = mal_lib.cmxa -- cgit v1.2.3 From f5fc0c98ee9c140077469146bbc9d8a77fdb02f3 Mon Sep 17 00:00:00 2001 From: Chouser Date: Fri, 30 Jan 2015 12:38:32 -0500 Subject: OCaml: Add time-ms --- ocaml/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ocaml/Makefile') diff --git a/ocaml/Makefile b/ocaml/Makefile index e5b0ac2..72d159a 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -2,7 +2,7 @@ STEPS = step0_repl.ml step1_read_print.ml step2_eval.ml step3_env.ml \ step4_if_fn_do.ml step5_tco.ml step6_file.ml step7_quote.ml \ step8_macros.ml step9_try.ml stepA_interop.ml MODULES = types.ml reader.ml printer.ml env.ml core.ml -LIBS = str.cmxa +LIBS = str.cmxa unix.cmxa MAL_LIB = mal_lib.cmxa STEP_BINS = $(STEPS:%.ml=%) -- cgit v1.2.3