4 c/c-libc-static-null c/c-libc-dynamic-null \
5 c/c++-static-null c/c++-dynamic-null \
6 haskell/null-single haskell/null-threaded \
7 ocaml/null-byte ocaml/null-opt \
8 java/null-gcj-4.6 java/null-gcj-4.8 \
9 java/null-gcj-4.9 java/null-gcj-5
12 dash/null.dash bash/null.bash \
13 mksh/null.mksh mksh/null.mksh-static \
14 lua/null.lua51 lua/null.lua52 lua/null.luajit \
16 awk/null.mawk awk/null.gawk \
17 ruby/null.rb18 ruby/null.rb19 \
18 php/null.php php/null.php-n \
19 tcl/null.tcl84 tcl/null.tcl85 tcl/null.tcl86 \
20 python/null.py26 python/null.py26-s \
21 python/null.py27 python/null.py27-s python/null.py27-o \
22 python/null.py32 python/null.py32-s python/null.py32-o \
23 python/null.pypy python/null.pypy-s
26 # cycles,instructions,branches,branch-misses \
27 # dtlb-loads,dtlb-load-misses,itlb-loads,itlb-load-misses \
28 # cycles,instructions,cache-references,cache-misses \
29 # cycles,instructions,stalled-cycles-frontend,stalled-cycles-backend
31 METRICS = cycles,instructions,branches,branch-misses,cpu-clock,task-clock,major-faults,minor-faults,cs
33 JAVA_VMS = server zero cacao jamvm
34 # see below for how this is called
35 JAVA_INVOCS = $(JAVA_VMS:%="java -cp java -% Null")
43 all: $(PROGS) java/Null.class
53 diet gcc -O2 -Wall -o $@ $<
57 gcc -static -O2 -Wall -o $@ $<
61 gcc -O2 -Wall -o $@ $<
65 g++ -static -O2 -Wall -o $@ $<
69 g++ -O2 -Wall -o $@ $<
72 haskell/null-single: haskell/null.hs
73 ghc --make -O2 -Wall -o $@ $<
76 haskell/null-threaded: haskell/null.hs
77 ghc --make -O2 -Wall -threaded -o $@ $<
80 ocaml/null-byte: ocaml/null.ml
82 # no stripping as this is not an elf file
84 ocaml/null-opt: ocaml/null.ml
88 java/null-gcj-%: java/Null.java
89 gcj-$* --main=Null -o $@ $<
92 java/Null.class: java/Null.java Makefile
95 log: $(PROGS) $(SCRIPTS) java/Null.class Makefile
97 for prog in $(PROGS:%=./%) $(SCRIPTS:%=./%) $(EXTRA_RUN) $(JAVA_INVOCS); do \
99 for metric in $(METRICS); do \
100 LC_ALL=C $(PERF) stat -e "$$metric" -r $(REPS) -o log --append $$prog; \
108 cd haskell && rm -f *.hi *.o
109 cd ocaml && rm -f *.cmo *.cmi *.cmx *.o
110 cd java && rm -f *.class