2014-03-25 01:32:24 +04:00
|
|
|
#
|
|
|
|
# Command line settings
|
|
|
|
#
|
|
|
|
|
|
|
|
MAL_IMPL = js
|
|
|
|
|
2014-04-17 07:42:17 +04:00
|
|
|
PYTHON = python
|
2015-12-31 22:43:55 +03:00
|
|
|
USE_MATLAB =
|
2014-04-17 07:42:17 +04:00
|
|
|
|
2015-10-09 19:14:51 +03:00
|
|
|
# Extra options to pass to runtest.py
|
|
|
|
TEST_OPTS =
|
|
|
|
|
2015-12-19 02:24:02 +03:00
|
|
|
# Test with previous test files not just the test files for the
|
|
|
|
# current step. Step 0 and 1 tests are special and not included in
|
|
|
|
# later steps.
|
|
|
|
REGRESS=
|
|
|
|
|
2015-10-09 19:14:51 +03:00
|
|
|
# Extra implementation specific options to pass to runtest.py
|
|
|
|
mal_TEST_OPTS = --start-timeout 60 --test-timeout 120
|
|
|
|
|
2014-03-25 01:32:24 +04:00
|
|
|
#
|
|
|
|
# Settings
|
|
|
|
#
|
|
|
|
|
2015-11-17 06:17:13 +03:00
|
|
|
IMPLS = awk bash c d clojure coffee cpp crystal cs erlang elixir es6 factor forth fsharp go groovy \
|
2015-10-27 07:14:04 +03:00
|
|
|
guile haskell java julia js kotlin lua make mal ocaml matlab miniMAL nim \
|
2015-07-09 18:14:16 +03:00
|
|
|
perl php ps python r racket rpython ruby rust scala swift tcl vb vimscript
|
2014-03-25 01:32:24 +04:00
|
|
|
|
|
|
|
step0 = step0_repl
|
|
|
|
step1 = step1_read_print
|
|
|
|
step2 = step2_eval
|
|
|
|
step3 = step3_env
|
|
|
|
step4 = step4_if_fn_do
|
|
|
|
step5 = step5_tco
|
|
|
|
step6 = step6_file
|
|
|
|
step7 = step7_quote
|
|
|
|
step8 = step8_macros
|
2014-10-10 08:48:47 +04:00
|
|
|
step9 = step9_try
|
2015-02-28 20:09:54 +03:00
|
|
|
stepA = stepA_mal
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2015-12-19 02:24:02 +03:00
|
|
|
regress_step0 = step0
|
|
|
|
regress_step1 = step1
|
|
|
|
regress_step2 = step2
|
|
|
|
regress_step3 = $(regress_step2) step3
|
|
|
|
regress_step4 = $(regress_step3) step4
|
|
|
|
regress_step5 = $(regress_step4) step5
|
|
|
|
regress_step6 = $(regress_step5) step6
|
|
|
|
regress_step7 = $(regress_step6) step7
|
|
|
|
regress_step8 = $(regress_step7) step8
|
|
|
|
regress_step9 = $(regress_step8) step9
|
|
|
|
regress_stepA = $(regress_step9) stepA
|
|
|
|
|
|
|
|
STEP5_EXCLUDES += awk # completes at 10,000
|
|
|
|
STEP5_EXCLUDES += bash # no stack exhaustion or completion
|
|
|
|
STEP5_EXCLUDES += c # segfault
|
|
|
|
STEP5_EXCLUDES += cpp # completes at 10,000
|
|
|
|
STEP5_EXCLUDES += cs # fatal stack overflow fault
|
|
|
|
STEP5_EXCLUDES += d # completes at 10,000, fatal stack overflow at 1,000,000
|
|
|
|
STEP5_EXCLUDES += erlang # erlang is TCO, test passes
|
|
|
|
STEP5_EXCLUDES += elixir # elixir is TCO, test passes
|
|
|
|
STEP5_EXCLUDES += fsharp # completes at 10,000, fatal stack overflow at 100,000
|
|
|
|
STEP5_EXCLUDES += haskell # test completes
|
|
|
|
STEP5_EXCLUDES += make # no TCO capability/step
|
|
|
|
STEP5_EXCLUDES += mal # no TCO capability/step
|
2015-12-31 22:43:55 +03:00
|
|
|
STEP5_EXCLUDES += matlab # too slow to complete 10,000
|
2015-12-19 02:24:02 +03:00
|
|
|
STEP5_EXCLUDES += miniMAL # strange error with runtest.py
|
|
|
|
STEP5_EXCLUDES += nim # test completes, even at 100,000
|
|
|
|
STEP5_EXCLUDES += go # test completes, even at 100,000
|
|
|
|
STEP5_EXCLUDES += php # test completes, even at 100,000
|
|
|
|
STEP5_EXCLUDES += racket # test completes
|
|
|
|
STEP5_EXCLUDES += ruby # test completes, even at 100,000
|
|
|
|
STEP5_EXCLUDES += rust # no catching stack overflows
|
|
|
|
STEP5_EXCLUDES += ocaml # test completes, even at 1,000,000
|
|
|
|
STEP5_EXCLUDES += vb # completes at 10,000
|
|
|
|
STEP5_EXCLUDES += crystal # test completes, even at 1,000,000
|
|
|
|
|
|
|
|
PERF_EXCLUDES = mal # TODO: fix this
|
2014-03-25 01:32:24 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Utility functions
|
|
|
|
#
|
|
|
|
|
2015-12-31 22:43:55 +03:00
|
|
|
MATLAB = matlab -nodisplay -nosplash -nodesktop -nojvm -r
|
|
|
|
OCTAVE = octave --no-gui -q --traditional --eval
|
|
|
|
matlab_args = $(subst $(SPACE),$(COMMA),$(foreach x,$(strip $(1)),'$(x)'))
|
|
|
|
matlab_cmd = $(if $(strip $(USE_MATLAB)),$(MATLAB),$(OCTAVE))
|
|
|
|
|
2015-12-19 02:24:02 +03:00
|
|
|
# Return list of test files for a given step. If REGRESS is set then
|
|
|
|
# test files will include step 2 tests through tests for the step
|
|
|
|
# being tested.
|
|
|
|
STEP_TEST_FILES = $(strip $(wildcard \
|
|
|
|
$(foreach s,$(if $(strip $(REGRESS)),$(regress_$(2)),$(2)),\
|
|
|
|
$(1)/tests/$($(s)).mal tests/$($(s)).mal)))
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2015-12-19 02:24:02 +03:00
|
|
|
# Map of step (e.g. "step8") to executable file for that step
|
2015-08-26 04:13:25 +03:00
|
|
|
awk_STEP_TO_PROG = awk/$($(1)).awk
|
2014-04-18 06:49:07 +04:00
|
|
|
bash_STEP_TO_PROG = bash/$($(1)).sh
|
|
|
|
c_STEP_TO_PROG = c/$($(1))
|
2015-11-17 06:17:13 +03:00
|
|
|
d_STEP_TO_PROG = d/$($(1))
|
2014-03-25 01:32:24 +04:00
|
|
|
clojure_STEP_TO_PROG = clojure/src/$($(1)).clj
|
2014-11-09 01:56:36 +03:00
|
|
|
coffee_STEP_TO_PROG = coffee/$($(1)).coffee
|
2015-03-26 14:08:35 +03:00
|
|
|
cpp_STEP_TO_PROG = cpp/$($(1))
|
2015-05-29 20:07:59 +03:00
|
|
|
crystal_STEP_TO_PROG = crystal/$($(1))
|
2014-04-18 06:49:07 +04:00
|
|
|
cs_STEP_TO_PROG = cs/$($(1)).exe
|
2015-08-29 01:15:46 +03:00
|
|
|
elixir_STEP_TO_PROG = elixir/lib/mix/tasks/$($(1)).ex
|
2015-03-15 17:13:47 +03:00
|
|
|
erlang_STEP_TO_PROG = erlang/$($(1))
|
2015-07-31 05:15:55 +03:00
|
|
|
es6_STEP_TO_PROG = es6/build/$($(1)).js
|
2015-10-29 02:16:43 +03:00
|
|
|
factor_STEP_TO_PROG = factor/$($(1))/$($(1)).factor
|
2015-02-06 08:38:34 +03:00
|
|
|
forth_STEP_TO_PROG = forth/$($(1)).fs
|
2015-02-22 06:43:40 +03:00
|
|
|
fsharp_STEP_TO_PROG = fsharp/$($(1)).exe
|
2014-10-05 03:34:26 +04:00
|
|
|
go_STEP_TO_PROG = go/$($(1))
|
2015-05-19 05:54:18 +03:00
|
|
|
groovy_STEP_TO_PROG = groovy/$($(1)).groovy
|
2014-04-18 06:49:07 +04:00
|
|
|
java_STEP_TO_PROG = java/src/main/java/mal/$($(1)).java
|
2014-12-24 06:35:48 +03:00
|
|
|
haskell_STEP_TO_PROG = haskell/$($(1))
|
2015-03-29 01:44:31 +03:00
|
|
|
julia_STEP_TO_PROG = julia/$($(1)).jl
|
2014-04-18 06:49:07 +04:00
|
|
|
js_STEP_TO_PROG = js/$($(1)).js
|
2015-10-25 06:10:53 +03:00
|
|
|
kotlin_STEP_TO_PROG = kotlin/$($(1)).jar
|
2015-01-09 08:25:40 +03:00
|
|
|
lua_STEP_TO_PROG = lua/$($(1)).lua
|
2014-04-18 06:49:07 +04:00
|
|
|
make_STEP_TO_PROG = make/$($(1)).mk
|
|
|
|
mal_STEP_TO_PROG = mal/$($(1)).mal
|
2015-01-22 10:59:48 +03:00
|
|
|
ocaml_STEP_TO_PROG = ocaml/$($(1))
|
2015-02-08 05:32:06 +03:00
|
|
|
matlab_STEP_TO_PROG = matlab/$($(1)).m
|
2015-02-12 06:56:47 +03:00
|
|
|
miniMAL_STEP_TO_PROG = miniMAL/$($(1)).json
|
2015-03-15 01:14:32 +03:00
|
|
|
nim_STEP_TO_PROG = nim/$($(1))
|
2014-04-20 00:12:13 +04:00
|
|
|
perl_STEP_TO_PROG = perl/$($(1)).pl
|
2014-04-18 06:49:07 +04:00
|
|
|
php_STEP_TO_PROG = php/$($(1)).php
|
|
|
|
ps_STEP_TO_PROG = ps/$($(1)).ps
|
|
|
|
python_STEP_TO_PROG = python/$($(1)).py
|
2014-11-01 23:54:48 +03:00
|
|
|
r_STEP_TO_PROG = r/$($(1)).r
|
2015-01-03 08:20:00 +03:00
|
|
|
racket_STEP_TO_PROG = racket/$($(1)).rkt
|
2015-06-03 07:58:23 +03:00
|
|
|
rpython_STEP_TO_PROG = rpython/$($(1))
|
2014-04-18 06:49:07 +04:00
|
|
|
ruby_STEP_TO_PROG = ruby/$($(1)).rb
|
2015-03-04 20:25:21 +03:00
|
|
|
rust_STEP_TO_PROG = rust/target/release/$($(1))
|
2014-12-19 08:21:39 +03:00
|
|
|
scala_STEP_TO_PROG = scala/$($(1)).scala
|
2015-03-18 09:32:35 +03:00
|
|
|
swift_STEP_TO_PROG = swift/$($(1))
|
2015-07-09 18:14:16 +03:00
|
|
|
tcl_STEP_TO_PROG = tcl/$($(1)).tcl
|
2014-11-16 08:15:09 +03:00
|
|
|
vb_STEP_TO_PROG = vb/$($(1)).exe
|
2015-10-20 22:02:00 +03:00
|
|
|
vimscript_STEP_TO_PROG = vimscript/$($(1)).vim
|
2015-03-19 11:18:37 +03:00
|
|
|
guile_STEP_TO_PROG = guile/$($(1)).scm
|
2014-04-18 06:49:07 +04:00
|
|
|
|
2015-12-19 02:24:02 +03:00
|
|
|
|
2015-02-09 05:35:44 +03:00
|
|
|
# Needed some argument munging
|
|
|
|
COMMA = ,
|
|
|
|
noop =
|
|
|
|
SPACE = $(noop) $(noop)
|
2015-10-29 18:27:24 +03:00
|
|
|
export FACTOR_ROOTS := .
|
2014-04-18 06:49:07 +04:00
|
|
|
|
2015-12-19 02:24:02 +03:00
|
|
|
# Macro for running a step:
|
|
|
|
# $(1): step (e.g. "stepA")
|
|
|
|
# $(2): program for step (e.g. result of *_STEP_TO_PROG
|
|
|
|
# $(3): program arguments
|
2015-08-26 04:13:25 +03:00
|
|
|
awk_RUNSTEP = awk -O -f ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
bash_RUNSTEP = bash ../$(2) $(3)
|
|
|
|
c_RUNSTEP = ../$(2) $(3)
|
2015-11-17 06:17:13 +03:00
|
|
|
d_RUNSTEP = ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
clojure_RUNSTEP = lein with-profile +$(1) trampoline run $(3)
|
2014-11-09 01:56:36 +03:00
|
|
|
coffee_RUNSTEP = coffee ../$(2) $(3)
|
2015-03-26 14:08:35 +03:00
|
|
|
cpp_RUNSTEP = ../$(2) $(3)
|
2015-05-29 20:07:59 +03:00
|
|
|
crystal_RUNSTEP = ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
cs_RUNSTEP = mono ../$(2) --raw $(3)
|
2015-09-10 23:10:40 +03:00
|
|
|
elixir_RUNSTEP = mix $(notdir $(basename $(2))) $(3)
|
2015-03-15 17:13:47 +03:00
|
|
|
erlang_RUNSTEP = ../$(2) $(3)
|
2015-07-31 05:15:55 +03:00
|
|
|
es6_RUNSTEP = node ../$(2) $(3)
|
2015-03-09 22:11:50 +03:00
|
|
|
factor_RUNSTEP = factor ../$(2) $(3)
|
2015-02-06 08:38:34 +03:00
|
|
|
forth_RUNSTEP = gforth ../$(2) $(3)
|
2015-02-22 06:43:40 +03:00
|
|
|
fsharp_RUNSTEP = mono ../$(2) --raw $(3)
|
2014-10-05 03:34:26 +04:00
|
|
|
go_RUNSTEP = ../$(2) $(3)
|
2015-05-19 05:54:18 +03:00
|
|
|
groovy_RUNSTEP = groovy ../$(2) $(3)
|
2014-12-24 06:35:48 +03:00
|
|
|
haskell_RUNSTEP = ../$(2) $(3)
|
2015-03-18 17:01:01 +03:00
|
|
|
java_RUNSTEP = mvn -quiet exec:java -Dexec.mainClass="mal.$($(1))" $(if $(3), -Dexec.args="$(3)",)
|
2015-03-29 01:44:31 +03:00
|
|
|
julia_RUNSTEP = ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
js_RUNSTEP = node ../$(2) $(3)
|
2015-10-25 06:10:53 +03:00
|
|
|
kotlin_RUNSTEP = java -jar ../$(2) $(3)
|
2015-03-18 17:01:01 +03:00
|
|
|
lua_RUNSTEP = ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
make_RUNSTEP = make -f ../$(2) $(3)
|
2015-10-12 06:10:59 +03:00
|
|
|
mal_RUNSTEP = $(call $(MAL_IMPL)_RUNSTEP,stepA,$(call $(MAL_IMPL)_STEP_TO_PROG,stepA),../$(2),") #"
|
2015-01-22 10:59:48 +03:00
|
|
|
ocaml_RUNSTEP = ../$(2) $(3)
|
2015-12-31 22:43:55 +03:00
|
|
|
matlab_RUNSTEP = $(matlab_cmd) "$($(1))($(call matlab_args,$(3)));quit;"
|
2015-02-12 06:56:47 +03:00
|
|
|
miniMAL_RUNSTEP = miniMAL ../$(2) $(3)
|
2015-03-15 01:14:32 +03:00
|
|
|
nim_RUNSTEP = ../$(2) $(3)
|
2015-03-19 16:00:28 +03:00
|
|
|
perl_RUNSTEP = perl ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
php_RUNSTEP = php ../$(2) $(3)
|
2015-10-13 06:14:45 +03:00
|
|
|
ps_RUNSTEP = gs -q -I./ -dNODISPLAY -- ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
python_RUNSTEP = $(PYTHON) ../$(2) $(3)
|
2014-11-01 23:54:48 +03:00
|
|
|
r_RUNSTEP = Rscript ../$(2) $(3)
|
2015-01-03 08:20:00 +03:00
|
|
|
racket_RUNSTEP = ../$(2) $(3)
|
2015-06-03 07:58:23 +03:00
|
|
|
rpython_RUNSTEP = ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
ruby_RUNSTEP = ruby ../$(2) $(3)
|
2014-10-25 20:42:07 +04:00
|
|
|
rust_RUNSTEP = ../$(2) $(3)
|
2014-12-19 08:21:39 +03:00
|
|
|
scala_RUNSTEP = sbt 'run-main $($(1))$(if $(3), $(3),)'
|
2015-03-18 09:32:35 +03:00
|
|
|
swift_RUNSTEP = ../$(2) $(3)
|
2015-11-10 21:11:49 +03:00
|
|
|
tcl_RUNSTEP = tclsh ../$(2) --raw $(3)
|
2014-11-16 08:15:09 +03:00
|
|
|
vb_RUNSTEP = mono ../$(2) --raw $(3)
|
2015-10-20 22:02:00 +03:00
|
|
|
vimscript_RUNSTEP = ./run_vimscript.sh ../$(2) $(3)
|
2015-03-19 11:18:37 +03:00
|
|
|
# needs TERM=dumb to work with readline
|
2015-10-09 19:14:51 +03:00
|
|
|
guile_RUNSTEP = guile --no-auto-compile -L ../guile ../$(2) $(3)
|
2014-04-18 06:49:07 +04:00
|
|
|
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2015-10-20 22:02:00 +03:00
|
|
|
vimscript_TEST_OPTS = --test-timeout 30
|
|
|
|
ifeq ($(MAL_IMPL),vimscript)
|
|
|
|
mal_TEST_OPTS = --start-timeout 60 --test-timeout 180
|
|
|
|
endif
|
2014-03-25 01:32:24 +04:00
|
|
|
|
|
|
|
# Derived lists
|
|
|
|
STEPS = $(sort $(filter step%,$(.VARIABLES)))
|
2015-03-12 06:08:21 +03:00
|
|
|
DO_IMPLS = $(filter-out $(SKIP_IMPLS),$(IMPLS))
|
|
|
|
IMPL_TESTS = $(foreach impl,$(DO_IMPLS),test^$(impl))
|
2014-03-25 01:32:24 +04:00
|
|
|
STEP_TESTS = $(foreach step,$(STEPS),test^$(step))
|
2015-12-19 02:24:02 +03:00
|
|
|
ALL_TESTS = $(filter-out $(foreach impl,$(STEP5_EXCLUDES),test^$(impl)^step5),\
|
2014-03-25 01:32:24 +04:00
|
|
|
$(strip $(sort \
|
2015-03-12 06:08:21 +03:00
|
|
|
$(foreach impl,$(DO_IMPLS),\
|
2014-03-25 01:32:24 +04:00
|
|
|
$(foreach step,$(STEPS),test^$(impl)^$(step))))))
|
|
|
|
|
2015-03-12 06:08:21 +03:00
|
|
|
IMPL_STATS = $(foreach impl,$(DO_IMPLS),stats^$(impl))
|
|
|
|
IMPL_STATS_LISP = $(foreach impl,$(DO_IMPLS),stats-lisp^$(impl))
|
2014-03-25 01:32:24 +04:00
|
|
|
|
2015-10-06 00:46:21 +03:00
|
|
|
DOCKER_BUILD = $(foreach impl,$(DO_IMPLS),docker-build^$(impl))
|
|
|
|
|
2015-12-19 02:24:02 +03:00
|
|
|
IMPL_PERF = $(foreach impl,$(filter-out $(PERF_EXCLUDES),$(DO_IMPLS)),perf^$(impl))
|
2014-04-18 06:49:07 +04:00
|
|
|
|
2015-12-14 16:50:27 +03:00
|
|
|
IMPL_REPL = $(foreach impl,$(DO_IMPLS),repl^$(impl))
|
|
|
|
ALL_REPL = $(strip $(sort \
|
|
|
|
$(foreach impl,$(DO_IMPLS),\
|
|
|
|
$(foreach step,$(STEPS),repl^$(impl)^$(step)))))
|
|
|
|
|
2014-03-25 01:32:24 +04:00
|
|
|
#
|
|
|
|
# Build rules
|
|
|
|
#
|
|
|
|
|
2015-06-16 18:23:12 +03:00
|
|
|
# Build a program in an implementation directory
|
2015-11-19 01:32:53 +03:00
|
|
|
# Make sure we always try and build first because the dependencies are
|
|
|
|
# encoded in the implementation Makefile not here
|
|
|
|
.PHONY: $(foreach i,$(DO_IMPLS),$(foreach s,$(STEPS),$(call $(i)_STEP_TO_PROG,$(s))))
|
2015-06-16 18:23:12 +03:00
|
|
|
$(foreach i,$(DO_IMPLS),$(foreach s,$(STEPS),$(call $(i)_STEP_TO_PROG,$(s)))):
|
2015-11-19 01:32:53 +03:00
|
|
|
$(foreach impl,$(word 1,$(subst /, ,$(@))),\
|
|
|
|
$(MAKE) -C $(impl) $(subst $(impl)/,,$(@)))
|
2015-03-26 14:08:35 +03:00
|
|
|
|
2014-03-25 01:32:24 +04:00
|
|
|
# Allow test, test^STEP, test^IMPL, and test^IMPL^STEP
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(IMPL_TESTS): $$(filter $$@^%,$$(ALL_TESTS))
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(STEP_TESTS): $$(foreach step,$$(subst test^,,$$@),$$(filter %^$$(step),$$(ALL_TESTS)))
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(ALL_TESTS): $$(call $$(word 2,$$(subst ^, ,$$(@)))_STEP_TO_PROG,$$(word 3,$$(subst ^, ,$$(@))))
|
|
|
|
@$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
|
|
|
|
$(foreach step,$(word 3,$(subst ^, ,$(@))),\
|
|
|
|
cd $(if $(filter mal,$(impl)),$(MAL_IMPL),$(impl)); \
|
|
|
|
$(foreach test,$(call STEP_TEST_FILES,$(impl),$(step)),\
|
|
|
|
echo '----------------------------------------------'; \
|
|
|
|
echo 'Testing $@, step file: $+, test file: $(test)'; \
|
2015-10-08 05:46:12 +03:00
|
|
|
echo 'Running: ../runtest.py $(TEST_OPTS) $(call $(impl)_TEST_OPTS) ../$(test) -- $(call $(impl)_RUNSTEP,$(step),$(+))'; \
|
|
|
|
../runtest.py $(TEST_OPTS) $(call $(impl)_TEST_OPTS) ../$(test) -- $(call $(impl)_RUNSTEP,$(step),$(+));)))
|
2014-03-25 01:32:24 +04:00
|
|
|
|
|
|
|
test: $(ALL_TESTS)
|
|
|
|
tests: $(ALL_TESTS)
|
|
|
|
|
|
|
|
|
|
|
|
# Stats rules
|
|
|
|
|
2014-04-18 06:49:07 +04:00
|
|
|
stats: $(IMPL_STATS)
|
|
|
|
stats-lisp: $(IMPL_STATS_LISP)
|
|
|
|
|
2014-03-25 01:32:24 +04:00
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(IMPL_STATS):
|
|
|
|
@echo "----------------------------------------------"; \
|
|
|
|
$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
|
|
|
|
echo "Stats for $(impl):"; \
|
|
|
|
$(MAKE) --no-print-directory -C $(impl) stats)
|
|
|
|
|
2014-04-11 04:27:42 +04:00
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(IMPL_STATS_LISP):
|
|
|
|
@echo "----------------------------------------------"; \
|
|
|
|
$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
|
|
|
|
echo "Stats (lisp only) for $(impl):"; \
|
|
|
|
$(MAKE) --no-print-directory -C $(impl) stats-lisp)
|
|
|
|
|
2015-10-06 00:46:21 +03:00
|
|
|
# Docker build rules
|
|
|
|
|
|
|
|
docker-build: $(DOCKER_BUILD)
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(DOCKER_BUILD):
|
|
|
|
echo "----------------------------------------------"; \
|
|
|
|
$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
|
2015-10-06 01:23:21 +03:00
|
|
|
echo "Running: docker build -t kanaka/mal-test-$(impl) .:"; \
|
|
|
|
cd $(impl) && docker build -t kanaka/mal-test-$(impl) .)
|
2014-04-18 06:49:07 +04:00
|
|
|
|
|
|
|
# Performance test rules
|
|
|
|
|
|
|
|
perf: $(IMPL_PERF)
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(IMPL_PERF):
|
|
|
|
@echo "----------------------------------------------"; \
|
|
|
|
$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
|
|
|
|
cd $(if $(filter mal,$(impl)),$(MAL_IMPL),$(impl)); \
|
|
|
|
echo "Performance test for $(impl):"; \
|
|
|
|
echo 'Running: $(call $(impl)_RUNSTEP,stepA,$(call $(impl)_STEP_TO_PROG,stepA),../tests/perf1.mal)'; \
|
|
|
|
$(call $(impl)_RUNSTEP,stepA,$(call $(impl)_STEP_TO_PROG,stepA),../tests/perf1.mal); \
|
|
|
|
echo 'Running: $(call $(impl)_RUNSTEP,stepA,$(call $(impl)_STEP_TO_PROG,stepA),../tests/perf2.mal)'; \
|
2015-02-28 19:38:17 +03:00
|
|
|
$(call $(impl)_RUNSTEP,stepA,$(call $(impl)_STEP_TO_PROG,stepA),../tests/perf2.mal); \
|
|
|
|
echo 'Running: $(call $(impl)_RUNSTEP,stepA,$(call $(impl)_STEP_TO_PROG,stepA),../tests/perf3.mal)'; \
|
|
|
|
$(call $(impl)_RUNSTEP,stepA,$(call $(impl)_STEP_TO_PROG,stepA),../tests/perf3.mal))
|
2015-12-14 16:50:27 +03:00
|
|
|
|
|
|
|
# REPL invocation rules
|
|
|
|
# Allow repl^IMPL^STEP and repl^IMPL (which starts REPL of stepA)
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(IMPL_REPL): $$@^stepA
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(ALL_REPL): $$(call $$(word 2,$$(subst ^, ,$$(@)))_STEP_TO_PROG,$$(word 3,$$(subst ^, ,$$(@))))
|
|
|
|
@$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
|
|
|
|
$(foreach step,$(word 3,$(subst ^, ,$(@))),\
|
|
|
|
cd $(if $(filter mal,$(impl)),$(MAL_IMPL),$(impl)); \
|
|
|
|
echo 'REPL implementation $(impl), step file: $+'; \
|
|
|
|
echo 'Running: $(call $(impl)_RUNSTEP,$(step),$(+))'; \
|
|
|
|
$(call $(impl)_RUNSTEP,$(step),$(+));))
|