From 47d93c2fc5653ed9498a21c722b2fd95a4620ff5 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Fri, 2 Oct 2015 15:57:30 +0200 Subject: [PATCH 1/3] Makefile: only build opt version by default; introduce test target --- ml-proto/Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ml-proto/Makefile b/ml-proto/Makefile index 6be1b1734e..e3290386db 100644 --- a/ml-proto/Makefile +++ b/ml-proto/Makefile @@ -5,6 +5,8 @@ # NAME = wasm +NAME_OPT = $(NAME) +NAME_UNOPT = $(NAME).unopt Makefile = Makefile OCB_FLAGS += # -use-ocamlfind @@ -14,12 +16,14 @@ OCB_FLAGS += -libs str,bigarray OCB_FLAGS += -I host -I given -I spec OCB = ocamlbuild $(OCB_FLAGS) -all: $(NAME) unopt +opt: $(NAME_OPT) +unopt: $(NAME_UNOPT) +all: opt unopt test -$(NAME): main.native +$(NAME_OPT): main.native mv $< $@ -unopt: main.d.byte +$(NAME_UNOPT): main.d.byte mv $< $@ main.native: $(MAKEFILE) @@ -28,6 +32,9 @@ main.native: $(MAKEFILE) main.d.byte: $(MAKEFILE) $(OCB) $@ +test: + ./runtests.py + clean: $(OCB) -clean @@ -40,4 +47,4 @@ zip: git archive --format=zip --prefix=$(NAME)/ \ -o $(NAME).zip HEAD -.PHONY: all clean check zip +.PHONY: all opt unopt clean test check zip From 69a3de636248042bee236f37efefb1cfe897f82a Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Fri, 2 Oct 2015 16:10:08 +0200 Subject: [PATCH 2/3] Make main.* .INTERMEDIATE --- ml-proto/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/ml-proto/Makefile b/ml-proto/Makefile index e3290386db..5bc8ecd01c 100644 --- a/ml-proto/Makefile +++ b/ml-proto/Makefile @@ -47,4 +47,5 @@ zip: git archive --format=zip --prefix=$(NAME)/ \ -o $(NAME).zip HEAD +.INTERMEDIATE: main.native main.d.byte .PHONY: all opt unopt clean test check zip From 4554d34c4992515f8f1bff561249dead4de9bddc Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Mon, 5 Oct 2015 15:07:29 +0200 Subject: [PATCH 3/3] Make unopt the default --- ml-proto/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ml-proto/Makefile b/ml-proto/Makefile index 5bc8ecd01c..bdaf8cc189 100644 --- a/ml-proto/Makefile +++ b/ml-proto/Makefile @@ -5,8 +5,8 @@ # NAME = wasm -NAME_OPT = $(NAME) -NAME_UNOPT = $(NAME).unopt +NAME_OPT = $(NAME).opt +NAME_UNOPT = $(NAME) Makefile = Makefile OCB_FLAGS += # -use-ocamlfind @@ -16,8 +16,8 @@ OCB_FLAGS += -libs str,bigarray OCB_FLAGS += -I host -I given -I spec OCB = ocamlbuild $(OCB_FLAGS) -opt: $(NAME_OPT) unopt: $(NAME_UNOPT) +opt: $(NAME_OPT) all: opt unopt test $(NAME_OPT): main.native