source: doc/papers/general/evaluation/Makefile @ 6ae5c22

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 6ae5c22 was 79d4186, checked in by Aaron Moss <a3moss@…>, 7 years ago

Update evaluation code for paper

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