source: doc/generic_types/evaluation/Makefile @ 4cfcf41

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

Modify makefile to run simple benchmarks at both -O0 and -O2

  • Property mode set to 100644
File size: 2.4 KB
Line 
1CFA = my-cfa
2DEPFLAGS = -MMD -MP
3
4.PHONY: all clean distclean bench
5
6all: c-bench cpp-bench cfa-bench c2-bench cpp2-bench cfa2-bench
7
8# rewrite object generation to auto-determine deps
9COMPILE.c = $(CC) $(DEPFLAGS) $(CFLAGS) $(CPPFLAGS)
10COMPILE.cpp = $(CXX) $(DEPFLAGS) $(CXXFLAGS) $(CPPFLAGS)
11COMPILE.cfa = $(CFA) $(DEPFLAGS) $(CFLAGS) $(CPPFLAGS)
12
13c-%.o : c-%.c
14c-%.o : c-%.c c-%.d
15        $(COMPILE.c) -O0 $(OUTPUT_OPTION) -c $<
16
17cpp-%.o : cpp-%.cpp
18cpp-%.o : cpp-%.cpp cpp-%.d
19        $(COMPILE.cpp) -O0 $(OUTPUT_OPTION) -c $<
20
21cfa-%.o : cfa-%.c
22cfa-%.o : cfa-%.c cfa-%.d
23        $(COMPILE.cfa) -O0 $(OUTPUT_OPTION) -c $<
24
25c2-%.o : c-%.c
26c2-%.o : c-%.c c-%.d
27        $(COMPILE.c) -O2 $(OUTPUT_OPTION) -c $<
28
29cpp2-%.o : cpp-%.cpp
30cpp2-%.o : cpp-%.cpp cpp-%.d
31        $(COMPILE.cpp) -O2 $(OUTPUT_OPTION) -c $<
32
33cfa2-%.o : cfa-%.c
34cfa2-%.o : cfa-%.c cfa-%.d
35        $(COMPILE.cfa) -O2 $(OUTPUT_OPTION) -c $<
36
37COBJS = c-stack.o
38CPPOBJS = 
39CFAOBJS = cfa-stack.o
40C2OBJS = $(patsubst c-%,c2-%, $(COBJS))
41CPP2OBJS = $(patsubst cpp-%,cpp2-%, $(CPPOBJS))
42CFA2OBJS = $(patsubst cfa-%,cfa2-%, $(CFAOBJS))
43
44c-bench: c-bench.c c-bench.d $(COBJS)
45        $(COMPILE.c) -O0 -o $@ $< $(COBJS) $(LDFLAGS)
46
47cpp-bench: cpp-bench.cpp cpp-bench.d $(CPPOBJS)
48        $(COMPILE.cpp) -O0 -o $@ $< $(CPPOBJS) $(LDFLAGS)
49
50cfa-bench: cfa-bench.c cfa-bench.d $(CFAOBJS)
51        $(COMPILE.cfa) -O0 -o $@ $< $(CFAOBJS) $(LDFLAGS)
52
53c2-bench: c-bench.c c-bench.d $(C2OBJS)
54        $(COMPILE.c) -O2 -o $@ $< $(C2OBJS) $(LDFLAGS)
55
56cpp2-bench: cpp-bench.cpp cpp-bench.d $(CPP2OBJS)
57        $(COMPILE.cpp) -O2 -o $@ $< $(CPP2OBJS) $(LDFLAGS)
58
59cfa2-bench: cfa-bench.c cfa-bench.d $(CFA2OBJS)
60        $(COMPILE.cfa) -O2 -o $@ $< $(CFA2OBJS) $(LDFLAGS)
61
62clean:
63        -rm $(COBJS) c-bench
64        -rm $(CPPOBJS) cpp-bench
65        -rm $(CFAOBJS) cfa-bench
66        -rm $(C2OBJS) c2-bench
67        -rm $(CPP2OBJS) cpp2-bench
68        -rm $(CFA2OBJS) cfa2-bench
69
70distclean: clean
71        -rm $(COBJS:.o=.d) c-bench.d
72        -rm $(CPPOBJS:.o=.d) cpp-bench.d
73        -rm $(CFAOBJS:.o=.d) cfa-bench.d
74
75bench: c-bench cpp-bench cfa-bench c2-bench cpp2-bench cfa2-bench
76        @echo '## C ##'
77        @./c-bench
78        @echo '## C++ ##'
79        @./cpp-bench
80        @echo '## Cforall ##'
81        @./cfa-bench
82        @echo '## C -O2 ##'
83        @./c2-bench
84        @echo '## C++ -O2 ##'
85        @./cpp2-bench
86        @echo '## Cforall -O2 ##'
87        @./cfa2-bench
88
89# so make doesn't fail without dependency files
90%.d: ;
91
92# so make won't delete dependency files
93.PRECIOUS: %.d
94
95# include dependency files
96-include: $(COBJS:.o=.d)
97-include: $(CPPOBJS:.o=.d)
98-include: $(CFAOBJS:.o=.d)
99-include: c-bench.d
100-include: cpp-bench.d
101-include: cfa-bench.d
Note: See TracBrowser for help on using the repository browser.