forked from mod-audio/mod-pitchshifter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.mk
47 lines (34 loc) · 1006 Bytes
/
Makefile.mk
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
# compiler
CXX ?= g++
# flags
CXXFLAGS += -O3 -ffast-math -Wall -fPIC -DPIC $(shell pkg-config --cflags fftw3f) -I. -I../Shared_files
LDFLAGS += -shared -Wl,-O1 -Wl,--as-needed -Wl,--no-undefined -Wl,--strip-all $(shell pkg-config --libs fftw3f) -larmadillo -lm
ifneq ($(NOOPT),true)
CXXFLAGS += -mtune=generic -msse -msse2 -mfpmath=sse
endif
# remove command
RM = rm -f
# plugin name
PLUGIN = mod-$(shell basename $(shell pwd) | tr A-Z a-z)
PLUGIN_SO = $(PLUGIN).so
# effect path
EFFECT_PATH = $(PLUGIN).lv2
# installation path
ifndef INSTALL_PATH
INSTALL_PATH = /usr/local/lib/lv2
endif
INSTALLATION_PATH = $(DESTDIR)$(INSTALL_PATH)/$(EFFECT_PATH)
# sources and objects
SRC = $(wildcard src/*.cpp) $(wildcard ../Shared_files/*.cpp)
OBJ = $(SRC:.cpp=.o)
## rules
all: $(PLUGIN_SO)
$(PLUGIN_SO): $(OBJ)
$(CXX) $^ $(LDFLAGS) -o $@
clean:
$(RM) *.so src/*.o
install: all
mkdir -p $(INSTALLATION_PATH)
cp -rL $(PLUGIN_SO) ttl/* $(INSTALLATION_PATH)
%.o: %.cpp
$(CXX) $< $(CXXFLAGS) -c -o $@