-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
245 lines (224 loc) · 10.5 KB
/
Copy pathMakefile
File metadata and controls
245 lines (224 loc) · 10.5 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
#TP1 Makefile
CC = g++
CFLAGS = -g -Wall -pedantic
OBJS = Complex.o CommandLineArguments.o Status.o Signal.o stream.o
VALGRINDFLAGS = --tool=memcheck
#Run all
all: tp1 diff_tp1 test-dft test-idft test-fft test-ifft test-iterfft test-iterifft test-fft-iplace test-ifft-iplace test-dft-valgrind test-idft-valgrind test-fft-valgrind test-ifft-valgrind test-iterfft-valgrind test-iterifft-valgrind test-fft-iplace-valgrind test-ifft-iplace-valgrind
#install
install: tp1
#Create tp0 program
tp1: main.o $(OBJS)
$(CC) $(CFLAGS) -o tp1 main.o $(OBJS)
main.o: main.cpp main.h
$(CC) $(CFLAGS) -c main.cpp
Signal.o: Signal.cpp Signal.h
$(CC) $(CFLAGS) -c Signal.cpp
Complex.o: Complex.cpp Complex.h
$(CC) $(CFLAGS) -c Complex.cpp
CommandLineArguments.o: CommandLineArguments.cpp CommandLineArguments.h
$(CC) $(CFLAGS) -c CommandLineArguments.cpp
stream.o: stream.cpp stream.h
$(CC) $(CFLAGS) -c stream.cpp
Status.o: Status.cpp Status.h
$(CC) $(CFLAGS) -c Status.cpp
#Create diff_tp0 program
diff_tp1: diff_tp1.cpp $(OBJS)
$(CC) $(CFLAGS) -o diff_tp1 diff_tp1.cpp cmdline.cpp $(OBJS)
#Run tests cases
#dft
test-dft: tp1 diff_tp1
@echo Testing dft cases.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
./tp1 < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
./tp1 -m dft -i tests-dft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
done
@echo Test OK.
#idft
test-idft: tp1 diff_tp1
@echo Testing idft cases.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
./tp1 -m idft < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
./tp1 -m idft -i tests-idft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
done
@echo Test OK.
#fft
test-fft: tp1 diff_tp1
@echo Testing fft cases.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
./tp1 -m fft < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
./tp1 -m fft -i tests-dft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
done
@echo Test OK.
#ifft
test-ifft: tp1 diff_tp1
@echo Testing ifft cases.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
./tp1 -m ifft < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
./tp1 -m ifft -i tests-idft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
done
@echo Test OK.
#iterfft
test-iterfft: tp1 diff_tp1
@echo Testing iterfft cases.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
./tp1 -m fft-iter < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
./tp1 -m fft-iter -i tests-dft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
done
@echo Test OK.
#iterifft
test-iterifft: tp1 diff_tp1
@echo Testing iterifft cases.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
./tp1 -m ifft-iter < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
./tp1 -m ifft-iter -i tests-idft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
done
@echo Test OK.
#fft-iplace
test-fft-iplace: tp1 diff_tp1
@echo Testing fft-iplace cases.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
./tp1 -m fft-iplace < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
./tp1 -m fft-iplace -i tests-dft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out; \
done
@echo Test OK.
#ifft-iplace
test-ifft-iplace: tp1 diff_tp1
@echo Testing ifft-iplace cases.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
./tp1 -m ifft-iplace < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
./tp1 -m ifft-iplace -i tests-idft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out; \
done
@echo Test OK.
#Run tests cases with Valgrind
#dft
test-dft-valgrind: tp1 diff_tp1
@echo Testing dft cases with Valgrind.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m dft -i tests-dft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
done
@echo Test OK.
#idft
test-idft-valgrind: tp1 diff_tp1
@echo Testing idft cases with Valgrind.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m idft < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m idft -i tests-idft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
done
@echo Test OK.
#fft
test-fft-valgrind: tp1 diff_tp1
@echo Testing fft cases with Valgrind.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m fft < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m fft -i tests-dft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
done
@echo Test OK.
#ifft
test-ifft-valgrind: tp1 diff_tp1
@echo Testing ifft cases with Valgrind.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m ifft < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m ifft -i tests-idft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
done
@echo Test OK.
#iterfft
test-iterfft-valgrind: tp1 diff_tp1
@echo Testing iterfft cases with Valgrind.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m fft-iter < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m fft-iter -i tests-dft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
done
@echo Test OK.
#iterifft
test-iterifft-valgrind: tp1 diff_tp1
@echo Testing iterifft cases with Valgrind.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m ifft-iter < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m ifft-iter -i tests-idft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
done
@echo Test OK.
#fft-iplace
test-fft-iplace-valgrind: tp1 diff_tp1
@echo Testing fft-iplace cases with Valgrind.
@set -e; for t in `seq 1 9`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m fft-iplace < tests-dft/test$$t.in > tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m fft-iplace -i tests-dft/test$$t.in -o tests-dft/test$$t.out; \
./diff_tp1 -r tests-dft/test$$t.ref -o tests-dft/test$$t.out ; \
done
@echo Test OK.
#ifft-iplace
test-ifft-iplace-valgrind: tp1 diff_tp1
@echo Testing ifft-iplace cases with Valgrind.
@set -e; for t in `seq 10 17`; do \
echo Testing: $$t.; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m ifft-iplace < tests-idft/test$$t.in > tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
valgrind $(VALGRINDFLAGS) 2>/dev/null \
./tp1 -m ifft-iplace -i tests-idft/test$$t.in -o tests-idft/test$$t.out; \
./diff_tp1 -r tests-idft/test$$t.ref -o tests-idft/test$$t.out ; \
done
@echo Test OK.
#Delete .o files
clean:
rm *.o