From d30580c14316885e30e0de6a2c365f5623c2dc7f Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 21 Feb 2021 16:24:55 +0100 Subject: Separate libfft0 from libfft-dev --- Makefile | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3