diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -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 |