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 php/null.php php/null.php-n \
17 tcl/null.tcl84 tcl/null.tcl85 tcl/null.tcl86
20 # cycles,instructions,branches,branch-misses \
21 # dtlb-loads,dtlb-load-misses,itlb-loads,itlb-load-misses \
22 # cycles,instructions,cache-references,cache-misses \
23 # cycles,instructions,stalled-cycles-frontend,stalled-cycles-backend
25 METRICS = cycles,instructions,branches,branch-misses,cpu-clock,task-clock,major-faults,minor-faults,cs
27 JAVA_VMS = server zero cacao jamvm
28 # see below for how this is called
29 JAVA_TARGETS = $(JAVA_VMS:%="java -cp java -% Null")
31 PYTHON_VERSIONS ?= python2.7 python3.4 pypy
32 PYTHON_VARIANTS = "" -O -S
33 PYTHON_TARGETS = $(foreach py,$(PYTHON_VERSIONS), \
34 $(foreach opt,$(PYTHON_VARIANTS), "$(py) $(opt) python/null.py"))
36 LUA_VERSIONS ?= lua5.1 lua5.2 luajit
37 LUA_TARGETS = $(LUA_VERSIONS:%="% lua/null.lua")
39 RUBY_VERSIONS ?= ruby2.1 ruby2.2
40 RUBY_TARGETS = $(RUBY_VERSIONS:%="% ruby/null.rb")
56 all: $(PROGS) java/Null.class
66 diet gcc -O2 -Wall -o $@ $<
70 gcc -static -O2 -Wall -o $@ $<
74 gcc -O2 -Wall -o $@ $<
78 g++ -static -O2 -Wall -o $@ $<
82 g++ -O2 -Wall -o $@ $<
85 haskell/null-single: haskell/null.hs
86 ghc --make -O2 -Wall -o $@ $<
89 haskell/null-threaded: haskell/null.hs
90 ghc --make -O2 -Wall -threaded -o $@ $<
93 ocaml/null-byte: ocaml/null.ml
95 # no stripping as this is not an elf file
97 ocaml/null-opt: ocaml/null.ml
101 java/null-gcj-%: java/Null.java
102 gcj-$* --main=Null -o $@ $<
105 java/Null.class: java/Null.java Makefile
108 log: $(PROGS) $(SCRIPTS) java/Null.class Makefile
110 for prog in $(ALL_TARGETS); do \
112 for metric in $(METRICS); do \
113 LC_ALL=C $(PERF) stat -e "$$metric" -r $(REPS) -o log --append $$prog; \
117 test: $(PROGS) $(SCRIPTS) java/Null.class Makefile
118 @for prog in $(ALL_TARGETS); do \
125 cd haskell && rm -f *.hi *.o
126 cd ocaml && rm -f *.cmo *.cmi *.cmx *.o
127 cd java && rm -f *.class
131 LC_ALL=en_US.UTF-8 awk -f dump.awk log
133 .PHONY: log clean report test