From 86fe63145a063886dbb6b201cc809bd555cc944b Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 30 May 2015 02:07:59 +0900 Subject: [PATCH] crystal: fix Makefile to build all steps --- Makefile | 4 ++-- crystal/Makefile | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 crystal/Makefile diff --git a/Makefile b/Makefile index 73a705c8..a94fe878 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ c_STEP_TO_PROG = c/$($(1)) clojure_STEP_TO_PROG = clojure/src/$($(1)).clj coffee_STEP_TO_PROG = coffee/$($(1)).coffee cpp_STEP_TO_PROG = cpp/$($(1)) -crystal_STEP_TO_PROG = crystal/$($(1)).cr +crystal_STEP_TO_PROG = crystal/$($(1)) cs_STEP_TO_PROG = cs/$($(1)).exe erlang_STEP_TO_PROG = erlang/$($(1)) factor_STEP_TO_PROG = factor/src/$($(1))/$($(1)).factor @@ -99,7 +99,7 @@ c_RUNSTEP = ../$(2) $(3) clojure_RUNSTEP = lein with-profile +$(1) trampoline run $(3) coffee_RUNSTEP = coffee ../$(2) $(3) cpp_RUNSTEP = ../$(2) $(3) -crystal_RUNSTEP = crystal run ../$(2) $(3) +crystal_RUNSTEP = ../$(2) $(3) cs_RUNSTEP = mono ../$(2) --raw $(3) erlang_RUNSTEP = ../$(2) $(3) factor_RUNSTEP = factor ../$(2) $(3) diff --git a/crystal/Makefile b/crystal/Makefile new file mode 100644 index 00000000..124fb4ca --- /dev/null +++ b/crystal/Makefile @@ -0,0 +1,26 @@ +STEPS = step0_repl.cr step1_read_print.cr step2_eval.cr step3_env.cr \ + step4_if_fn_do.cr step5_tco.cr step6_file.cr step7_quote.cr \ + step8_macros.cr step9_try.cr stepA_mal.cr + +STEP_BINS = $(STEPS:%.cr=%) +LAST_STEP_BIN = $(word $(words $(STEP_BINS)),$(STEP_BINS)) + +all: $(STEP_BINS) mal + +mal: $(LAST_STEP_BIN) + cp $< $@ + +$(STEP_BINS): %: %.cr $(MAL_LIB) + crystal build --release $< + +clean: + rm -rf $(STEP_BINS) mal .crystal + +stats: $(MODULES) stepA_mal.cr + @wc $^ + +stats-lisp: env.cr core.cr stepA_mal.cr + @wc $^ + +.PHONY: all clean stats stats-lisp +