3 c/c-diet-static-null c/c-diet-dynamic-null \
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 \
11 dash/null.dash bash/null.bash \
12 lua/null.lua51 lua/null.lua52 lua/null.luajit \
13 perl/null.pl ruby/null.rb \
14 php/null.php php/null.php-n \
15 tcl/null.tcl84 tcl/null.tcl85 tcl/null.tcl86 \
16 python/null.py26 python/null.py26-s \
17 python/null.py27 python/null.py27-s \
18 python/null.py32 python/null.py32-s \
22 cycles,instructions,branches,branch-misses \
23 dtlb-loads,dtlb-load-misses,itlb-loads,itlb-load-misses \
24 cycles,instructions,cache-references,cache-misses \
25 cycles,instructions,stalled-cycles-frontend,stalled-cycles-backend
27 JAVA_VMS = server zero cacao jamvm
28 # see below for how this is called
29 JAVA_INVOCS = $(JAVA_VMS:%="java -cp java -% Null")
33 all: $(PROGS) java/Null.class
43 diet gcc -static -O2 -Wall -o $@ $<
47 diet gcc -O2 -Wall -o $@ $<
51 gcc -static -O2 -Wall -o $@ $<
55 gcc -O2 -Wall -o $@ $<
59 g++ -static -O2 -Wall -o $@ $<
63 g++ -O2 -Wall -o $@ $<
66 haskell/null-single: haskell/null.hs
67 ghc --make -O2 -Wall -o $@ $<
70 haskell/null-threaded: haskell/null.hs
71 ghc --make -O2 -Wall -threaded -o $@ $<
74 ocaml/null-byte: ocaml/null.ml
76 # no stripping as this is not an elf file
78 ocaml/null-opt: ocaml/null.ml
82 java/null-gcj: java/Null.java
83 gcj-4.6 --main=Null -o $@ $<
86 java/Null.class: java/Null.java Makefile
89 log: $(PROGS) $(SCRIPTS) java/Null.class Makefile
91 for prog in $(PROGS:%=./%) $(SCRIPTS:%=./%) $(JAVA_INVOCS); do \
93 for metric in $(METRICS); do \
94 LC_ALL=C perf stat -e "$$metric" -r $(REPS) -o log --append $$prog; \
102 cd haskell && rm -f *.hi *.o
103 cd ocaml && rm -f *.cmo *.cmi *.cmx *.o
104 cd java && rm -f *.class