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 \
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
21 # cycles,instructions,branches,branch-misses \
22 # dtlb-loads,dtlb-load-misses,itlb-loads,itlb-load-misses \
23 # cycles,instructions,cache-references,cache-misses \
24 # cycles,instructions,stalled-cycles-frontend,stalled-cycles-backend
26 METRICS = cycles,instructions,branches,branch-misses,cpu-clock,task-clock,major-faults,minor-faults,cs
28 JAVA_VMS = server zero cacao jamvm
29 # see below for how this is called
30 JAVA_INVOCS = $(JAVA_VMS:%="java -cp java -% Null")
32 PYTHON_VERSIONS ?= python2.7 python3.4 pypy
33 PYTHON_VARIANTS = "" -O -S
34 PYTHON_INVOCS = $(foreach py,$(PYTHON_VERSIONS), \
35 $(foreach opt,$(PYTHON_VARIANTS), "$(py) $(opt) python/null.py"))
37 LUA_VERSIONS ?= lua5.1 lua5.2 luajit
38 LUA_INVOCS = $(LUA_VERSIONS:%="% lua/null.lua")
54 all: $(PROGS) java/Null.class
64 diet gcc -O2 -Wall -o $@ $<
68 gcc -static -O2 -Wall -o $@ $<
72 gcc -O2 -Wall -o $@ $<
76 g++ -static -O2 -Wall -o $@ $<
80 g++ -O2 -Wall -o $@ $<
83 haskell/null-single: haskell/null.hs
84 ghc --make -O2 -Wall -o $@ $<
87 haskell/null-threaded: haskell/null.hs
88 ghc --make -O2 -Wall -threaded -o $@ $<
91 ocaml/null-byte: ocaml/null.ml
93 # no stripping as this is not an elf file
95 ocaml/null-opt: ocaml/null.ml
99 java/null-gcj-%: java/Null.java
100 gcj-$* --main=Null -o $@ $<
103 java/Null.class: java/Null.java Makefile
106 log: $(PROGS) $(SCRIPTS) java/Null.class Makefile
108 for prog in $(ALL_TARGETS); do \
110 for metric in $(METRICS); do \
111 LC_ALL=C $(PERF) stat -e "$$metric" -r $(REPS) -o log --append $$prog; \
115 test: $(PROGS) $(SCRIPTS) java/Null.class Makefile
116 @for prog in $(ALL_TARGETS); do \
123 cd haskell && rm -f *.hi *.o
124 cd ocaml && rm -f *.cmo *.cmi *.cmx *.o
125 cd java && rm -f *.class
129 LC_ALL=en_US.UTF-8 awk -f dump.awk log
131 .PHONY: log clean report test