### -*-makefile-*- ### ### Build script for start-up benchmarks ### ### (c) 2020 Mark Wooding ### ###----- Licensing notice --------------------------------------------------- ### ### This file is part of Runlisp, a tool for invoking Common Lisp scripts. ### ### Runlisp is free software: you can redistribute it and/or modify it ### under the terms of the GNU General Public License as published by the ### Free Software Foundation; either version 3 of the License, or (at your ### option) any later version. ### ### Runlisp is distributed in the hope that it will be useful, but WITHOUT ### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ### for more details. ### ### You should have received a copy of the GNU General Public License ### along with Runlisp. If not, see . include $(top_srcdir)/vars.am GNUPLOT = gnuplot FORCE = FORCE: .PHONY: FORCE ###-------------------------------------------------------------------------- ### Preliminaries. v_bench = $(v_bench_@AM_V@) v_bench_ = $(v_bench_@AM_DEFAULT_V@) v_bench_0 = @echo " BENCH $@"; BENCHES = bench: $(BENCHES) noinst_PROGRAMS += timeit timeit_SOURCES = timeit.c CLEANFILES += *.out *.bench ###-------------------------------------------------------------------------- ### Lisp systems using `runlisp'. RUNLISP = $(top_builddir)/runlisp \ -c$(top_srcdir)/runlisp-base.conf \ -oimage-dir=$(top_builddir) EXTRA_DIST += t.lisp RUNLISP_BENCHES = $(foreach l,$(LISPS), runlisp.$l.bench) BENCHES += $(RUNLISP_BENCHES) $(RUNLISP_BENCHES): runlisp.%.bench: timeit $(FORCE) $(v_bench)./timeit $(RUNLISP) -L$* -- \ $(srcdir)/t.lisp a b c >runlisp.$*.out 2>$@ RUNLISP_NOIMAGE_BENCHES = $(foreach l,$(LISPS), runlisp-noimage.$l.bench) BENCHES += $(RUNLISP_NOIMAGE_BENCHES) $(RUNLISP_NOIMAGE_BENCHES): runlisp-noimage.%.bench: timeit $(FORCE) $(v_bench)./timeit $(RUNLISP) -D -L$* -- \ $(srcdir)/t.lisp a b c >runlisp-noimage.$*.out 2>$@ ###-------------------------------------------------------------------------- ### Lisp systems using `cl-launch'. CL_LAUNCH_BENCHES = $(foreach l,$(LISPS), cl-launch.$l.bench) BENCHES += $(CL_LAUNCH_BENCHES) $(CL_LAUNCH_BENCHES): cl-launch.%.bench: timeit $(FORCE) $(v_bench)./timeit cl-launch -X -l $* -- $(srcdir)/t.lisp a b c >cl-launch.$*.out 2>$@ ###-------------------------------------------------------------------------- ### C programs (as a baseline). BENCHES += c.tcc.bench c.tcc.bench: timeit $(FORCE) $(v_bench)./timeit tcc -run $(srcdir)/t.c a b c >c.tcc.out 2>$@ BENCHES += c.gcc.bench noinst_PROGRAMS += t.c.gcc t_c_gcc_SOURCES = t.c c.gcc.bench: t.c.gcc timeit $(FORCE) $(v_bench)./timeit ./t.c.gcc a b c >c.gcc.out 2>$@ ###-------------------------------------------------------------------------- ### Other scripting languages. BENCHES += perl.bench EXTRA_DIST += t.pl perl.bench: timeit $(FORCE) $(v_bench)./timeit perl -- $(srcdir)/t.pl a b c >perl.out 2>$@ BENCHES += python.bench EXTRA_DIST += t.py python.bench: timeit $(FORCE) $(v_bench)./timeit python -- $(srcdir)/t.py a b c >python.out 2>$@ SHELLS = dash bash zsh EXTRA_DIST += t.sh SHELL_BENCHES = $(foreach s,$(SHELLS), shell.$s.bench) BENCHES += $(SHELL_BENCHES) $(SHELL_BENCHES): shell.%.bench: timeit $(FORCE) $(v_bench)TEST_SHELL=$* ./timeit $* -- $(srcdir)/t.sh a b c >shell.$*.out 2>$@ ###-------------------------------------------------------------------------- ### Reporting. GRAPHS = noinst_DATA += $(GRAPHS) CLEANFILES += $(GRAPHS) v_massage = $(v_massage_@AM_V@) v_massage_ = $(v_massage_@AM_DEFAULT_V@) v_massage_0 = @echo " MASSAGE $@"; v_gnuplot = $(v_gnuplot_@AM_V@) v_gnuplot_ = $(v_gnuplot_@AM_DEFAULT_V@) v_gnuplot_0 = @echo " GNUPLOT $@"; CLEANFILES += bench.data bench.data: $(BENCHES) massage-benchmarks $(v_massage)$(srcdir)/massage-benchmarks >$@.new && mv $@.new $@ GRAPHS += lisp-graph.tikz lisp-graph.tikz: lisp-graph.gp bench.data $(v_gnuplot)$(GNUPLOT) $< >$@.new && mv $@.new $@ GRAPHS += interp-graph.tikz interp-graph.tikz: interp-graph.gp bench.data $(v_gnuplot)$(GNUPLOT) $< >$@.new && mv $@.new $@ graphs: $(GRAPHS) .PHONY: graphs ###----- That's all, folks --------------------------------------------------