summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c6cd4e3..06328f0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
+PORTAUDIOCFLAGS=$(shell pkg-config --cflags portaudiocpp)
+PORTAUDIOLIBS=$(shell pkg-config --libs portaudiocpp)
+
CXX=clang++-7
-CXXFLAGS=-stdlib=libc++ -Wall -O2 -std=c++17
+CXXFLAGS=-stdlib=libc++ -Wall -O2 -std=c++17 -fexceptions
#-march=native -mtune=native # is not better for llvm
# libstdc++-8 doesn't have transform_reduce
@@ -12,8 +15,8 @@ PREFIX=/usr/local/bin
all: tunerdemo testsuite
-tunerdemo: util.o fft.o autocorrelation.o tuner.o tunerdemo.o
- $(CXX) $(CXXFLAGS) -o $@ $^
+tunerdemo: audioio.o util.o fft.o autocorrelation.o tuner.o tunerdemo.o
+ $(CXX) $(CXXFLAGS) $(PORTAUDIOLIBS) -o $@ $^
testsuite: util.o fft.o autocorrelation.o tuner.o testsuite.o
$(CXX) $(CXXFLAGS) -o $@ $^
@@ -30,6 +33,9 @@ tuner.o: tuner.cpp tuner.h
util.o: util.cpp util.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
+audioio.o: audioio.cpp audioio.h
+ $(CXX) $(CXXFLAGS) $(PORTAUDIOCFLAGS) -c -o $@ $<
+
testsuite.o: testsuite.cpp fft.h autocorrelation.h tuner.h
$(CXX) $(CXXFLAGS) -c -o $@ $<