-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
129 lines (100 loc) · 4.37 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#### Makefile ####
# Usage: #
# >make #
# >make clean #
####################
FILES = truthtable.cc blif-verifier.cc blif.cc tokenizer.cc error.cc
HEADERS = truthtable.h blif.h tokenizer.h error.h
OBJECTS = truthtable.o blif-verifier.o blif.o tokenizer.o error.o
CPPFLAGS = -Wall -pedantic --std=c++11
default: release
debug: CPPFLAGS += -g -ggdb
debug: ${OBJECTS}
g++ $(CPPFLAGS) ${OBJECTS} -o blif-verifier
release: CPPFLAGS += -O3
release: buildinternal
profile: CPPFLAGS += -O2 -lc -pg
profile: buildinternal
coverage: CPPFLAGS += --coverage -O0
coverage: buildinternal
lint:
cpplint.py *.h *.cc
test: clean coverage
echo "*** Testing attempt to read non-existing file. ***"
! ./blif-verifier test/does_not_exist.blif add8.blif a.c
echo "*** Testing bad dependencies ***"
! ./blif-verifier test/add8.blif test/add8_baddep.blif a.c
echo "*** Testing bad section ***"
! ./blif-verifier test/add8.blif test/add8_badsection.blif a.c
echo "*** Testing dupe truth table ***"
! ./blif-verifier test/add8_dupett.blif test/add8.blif a.c
echo "*** Testing duplicate block ***"
! ./blif-verifier test/add8_duplicateblock.blif test/add8.blif a.c
echo "*** Testing names early 1 ***"
! ./blif-verifier test/add8_namesearly1.blif test/add8.blif a.c
echo "*** Testing names early 2 ***"
! ./blif-verifier test/add8_namesearly2.blif test/add8.blif a.c
echo "*** Testing undefined po ***"
! ./blif-verifier test/add8_undefpo.blif test/add8.blif a.c
./blif-verifier test/and16.blif test/and16.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/and16.blif == test/and16.blif ***"
./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/and16.blif test/and32.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/and16.blif != and32.blif ***"
! ./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/mul5.blif test/mul5_bad.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/mul5.blif != test/mul5_bad.blif ***"
! ./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/mul5.blif test/mul5.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/mul5.blif == test/mul5.blif ***"
./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/mul12.blif test/mul12_bad.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/mul12.blif != test/mul12_bad.blif ***"
! ./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/exp.blif test/exp.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/exp.blif == test/exp.blif ***"
./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/exp.blif test/exp_bad.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/exp.blif != test/exp_bad.blif ***"
! ./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/log.blif test/log.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/log.blif == test/log.blif ***"
./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
./blif-verifier test/log.blif test/log_bad.blif a.c 2> /dev/null > /dev/null || true
gcc harness.c a.c -o verifier -lm
echo "*** Testing test/log.blif != test/log_bad.blif ***"
! ./verifier > /dev/null
gcov -l -s c++/ -s /usr/include -r -f ${FILES} ${HEADERS} | tail -n 1
rm -f verifier
gcov -l -r -f ${FILES} ${HEADERS} > coverage.report
lcov --capture --directory . --output-file coverage.info && genhtml coverage.info || echo "lcov not installed."
buildinternal: ${OBJECTS}
g++ $(CPPFLAGS) ${OBJECTS} -o blif-verifier
clean:
\rm -f ${OBJECTS} blif-verifier *.gcov *.gcda *.gcno
%.o : %.cc
g++ $(CPPFLAGS) -c $< -o $@