ref: e989bbf2b6d71c6ce9f9bb438f31097110fff1d6
parent: 8526055dff6cd1c350da84f97de89efa75606ec7
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Dec 4 06:18:48 EST 2015
Add benchmark build tag to benchmarks.
We don't need them built by default.
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
.PHONY: bench
bench:
- mbld
+ mbld -tbench
mbld bench:benchit
.PHONY: bootstrap
--- a/bench/bld.sub
+++ b/bench/bld.sub
@@ -1,31 +1,31 @@
-bin intsort {noinst} =+bin intsort {noinst,tag=bench} =intsort.myr
lib ../lib/std:std
lib ../lib/sys:sys
;;
-bin copious-allocs {noinst} =+bin copious-allocs {noinst,tag=bench} =copious-allocs.myr
lib ../lib/std:std
lib ../lib/sys:sys
;;
-bin sha1-compute {noinst} =+bin sha1-compute {noinst,tag=bench} =sha1-compute.myr
lib ../lib/std:std
lib ../lib/sys:sys
lib ../lib/cryptohash:cryptohash
;;
-bin bigfactorial {noinst} =+bin bigfactorial {noinst,tag=bench} =bigfactorial.myr
lib ../lib/std:std
lib ../lib/sys:sys
;;
-bin mandelbrot {noinst} =+bin mandelbrot {noinst,tag=bench} =mandelbrot.myr
lib ../lib/std:std
lib ../lib/sys:sys
lib ../lib/bio:bio
;;
-bin regex-match {noinst} =+bin regex-match {noinst,tag=bench} =regex-match.myr
lib ../lib/std:std
lib ../lib/sys:sys
@@ -32,7 +32,7 @@
lib ../lib/regex:regex
;;
-bin many-memcpy {noinst} =+bin many-memcpy {noinst,tag=bench} =many-memcpy.myr
lib ../lib/std:std
lib ../lib/sys:sys
@@ -39,13 +39,13 @@
;;
# benchmark runner
-bin runbench {noinst} =+bin runbench {noinst,tag=bench} =runbench.myr
lib ../lib/std:std
lib ../lib/sys:sys
;;
-cmd benchit =
+cmd benchit {tag=bench} =./runbench
intsort
copious-allocs
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -26,8 +26,8 @@
cmd = std.optparse(args, &[
.argdesc = "[inputs...]",
.opts = [
- [.opt='t', .desc="list all available targets"],
- [.opt='T', .arg="tag", .desc="build with specified systag"],
+ [.opt='T', .desc="list all available targets"],
+ [.opt='t', .arg="tag", .desc="build with specified systag"],
[.opt='S', .desc="generate assembly when building"],
[.opt='d', .desc="dump debugging information for mbld"],
[.opt='I', .arg="inc", .desc="add 'inc' to your include path"],
@@ -45,11 +45,11 @@
bld.initopts()
for opt in cmd.opts
match opt
- | ('t', ""): dumponly = true+ | ('T', ""): dumponly = true | ('S', ""): bld.opt_genasm = true | ('I', arg): bld.opt_incpaths = std.slpush(bld.opt_incpaths, arg) | ('R', arg): bld.opt_instroot = arg- | ('T', tag): tags = std.slpush(tags, tag)+ | ('t', tag): tags = std.slpush(tags, tag) | ('b', arg):targname = arg
bintarg = true
--
⑨