forked from Opendigitalradio/ka9q-fec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.in
249 lines (164 loc) · 5.57 KB
/
makefile.in
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
246
247
248
# Makefile prototype for configure
# Copyright 2004 Phil Karn, KA9Q
# May be used under the terms of the GNU Lesser General Public License (LGPL)
# @configure_input@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix=@exec_prefix@
VPATH = @srcdir@
CC=@CC@
LIBS=@MLIBS@ fec.o sim.o viterbi27.o viterbi27_port.o viterbi29.o viterbi29_port.o \
viterbi39.o viterbi39_port.o \
viterbi615.o viterbi615_port.o encode_rs_char.o encode_rs_int.o encode_rs_8.o \
decode_rs_char.o decode_rs_int.o decode_rs_8.o \
init_rs_char.o init_rs_int.o ccsds_tab.o \
encode_rs_ccsds.o decode_rs_ccsds.o ccsds_tal.o \
dotprod.o dotprod_port.o \
peakval.o peakval_port.o \
sumsq.o sumsq_port.o
CFLAGS=@CFLAGS@ -I. -fPIC -Wall @ARCH_OPTION@
SHARED_LIB=@SH_LIB@
all: libfec.a $(SHARED_LIB)
test: vtest27 vtest29 vtest39 vtest615 rstest dtest sumsq_test peaktest
@echo "Correctness tests:"
./vtest27 -e 3.0 -n 1000 -v
./vtest29 -e 2.5 -n 1000 -v
./vtest39 -e 2.5 -n 1000 -v
./vtest615 -e 1.0 -n 100 -v
./rstest
./dtest
./sumsq_test
./peaktest
@echo "Speed tests:"
./vtest27
./vtest29
./vtest39
./vtest615
install: all
mkdir -p $(DESTDIR)@libdir@
install -m 644 -p $(SHARED_LIB) libfec.a $(DESTDIR)@libdir@
# (cd $(DESTDIR)@libdir@;ln -f -s $(SHARED_LIB) libfec.so)
@REBIND@
mkdir -p $(DESTDIR)@includedir@
install -m 644 -p fec.h $(DESTDIR)@includedir@
mkdir -m 0755 -p $(DESTDIR)@mandir@/man3
install -m 644 -p simd-viterbi.3 rs.3 dsp.3 $(DESTDIR)@mandir@/man3
peaktest: peaktest.o libfec.a
gcc $(CFLAGS) -g -o $@ $^
sumsq_test: sumsq_test.o libfec.a
gcc $(CFLAGS) -g -o $@ $^
dtest: dtest.o libfec.a
gcc $(CFLAGS) -g -o $@ $^ -lm
vtest27: vtest27.o libfec.a
gcc $(CFLAGS) -g -o $@ $^ -lm
vtest29: vtest29.o libfec.a
gcc $(CFLAGS) -g -o $@ $^ -lm
vtest39: vtest39.o libfec.a
gcc $(CFLAGS) -g -o $@ $^ -lm
vtest615: vtest615.o libfec.a
gcc $(CFLAGS) -g -o $@ $^ -lm
rstest: rstest.o libfec.a
gcc $(CFLAGS) -g -o $@ $^
rs_speedtest: rs_speedtest.o libfec.a
gcc $(CFLAGS) -g -o $@ $^
# for some reason, the test programs without args segfault on the PPC with -O2 optimization. Dunno why - compiler bug?
vtest27.o: vtest27.c fec.h
gcc $(CFLAGS) -g -c $<
vtest29.o: vtest29.c fec.h
gcc $(CFLAGS) -g -c $<
vtest39.o: vtest39.c fec.h
gcc $(CFLAGS) -g -c $<
vtest615.o: vtest615.c fec.h
gcc $(CFLAGS) -g -c $<
libfec.a: $(LIBS)
ar rv $@ $^
ranlib libfec.a
# for Darwin
libfec.dylib: $(LIBS)
$(CC) -dynamiclib -install_name $@ -o $@ $^
# for Linux et al
libfec.so: $(LIBS)
gcc -fPIC -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive -lc -lm
dotprod.o: dotprod.c fec.h
dotprod_port.o: dotprod_port.c fec.h
viterbi27.o: viterbi27.c fec.h
viterbi27_port.o: viterbi27_port.c fec.h
viterbi29.o: viterbi29.c fec.h
viterbi39.o: viterbi39.c fec.h
viterbi39_port.o: viterbi39_port.c fec.h
viterbi39_sse2.o: viterbi39_sse2.c fec.h
viterbi39_sse.o: viterbi39_sse.c fec.h
viterbi39_mmx.o: viterbi39_mmx.c fec.h
encode_rs_char.o: encode_rs_char.c char.h rs-common.h
encode_rs_int.o: encode_rs_int.c int.h rs-common.h
encode_rs_8.o: encode_rs_8.c fixed.h
encode_rs_av.o: encode_rs_av.c fixed.h
decode_rs_char.o: decode_rs_char.c char.h rs-common.h
decode_rs_int.o: decode_rs_int.c int.h rs-common.h
decode_rs_8.o: decode_rs_8.c fixed.h
init_rs_char.o: init_rs_char.c char.h rs-common.h
init_rs_int.o: init_rs_int.c int.h rs-common.h
ccsds_tab.o: ccsds_tab.c
ccsds_tab.c: gen_ccsds
./gen_ccsds > ccsds_tab.c
gen_ccsds: gen_ccsds.o init_rs_char.o
gcc $(CFLAGS) -o $@ $^
gen_ccsds.o: gen_ccsds.c
gcc $(CFLAGS) -c -o $@ $<
ccsds_tal.o: ccsds_tal.c
ccsds_tal.c: gen_ccsds_tal
./gen_ccsds_tal > ccsds_tal.c
exercise_char.o: exercise.c
gcc $(CFLAGS) -c -o $@ $<
exercise_int.o: exercise.c
gcc -DBIGSYM=1 $(CFLAGS) -c -o $@ $<
exercise_8.o: exercise.c
gcc -DFIXED=1 $(CFLAGS) -c -o $@ $<
exercise_ccsds.o: exercise.c
gcc -DCCSDS=1 $(CFLAGS) -c -o $@ $<
viterbi27.o: viterbi27.c fec.h
viterbi27_port.o: viterbi27_port.c fec.h
viterbi27_av.o: viterbi27_av.c fec.h
viterbi27_mmx.o: viterbi27_mmx.c fec.h
gcc $(CFLAGS) -mmmx -c -o $@ $<
viterbi27_sse.o: viterbi27_sse.c fec.h
gcc $(CFLAGS) -msse -c -o $@ $<
viterbi27_sse2.o: viterbi27_sse2.c fec.h
gcc $(CFLAGS) -msse2 -c -o $@ $<
viterbi29.o: viterbi29.c fec.h
viterbi29_port.o: viterbi29_port.c fec.h
viterbi29_av.o: viterbi29_av.c fec.h
viterbi29_mmx.o: viterbi29_mmx.c fec.h
gcc $(CFLAGS) -mmmx -c -o $@ $<
viterbi29_sse.o: viterbi29_sse.c fec.h
gcc $(CFLAGS) -msse -c -o $@ $<
viterbi29_sse2.o: viterbi29_sse2.c fec.h
gcc $(CFLAGS) -msse2 -c -o $@ $<
viterbi39.o: viterbi39.c fec.h
viterbi39_port.o: viterbi39_port.c fec.h
viterbi39_av.o: viterbi39_av.c fec.h
viterbi39_mmx.o: viterbi39_mmx.c fec.h
gcc $(CFLAGS) -mmmx -c -o $@ $<
viterbi39_sse.o: viterbi39_sse.c fec.h
gcc $(CFLAGS) -msse -c -o $@ $<
viterbi39_sse2.o: viterbi39_sse2.c fec.h
gcc $(CFLAGS) -msse2 -c -o $@ $<
viterbi615.o: viterbi615.c fec.h
viterbi615_port.o: viterbi615_port.c fec.h
viterbi615_av.o: viterbi615_av.c fec.h
viterbi615_mmx.o: viterbi615_mmx.c fec.h
gcc $(CFLAGS) -mmmx -c -o $@ $<
viterbi615_sse.o: viterbi615_sse.c fec.h
gcc $(CFLAGS) -msse -c -o $@ $<
viterbi615_sse2.o: viterbi615_sse2.c fec.h
gcc $(CFLAGS) -msse2 -c -o $@ $<
cpu_mode_x86.o: cpu_mode_x86.c fec.h
cpu_mode_x86_64.o: cpu_mode_x86_64.c fec.h
cpu_mode_ppc.o: cpu_mode_ppc.c fec.h
#%.o: %.s
# $(AS) $< -o $@
clean:
rm -f *.o $(SHARED_LIB) *.a rs_speedtest peaktest sumsq_test dtest vtest27 vtest29 vtest39 vtest615 rstest ccsds_tab.c ccsds_tal.c gen_ccsds gen_ccsds_tal core
rm -rf autom4te.cache
distclean: clean
rm -f config.log config.cache config.status config.h makefile