forked from mia-0/rubberband
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
109 lines (87 loc) · 3.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
PREFIX := /usr/local
LIBDIR := $(PREFIX)/lib
INCLUDEDIR := $(PREFIX)/include
ifeq ($(OS),Windows_NT)
OPTFLAGS := -g -O3 -Wall
else
OPTFLAGS := -fPIC -g -O3 -Wall
endif
override CFLAGS := $(OPTFLAGS) $(CFLAGS)
override CXXFLAGS := $(OPTFLAGS) -DUSE_PTHREADS -DNDEBUG -I. -Isrc -Irubberband $(CXXFLAGS)
override LDFLAGS := -pthread $(LDFLAGS)
MKDIR := mkdir
AR := ar
INSTALL_INCDIR := $(INCLUDEDIR)/rubberband
INSTALL_LIBDIR := $(LIBDIR)
INSTALL_PKGDIR := $(LIBDIR)/pkgconfig
LIBNAME := librubberband
DYNAMIC_EXTENSION := .so
DYNAMIC_FULL_VERSION := 2.1.0
DYNAMIC_ABI_VERSION := 2
DYNAMIC_NAME := $(LIBNAME)$(DYNAMIC_EXTENSION)
DYNAMIC_FULL_NAME := $(DYNAMIC_NAME).$(DYNAMIC_FULL_VERSION)
DYNAMIC_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,-soname=$(DYNAMIC_NAME).$(DYNAMIC_ABI_VERSION)
STATIC_NAME := $(LIBNAME).a
STATIC_TARGET := lib/$(STATIC_NAME)
DYNAMIC_TARGET := lib/$(DYNAMIC_NAME)
PUBLIC_INCLUDES := \
rubberband/rubberband-c.h \
rubberband/RubberBandStretcher.h
LIBRARY_SOURCES := \
src/RubberBandStretcher.cpp \
src/StretchCalculator.cpp \
src/StretcherChannelData.cpp \
src/StretcherImpl.cpp \
src/StretcherProcess.cpp \
src/audiocurves/CompoundAudioCurve.cpp \
src/audiocurves/ConstantAudioCurve.cpp \
src/audiocurves/HighFrequencyAudioCurve.cpp \
src/audiocurves/PercussiveAudioCurve.cpp \
src/audiocurves/SilentAudioCurve.cpp \
src/audiocurves/SpectralDifferenceAudioCurve.cpp \
src/dsp/AudioCurveCalculator.cpp \
src/dsp/FFT.cpp \
src/dsp/Resampler.cpp \
src/kissfft/kiss_fft.c \
src/kissfft/kiss_fftr.c \
src/rubberband-c.cpp \
src/speex/resample.c \
src/system/Thread.cpp \
src/system/sysutils.cpp
LIBRARY_OBJECTS := $(LIBRARY_SOURCES:.cpp=.o)
LIBRARY_OBJECTS := $(LIBRARY_OBJECTS:.c=.o)
all: static dynamic
$(STATIC_TARGET): $(LIBRARY_OBJECTS)
$(AR) rsc $@ $^
$(DYNAMIC_TARGET): $(LIBRARY_OBJECTS)
$(CXX) $(DYNAMIC_LDFLAGS) $^ -o $@ $(LDFLAGS)
lib:
$(MKDIR) $@
static: lib $(STATIC_TARGET)
dynamic:lib $(DYNAMIC_TARGET)
install-headers:
sed "s,%PREFIX%,$(PREFIX),;s,%LIBDIR%,$(INSTALL_LIBDIR),;s,%INCLUDEDIR%,$(INSTALL_INCDIR)," rubberband.pc.in > rubberband.pc
install -d $(DESTDIR)$(INSTALL_PKGDIR)
install -d $(DESTDIR)$(INSTALL_INCDIR)
install -m 644 rubberband.pc $(DESTDIR)$(INSTALL_PKGDIR)/rubberband.pc
install -m 644 $(PUBLIC_INCLUDES) $(DESTDIR)$(INSTALL_INCDIR)
install-static: static install-headers
install -d $(DESTDIR)$(INSTALL_LIBDIR)
install -m644 $(STATIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)
install-dynamic: dynamic install-headers
install -d $(DESTDIR)$(INSTALL_LIBDIR)
install -m 755 $(DYNAMIC_TARGET) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_FULL_NAME)
ln -sf $(DYNAMIC_FULL_NAME) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_NAME).$(DYNAMIC_ABI_VERSION)
ln -sf $(DYNAMIC_FULL_NAME) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_NAME)
install: all install-static install-dynamic
uninstall:
rm -f -- $(DESTDIR)$(INSTALL_PKGDIR)/rubberband.pc
rm -f -- $(DESTDIR)$(INSTALL_LIBDIR)/$(STATIC_NAME)
rm -f -- $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_FULL_NAME) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_NAME).$(DYNAMIC_ABI_VERSION) $(DYNAMIC_FULL_NAME) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_NAME)
rm -rf -- $(DESTDIR)$(INSTALL_INCDIR)
clean:
rm -f -- $(LIBRARY_OBJECTS)
distclean: clean
rm -f -- $(STATIC_TARGET) $(DYNAMIC_TARGET)
rm -rf lib
.PHONY: clean install-headers