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 +++++++++++++++++++++++++---- debian/changelog | 2 +- debian/control | 16 +++++++++++++++- debian/copyright | 2 ++ debian/libfft-dev.install | 2 ++ debian/libfft0.install | 2 ++ fft.cpp | 3 --- 7 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 debian/libfft-dev.install create mode 100644 debian/libfft0.install 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 diff --git a/debian/changelog b/debian/changelog index e66003e..8969a9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,4 +2,4 @@ fft (1.0) unstable; urgency=medium * First version - -- Roland Reichwein Thu, 20 Jan 2021 18:59:59 +0200 + -- Roland Reichwein Sun, 21 Feb 2021 16:17:08 +0100 diff --git a/debian/control b/debian/control index 811dcf8..b4091b1 100644 --- a/debian/control +++ b/debian/control @@ -11,4 +11,18 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Homepage: http://www.reichwein.it/unicode/ Description: FFT library for C++ - libfft is a Fast Fourier Transform library for C++. It supports C++17 and C++20. + libfft is a Fast Fourier Transform library for C++. It supports C++17 and + C++20. + . + This is the package for developers for compiling code against libfft. It + includes the header files and static library. + +Package: libfft0 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Homepage: http://www.reichwein.it/unicode/ +Description: FFT library for C++ + libfft is a Fast Fourier Transform library for C++. It supports C++17 and + C++20. + . + This is the runtime library package including the shared library. diff --git a/debian/copyright b/debian/copyright index 850d014..d1dbdca 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,3 +3,5 @@ Author: Roland Reichwein , 2021 Both upstream source code and Debian packaging is available under the conditions of CC0 1.0 Universal https://creativecommons.org/publicdomain/zero/1.0/ + +I.e. the package is in the public domain, where applicable. diff --git a/debian/libfft-dev.install b/debian/libfft-dev.install new file mode 100644 index 0000000..7b868eb --- /dev/null +++ b/debian/libfft-dev.install @@ -0,0 +1,2 @@ +usr/include/fft.h +usr/lib/libfft.so diff --git a/debian/libfft0.install b/debian/libfft0.install new file mode 100644 index 0000000..00c98df --- /dev/null +++ b/debian/libfft0.install @@ -0,0 +1,2 @@ +usr/lib/libfft.so.0 +usr/lib/libfft.so.0.0.0 diff --git a/fft.cpp b/fft.cpp index 12aeece..c89c3a3 100644 --- a/fft.cpp +++ b/fft.cpp @@ -16,9 +16,6 @@ #include -namespace { // Helper functions -} - RIT::FFT::FFT(int size, bool halfOnly): mSize(size), order(size), expLUT(size/2), mFlagHalfOnly(halfOnly) { if (!is_power_of_two(size)) -- cgit v1.2.3