]> git.k1024.org Git - perf-null.git/blob - Makefile
Remove extra NL in php scripts
[perf-null.git] / Makefile
1 PROGS = \
2         c/c-diet-static-null c/c-diet-dynamic-null \
3         c/c-libc-static-null c/c-libc-dynamic-null \
4         c/c++-static-null c/c++-dynamic-null \
5         haskell/null-single haskell/null-threaded \
6         ocaml/null-byte ocaml/null-opt
7
8 SCRIPTS = \
9         dash/null.dash bash/null.bash \
10         lua/null.lua51 lua/null.lua52 lua/null.luajit \
11         perl/null.pl ruby/null.rb \
12         php/null.php php/null.php-n \
13         tcl/null.tcl \
14         python/null.py-s python/null.py python/null.pypy
15
16 METRICS = \
17         cycles,instructions,branches,branch-misses \
18         dtlb-loads,dtlb-load-misses,itlb-loads,itlb-load-misses \
19         cycles,instructions,cache-references,cache-misses \
20         cycles,instructions,stalled-cycles-frontend,stalled-cycles-backend
21
22 all: $(PROGS)
23
24 $(PROGS): Makefile
25
26 c-diet-static-%: %.c
27         diet gcc -static -O2 -Wall -o $@ $<
28         strip $@
29
30 c-diet-dynamic-%: %.c
31         diet gcc -O2 -Wall -o $@ $<
32         strip $@
33
34 c-libc-static-%: %.c
35         gcc -static -O2 -Wall -o $@ $<
36         strip $@
37
38 c-libc-dynamic-%: %.c
39         gcc -O2 -Wall -o $@ $<
40         strip $@
41
42 c++-static-%: %.c
43         g++ -static -O2 -Wall -o $@ $<
44         strip $@
45
46 c++-dynamic-%: %.c
47         g++ -O2 -Wall -o $@ $<
48         strip $@
49
50 haskell/null-single: haskell/null.hs
51         ghc --make -O2 -Wall -o $@ $<
52         strip $@
53
54 haskell/null-threaded: haskell/null.hs
55         ghc --make -O2 -Wall -threaded -o $@ $<
56         strip $@
57
58 ocaml/null-byte: ocaml/null.ml
59         ocamlc -o $@ $<
60         # no stripping as this is not an elf file
61
62 ocaml/null-opt: ocaml/null.ml
63         ocamlopt -o $@ $<
64         strip $@
65
66 log: $(PROGS) $(SCRIPTS) Makefile
67         set -x; \
68         rm -f log; \
69         for prog in $(PROGS) $(SCRIPTS); do \
70           for metric in $(METRICS); do \
71             LC_ALL=C perf stat -e "$$metric" -r100 -o log --append ./$$prog; \
72           done; \
73         done
74
75 .PHONY: log
76
77 clean:
78         cd haskell && rm -f *.hi *.o
79         cd ocaml && rm -f *.cmo *.cmi *.cmx *.o
80         rm -f $(PROGS)