forked from unknownError/pdLV2-stereo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
48 lines (35 loc) · 1.38 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
INSTALL_DIR = $(HOME)/.lv2/
BUILD_DIR = build
SOURCES = $(wildcard plugins/*)
BUILD_DIRS = $(addsuffix .lv2, $(addprefix $(BUILD_DIR)/pdlv2-, $(notdir $(SOURCES))))
HEADERS = $(addsuffix /plugin.h, $(BUILD_DIRS))
PLUGINS = $(addsuffix /pdlv2.so, $(BUILD_DIRS))
LVTKLIB = lvtk/build/src/liblvtk_plugin2.a
LDFLAGS += -ldl ${LVTKLIB}
CXXFLAGS += -Wl,--no-as-needed -Wno-narrowing -shared -fPIC -DPIC -Isrc/ -std=c++11 -Ilvtk/
LIBPD_FLAGS = UTIL=true EXTRA=true
LIBPD_SO = libpd/libs/libpd.so
RUBY = ruby
#make the headers stick around so we can inspect them
#delete this line if you don't want them in your output directories
.SECONDARY: $(HEADERS)
all: $(PLUGINS)
$(BUILD_DIR)/pdlv2-%.lv2/pdlv2.so: $(BUILD_DIR)/pdlv2-%.lv2/plugin.h src/plugin.cpp $(LVTKLIB)
$(CXX) $(CXXFLAGS) src/plugin.cpp -I$(dir $<) -o $@ $(LDFLAGS)
$(BUILD_DIR)/pdlv2-%.lv2/plugin.h: plugins/%/plugin.pd src/process.rb src/host.pd $(LIBPD_SO)
$(RUBY) src/process.rb $< $(dir $@)
cp -r $(LIBPD_SO) $(dir $<)/* $(dir $@)
$(LVTKLIB):
cd lvtk/ && ./waf configure && ./waf
$(LIBPD_SO):
cd libpd/ && make libpd $(LIBPD_FLAGS)
install: $(PLUGINS)
mkdir -p $(INSTALL_DIR)
cp -r $(BUILD_DIR)/* $(INSTALL_DIR)
test: install
#jalv.gtk http://x37v.info/pdlv2/templateplugin.html
jalv.gtk http://x37v.info/pdlv2/djfilter.html
#jalv.gtk http://x37v.info/pdlv2/mididemoplugin.html
clean:
rm -rf build
cd libpd/ && make clobber