-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.single
65 lines (49 loc) · 1.28 KB
/
Makefile.single
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
VERSION = 0.9.26
PREFIX = /usr/local
DESTDIR =
CXX ?= g++
STRIP ?= strip
ifdef DEBUG
OPTS = -fPIC -DPIC -g -DDEBUG
else
# OPTS = -O2 -Wall -fPIC -DPIC
OPTS = -O3 -ffast-math -funroll-loops -Wall -fPIC -DPIC -fdata-sections -ffunction-sections
ifndef MACOS
LDFLAGS += -Wl,--strip-all
endif
endif
CXXFLAGS += $(OPTS) -I../.. -fvisibility=hidden -fvisibility-inlines-hidden
LDFLAGS += -fdata-sections -ffunction-sections
ifdef MACOS
LDFLAGS += -dynamiclib -Wl,-dead_strip -Wl,-dead_strip_dylibs
else
LDFLAGS += -shared -Wl,--gc-sections -Wl,--no-undefined
endif
SOURCES = __SOURCES__
OBJECTS = $(SOURCES:.cc=.o)
PLUG = __EFFECT__
BUNDLE = mod-caps-$(PLUG).lv2
ifndef LV2_DEST
LV2DEST = $(PREFIX)/lib/lv2/$(BUNDLE)
else
LV2DEST = $(LV2_DEST)/$(BUNDLE)
endif
# targets following -------------------------------------------------------------
all: .depend $(PLUG).so
$(PLUG).so: $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
.cc.s:
$(CXX) $< $(CXXFLAGS) -S
.cc.o: .depend
$(CXX) $< $(CXXFLAGS) -o $@ -c
install: all
install -d $(DESTDIR)$(LV2DEST)
install -m 644 *.ttl *.so $(DESTDIR)$(LV2DEST)
cp -r modgui $(DESTDIR)$(LV2DEST)
uninstall:
-rm -rf $(LV2DEST)
clean:
rm -f $(OBJECTS) $(PLUG).so *.s .depend
.depend: $(SOURCES)
$(CXX) -MM $(CXXFLAGS) $(SOURCES) > .depend
-include .depend