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 mksh/null.mksh mksh/null.mksh-static \
13 lua/null.lua51 lua/null.lua52 lua/null.luajit \
15 awk/null.mawk awk/null.gawk \
16 ruby/null.rb18 ruby/null.rb19 \
17 php/null.php php/null.php-n \
18 tcl/null.tcl84 tcl/null.tcl85 tcl/null.tcl86 \
19 python/null.py26 python/null.py26-s \
20 python/null.py27 python/null.py27-s python/null.py27-o \
21 python/null.py32 python/null.py32-s python/null.py32-o \
22 python/null.pypy python/null.pypy-s
25 # cycles,instructions,branches,branch-misses \
26 # dtlb-loads,dtlb-load-misses,itlb-loads,itlb-load-misses \
27 # cycles,instructions,cache-references,cache-misses \
28 # cycles,instructions,stalled-cycles-frontend,stalled-cycles-backend
30 METRICS = cycles,instructions,branches,branch-misses,cpu-clock,task-clock,major-faults,minor-faults,cs
32 JAVA_VMS = server zero cacao jamvm
33 # see below for how this is called
34 JAVA_INVOCS = $(JAVA_VMS:%="java -cp java -% Null")
42 all: $(PROGS) java/Null.class
52 diet gcc -O2 -Wall -o $@ $<
56 gcc -static -O2 -Wall -o $@ $<
60 gcc -O2 -Wall -o $@ $<
64 g++ -static -O2 -Wall -o $@ $<
68 g++ -O2 -Wall -o $@ $<
71 haskell/null-single: haskell/null.hs
72 ghc --make -O2 -Wall -o $@ $<
75 haskell/null-threaded: haskell/null.hs
76 ghc --make -O2 -Wall -threaded -o $@ $<
79 ocaml/null-byte: ocaml/null.ml
81 # no stripping as this is not an elf file
83 ocaml/null-opt: ocaml/null.ml
87 java/null-gcj: java/Null.java
88 gcj-4.6 --main=Null -o $@ $<
91 java/Null.class: java/Null.java Makefile
94 log: $(PROGS) $(SCRIPTS) java/Null.class Makefile
96 for prog in $(PROGS:%=./%) $(SCRIPTS:%=./%) $(EXTRA_RUN) $(JAVA_INVOCS); do \
98 for metric in $(METRICS); do \
99 LC_ALL=C $(PERF) stat -e "$$metric" -r $(REPS) -o log --append $$prog; \
107 cd haskell && rm -f *.hi *.o
108 cd ocaml && rm -f *.cmo *.cmi *.cmx *.o
109 cd java && rm -f *.class