summaryrefslogtreecommitdiff
path: root/Makefile
blob: b2a5055964c16d2b360765120040b536ef03b4af (plain)
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
PLUGIN_NAME=plugintest
PLUGIN_URI=http://example.org/plugintest

CXXFLAGS = -DX11 -I. -fPIC  -std=c++11 -Wall -shared -Wl,--no-undefined \
	-fvisibility=hidden

LV2_CXXFLAGS = -DLV2 -g -Werror -DLV2_PLUGIN_URI=\"$(PLUGIN_URI)\"
LV2_SRC = \
	pluginlv2.cc \
	midievent.cc \
	plugintest.cc


VST_PATH=../drumgizmo.broken/vst/vstsdk2.4
VST_SRC_BASE=$(VST_PATH)/public.sdk/source/vst2.x/
VST_CXXFLAGS=-DVST -I$(VST_PATH)
VST_SRC = \
	${VST_SRC_BASE}/audioeffectx.cpp \
	${VST_SRC_BASE}/audioeffect.cpp \
	${VST_SRC_BASE}/vstplugmain.cpp \
	pluginvst.cc \
	midievent.cc \
	plugintest.cc

## LV2 targets

$(PLUGIN_NAME)_lv2.so: $(LV2_SRC)
	g++ $(CXXFLAGS) $(LV2_CXXFLAGS) $(LV2_SRC) -lX11  -o$(PLUGIN_NAME)_lv2.so

install-lv2: $(PLUGIN_NAME)_lv2.so
	mkdir -p lib/lv2/$(PLUGIN_NAME)
	cp manifest.ttl $(PLUGIN_NAME)_lv2.so lib/lv2/$(PLUGIN_NAME)

test-lv2: install-lv2
	LV2_PATH="$(PWD)/lib/lv2" lv2_inspect $(PLUGIN_URI)
	carla-discovery-native lv2 $(PWD)/lib/lv2/$(PLUGIN_NAME)

clean-lv2:
	rm -f $(PLUGIN_NAME)_lv2.so

## VST targets

$(PLUGIN_NAME)_vst.so: $(VST_SRC)
	g++ $(CXXFLAGS) $(VST_CXXFLAGS) $(VST_SRC) -lX11 -o$(PLUGIN_NAME)_vst.so

install-vst: $(PLUGIN_NAME)_vst.so
	mkdir -p lib/vst/$(PLUGIN_NAME)
	cp $(PLUGIN_NAME)_vst.so lib/vst/$(PLUGIN_NAME)

test-vst: install-vst
	carla-discovery-native vst lib/vst/$(PLUGIN_NAME)/$(PLUGIN_NAME)_vst.so

clean-vst:
	rm -f $(PLUGIN_NAME)_vst.so

## Common targets

install: install-lv2 install-vst

test: test-lv2 test-vst

all: $(PLUGIN_NAME)_lv2.so $(PLUGIN_NAME)_vst.so

clean: clean-lv2 clean-vst

ttlgen: ttlgen.cc $(PLUGIN_NAME)_lv2.so
	g++ -I. -std=c++11 ttlgen.cc -ldl -o ttlgen
	./ttlgen ./$(PLUGIN_NAME)_lv2.so manifest.ttl