PLUGIN_NAME=plugintest PLUGIN_URI=http://example.org/plugintest CXXFLAGS = -DX11 -I. -fPIC -std=c++11 -Wall -shared -Wl,--no-undefined LV2_CXXFLAGS = -DLV2 -g -Werror -DLV2_PLUGIN_URI=\"$(PLUGIN_URI)\" LV2_SRC = \ pluginlv2.cc \ midievent.cc \ plugintest.cc VST_PATH=/path/to/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