summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2021-02-21 16:24:55 +0100
committerRoland Reichwein <mail@reichwein.it>2021-02-21 16:24:55 +0100
commitd30580c14316885e30e0de6a2c365f5623c2dc7f (patch)
tree17f4b5efa3efdcb272dcb920d9b6c9ef0440080c /Makefile
parent5b951a8fd1b380daab4f9e470425236f70ac0c8f (diff)
Separate libfft0 from libfft-dev
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 25 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index bba1d16..c414123 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ CXXFLAGS=-O2 -DNDEBUG
endif
CXXFLAGS+=-stdlib=libc++
CXXFLAGS+=-Wall
-CXXFLAGS+=-std=c++17 -fexceptions -Iexternal
+CXXFLAGS+=-std=c++17 -fexceptions -Iexternal -fPIC
#-march=native -mtune=native # is not better for llvm
CC=clang
CFLAGS=-Wall -O2 -Iexternal
@@ -22,7 +22,21 @@ CFLAGS=-Wall -O2 -Iexternal
DESTDIR=/
PREFIX=/usr/bin
-all: tunerdemo testsuite
+SONAME1=libfft.so
+SONAME2=libfft.so.0
+SONAME3=libfft.so.0.0.0
+
+all: staticlib sharedlib tunerdemo testsuite
+
+staticlib: fft.a
+
+fft.a: fft.o util.o
+ ar rcs $@ $^
+
+sharedlib: $(SONAME3)
+
+$(SONAME3): fft.o util.o
+ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(SONAME2) -o $@ $^
tunerdemo: audioio.o external/pa_ringbuffer.o util.o fft.o autocorrelation.o tuner.o tunerdemo.o
$(CXX) $(CXXFLAGS) $(PORTAUDIOLIBS) -o $@ $^
@@ -62,8 +76,15 @@ install:
install tunerdemo $(DESTDIR)/$(PREFIX)/tunerdemo
mkdir -p $(DESTDIR)/usr/include
install fft.h $(DESTDIR)/usr/include/fft.h
+ mkdir -p $(DESTDIR)/usr/lib
+ install $(SONAME3) $(DESTDIR)/usr/lib/$(SONAME3)
+ ln -sf $(SONAME3) $(DESTDIR)/usr/lib/$(SONAME2)
+ ln -sf $(SONAME2) $(DESTDIR)/usr/lib/$(SONAME1)
+
+deb:
+ dpkg-buildpackage -us -uc
clean:
- rm -f tunerdemo testsuite *.o external/*.o
+ rm -f tunerdemo testsuite *.o external/*.o $(SONAME1) $(SONAME2) $(SONAME3) *.a
-.PHONY: clean install all test
+.PHONY: clean install all test staticlib sharedlib