-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
106 lines (75 loc) · 3.78 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
VERSION=0.8
REFRESH=""
ARCH=$(shell uname -m)
# normal CFLAGS
CFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -fgnu89-inline -DREFRESH$(REFRESH)
# CFLAGS without optimization
CFLAGSNO=-O0 -Wall -D_FILE_OFFSET_BITS=64 -fgnu89-inline -DREFRESH$(REFRESH)
# targets
ALL: bin tmp bin/volrace bin/bufhrt bin/highrestest \
bin/writeloop bin/catloop bin/playhrt bin/cptoshm bin/shmcat \
bin/resample_soxr bin/cat64
bin:
mkdir -p bin
tmp:
mkdir -p tmp
src/version.h: Makefile
echo "#define VERSION \""$(VERSION)"\"" > src/version.h
bin/volrace: src/version.h src/volrace.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGS) -o bin/volrace src/volrace.c tmp/cprefresh.o tmp/cprefresh_ass.o
tmp/net.o: src/net.h src/net.c |tmp
$(CC) $(CFLAGS) -c -o tmp/net.o src/net.c
tmp/cprefresh_ass.o: src/cprefresh_default.s src/cprefresh_vfp.s src/cprefresh_arm.s |tmp
if [ $(REFRESH) = "" ]; then \
$(CC) -c $(CFLAGSNO) -o tmp/cprefresh_ass.o src/cprefresh_default.s; \
elif [ $(REFRESH) = "ARM" ]; then \
$(CC) -c $(CFLAGSNO) -marm -o tmp/cprefresh_ass.o src/cprefresh_arm.s; \
elif [ $(REFRESH) = "VFP" ]; then \
$(CC) -c $(CFLAGSNO) -marm -mfpu=neon-vfpv4 -o tmp/cprefresh_ass.o src/cprefresh_vfp.s; \
fi
tmp/cprefresh.o: src/cprefresh.h src/cprefresh.c |tmp
$(CC) -c $(CFLAGSNO) -o tmp/cprefresh.o src/cprefresh.c
bin/playhrt: src/version.h tmp/net.o src/playhrt.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGSNO) -o bin/playhrt src/playhrt.c tmp/net.o tmp/cprefresh.o tmp/cprefresh_ass.o -lasound -lrt
bin/playhrt_ALSANC: src/version.h tmp/net.o src/playhrt.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGSNO) -DALSANC -I$(ALSANC)/include -L$(ALSANC)/lib -o bin/playhrt_ALSANC src/playhrt.c tmp/net.o tmp/cprefresh.o tmp/cprefresh_ass.o -lasound -lrt
bin/playhrt_static: src/version.h tmp/net.o src/playhrt.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGSNO) -DALSANC -I$(ALSANC)/include -L$(ALSANC)/lib -o bin/playhrt_static src/playhrt.c tmp/net.o tmp/cprefresh.o tmp/cprefresh_ass.o -lasound -lrt -lpthread -lm -ldl -static
bin/bufhrt: src/version.h tmp/net.o src/bufhrt.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGSNO) -o bin/bufhrt tmp/net.o tmp/cprefresh.o tmp/cprefresh_ass.o src/bufhrt.c -lpthread -lrt
bin/highrestest: src/highrestest.c |bin
$(CC) $(CFLAGSNO) -o bin/highrestest src/highrestest.c -lrt
bin/writeloop: src/version.h src/writeloop.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGS) -o bin/writeloop tmp/cprefresh.o tmp/cprefresh_ass.o src/writeloop.c -lpthread -lrt
bin/catloop: src/version.h src/catloop.c |bin
$(CC) $(CFLAGS) -o bin/catloop src/catloop.c -lpthread -lrt
bin/cptoshm: src/version.h src/cptoshm.c tmp/cprefresh_ass.o tmp/cprefresh.o |bin
$(CC) $(CFLAGS) -o bin/cptoshm src/cptoshm.c tmp/cprefresh_ass.o tmp/cprefresh.o -lrt
bin/shmcat: src/version.h src/shmcat.c tmp/cprefresh_ass.o tmp/cprefresh.o |bin
$(CC) $(CFLAGS) -o bin/shmcat tmp/cprefresh_ass.o tmp/cprefresh.o src/shmcat.c -lrt
bin/resample_soxr: src/version.h src/resample_soxr.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGS) -o bin/resample_soxr src/resample_soxr.c tmp/cprefresh.o tmp/cprefresh_ass.o -lsoxr -lsndfile -lrt
resampler: bin/resample_soxr
bin/cat64: src/version.h src/cat64.c tmp/cprefresh.o tmp/cprefresh_ass.o |bin
$(CC) $(CFLAGS) -o bin/cat64 src/cat64.c tmp/cprefresh.o tmp/cprefresh_ass.o -lsndfile -lrt
clean:
rm -rf src/version.h bin tmp
veryclean: clean
rm -f *~ */*~ */*/*~
# private, for bin in distribution
bin86:
make veryclean
make
cd bin; \
strip * ; \
tar cvf frankl_stereo-$(VERSION)-bin-$(ARCH).tar * ; \
gzip -9 frankl*.tar ; \
mv frankl*gz ..
binPi:
make veryclean
make REFRESH=VFP
cd bin; \
strip * ; \
tar cvf frankl_stereo-$(VERSION)-bin-$(ARCH).tar * ; \
gzip -9 frankl*.tar ; \
mv frankl*gz ..