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
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 METRICS = cycles,instructions,branches,branch-misses,cpu-clock,task-clock,major-faults,minor-faults,cs
29 JAVA_VMS = server zero cacao jamvm
30 # see below for how this is called
31 JAVA_INVOCS = $(JAVA_VMS:%="java -cp java -% Null")
33 PYTHON_VERSIONS ?= python2.7 python3.4 pypy
34 PYTHON_VARIANTS = "" -O -S
35 PYTHON_INVOCS = $(foreach py,$(PYTHON_VERSIONS), \
36 $(foreach opt,$(PYTHON_VARIANTS), "$(py) $(opt) python/null.py"))
51 all: $(PROGS) java/Null.class
61 diet gcc -O2 -Wall -o $@ $<
65 gcc -static -O2 -Wall -o $@ $<
69 gcc -O2 -Wall -o $@ $<
73 g++ -static -O2 -Wall -o $@ $<
77 g++ -O2 -Wall -o $@ $<
80 haskell/null-single: haskell/null.hs
81 ghc --make -O2 -Wall -o $@ $<
84 haskell/null-threaded: haskell/null.hs
85 ghc --make -O2 -Wall -threaded -o $@ $<
88 ocaml/null-byte: ocaml/null.ml
90 # no stripping as this is not an elf file
92 ocaml/null-opt: ocaml/null.ml
96 java/null-gcj-%: java/Null.java
97 gcj-$* --main=Null -o $@ $<
100 java/Null.class: java/Null.java Makefile
103 log: $(PROGS) $(SCRIPTS) java/Null.class Makefile
105 for prog in $(ALL_TARGETS); do \
107 for metric in $(METRICS); do \
108 LC_ALL=C $(PERF) stat -e "$$metric" -r $(REPS) -o log --append $$prog; \
112 test: $(PROGS) $(SCRIPTS) java/Null.class Makefile
113 @for prog in $(ALL_TARGETS); do \
120 cd haskell && rm -f *.hi *.o
121 cd ocaml && rm -f *.cmo *.cmi *.cmx *.o
122 cd java && rm -f *.class
126 LC_ALL=en_US.UTF-8 awk -f dump.awk log
128 .PHONY: log clean report test