-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
57 lines (47 loc) · 1.44 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
SHELL := /bin/bash
deps = $(PWD)/deps/
CXXFLAGS+=-g --std=c++17 -Wall -Wextra -Wpedantic
CPPFLAGS+=-I"$(PWD)/deps/include"
LDFLAGS+=-L"$(PWD)/deps/lib64" -L"$(PWD)/deps/lib"
ifdef DEBUG
CXXFLAGS+=-O0
else
CXXFLAGS+=-O3
endif
# Detect android
ifneq ($(strip $(shell uname -a | grep Android)),)
libportaudio=$(libportaudio_android) -lOpenSLES -l7z
libportaudio_dep=$(libportaudio_android)
else
libportaudio=-lportaudio
libportaudio_dep=
endif
.PHONY: all clean clean-deps clean-all
all: sndlink
libspeexdsp=deps/lib/libspeexdsp.a
$(libspeexdsp):
mkdir -p deps/{build,lib,lib32,lib64,include,bin,sbin}
rm -Rf deps/build/speexdsp
cp -R vendor/speexdsp deps/build/speexdsp
cd deps/build/speexdsp \
&& ./autogen.sh \
&& ./configure --prefix="$(deps)" \
&& $(MAKE) install
libportaudio_android=deps/lib/libportaudio.a
$(libportaudio_android):
mkdir -p deps/{build,lib,lib32,lib64,include,bin,sbin}
rm -Rf deps/build/portaudio_opensles/
cp -R vendor/portaudio_opensles deps/build/portaudio_opensles
cd deps/build/portaudio_opensles \
&& patch configure.in ../../../portaudio_opensles_config.in.diff \
&& autoconf \
&& ./configure --prefix="$(deps)" --with-opensles \
&& $(MAKE) install
sndlink: ./sndlink.cpp Makefile $(libspeexdsp) $(libportaudio_dep)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ \
$(libspeexdsp) $(libportaudio) -lboost_system -lpthread
clean:
rm sndlink -fv
clean-deps:
rm -rfv ./deps
clean-all: clean clean-deps