source: doc/generic_types/evaluation/Makefile @ b14dd03

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since b14dd03 was b14dd03, checked in by Aaron Moss <a3moss@…>, 4 years ago

Fix performance bug in C++ virtual benchmark

  • Property mode set to 100644
File size: 2.7 KB
Line 
1CFA = my-cfa
2DEPFLAGS = -MMD -MP
3CFLAGS = -O2 -flto
4CXXFLAGS = $(CFLAGS) --std=c++14
5
6.PHONY: all clean distclean run-c run-cpp run-cfa run
7
8all: c-bench cpp-bench cfa-bench cpp-vbench
9
10# rewrite object generation to auto-determine deps
11COMPILE.c = $(CC) $(DEPFLAGS) $(CFLAGS) $(CPPFLAGS)
12COMPILE.cpp = $(CXX) $(DEPFLAGS) $(CXXFLAGS) $(CPPFLAGS)
13COMPILE.cfa = $(CFA) $(DEPFLAGS) $(CFLAGS) $(CPPFLAGS)
14
15c-%.o : c-%.c
16c-%.o : c-%.c c-%.d
17        $(COMPILE.c) $(OUTPUT_OPTION) -c $<
18
19cpp-%.o : cpp-%.cpp
20cpp-%.o : cpp-%.cpp cpp-%.d
21        $(COMPILE.cpp) $(OUTPUT_OPTION) -c $<
22
23cfa-%.o : cfa-%.c
24cfa-%.o : cfa-%.c cfa-%.d
25        $(COMPILE.cfa) $(OUTPUT_OPTION) -c $<
26
27COBJS = c-stack.o c-pair.o
28CPPOBJS = 
29CPPVOBJS = cpp-vstack.o
30CFAOBJS = cfa-stack.o cfa-pair.o
31
32c-bench: c-bench.c c-bench.d $(COBJS)
33        $(COMPILE.c) -o $@ $< $(COBJS) $(LDFLAGS)
34
35cpp-bench: cpp-bench.cpp cpp-bench.d $(CPPOBJS)
36        $(COMPILE.cpp) -o $@ $< $(CPPOBJS) $(LDFLAGS)
37
38cpp-vbench: cpp-vbench.cpp cpp-vbench.d $(CPPVOBJS)
39        $(COMPILE.cpp) -o $@ $< $(CPPVOBJS) $(LDFLAGS)
40
41cfa-bench: cfa-bench.c cfa-bench.d $(CFAOBJS)
42        $(COMPILE.cfa) -o $@ $< $(CFAOBJS) $(LDFLAGS)
43
44clean:
45        -rm $(COBJS) c-bench
46        -rm $(CPPOBJS) cpp-bench
47        -rm $(CPPVOBJS) cpp-vbench
48        -rm $(CFAOBJS) cfa-bench
49
50distclean: clean
51        -rm $(COBJS:.o=.d) c-bench.d
52        -rm $(CPPOBJS:.o=.d) cpp-bench.d
53        -rm $(CPPVOBJS:.o=.d) cpp-vbench.d
54        -rm $(CFAOBJS:.o=.d) cfa-bench.d
55
56run-c: c-bench
57        @echo
58        @echo '## C ##'
59        @/usr/bin/time -f 'max_memory:\t%M kilobytes' ./c-bench
60        @printf 'source_size:\t%8d lines\n' `cat c-bench.c bench.h c-stack.h c-stack.c | wc -l`
61        @printf 'binary_size:\t%8d bytes\n' `stat -c %s c-bench`
62
63run-cfa: cfa-bench
64        @echo
65        @echo '## Cforall ##'
66        @/usr/bin/time -f 'max_memory:\t %M kilobytes' ./cfa-bench
67        @printf 'source_size:\t%8d lines\n' `cat cfa-bench.c bench.h cfa-stack.h cfa-stack.c | wc -l`
68        @printf 'binary_size:\t%8d bytes\n' `stat -c %s cfa-bench`
69
70run-cpp: cpp-bench
71        @echo
72        @echo '## C++ ##'
73        @/usr/bin/time -f 'max_memory:\t %M kilobytes' ./cpp-bench
74        @printf 'source_size:\t%8d lines\n' `cat cpp-bench.cpp bench.hpp cpp-stack.hpp | wc -l`
75        @printf 'binary_size:\t%8d bytes\n' `stat -c %s cpp-bench`
76
77run-cppv: cpp-vbench
78        @echo
79        @echo '## C++ virtual ##'
80        @/usr/bin/time -f 'max_memory:\t%M kilobytes' ./cpp-vbench
81        @printf 'source_size:\t%8d lines\n' `cat cpp-vbench.cpp bench.hpp object.hpp cpp-vstack.hpp cpp-vstack.cpp | wc -l`
82        @printf 'binary_size:\t%8d bytes\n' `stat -c %s cpp-vbench`
83
84run: run-c run-cfa run-cpp run-cppv
85
86# so make doesn't fail without dependency files
87%.d: ;
88
89# so make won't delete dependency files
90.PRECIOUS: %.d
91
92# include dependency files
93-include: $(COBJS:.o=.d)
94-include: $(CPPOBJS:.o=.d)
95-include: $(CFAOBJS:.o=.d)
96-include: c-bench.d
97-include: cpp-bench.d
98-include: cfa-bench.d
Note: See TracBrowser for help on using the repository browser.