Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

567 lines
22KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-plugin #
  3. # ------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. include $(CWD)/Makefile.mk
  8. # Workaround GCC bug
  9. ifeq ($(TESTBUILD),true)
  10. ifeq ($(USING_JUCE),true)
  11. BUILD_CXX_FLAGS += -Wno-undef
  12. endif
  13. endif
  14. ifneq ($(HAIKU),true)
  15. ifneq ($(WASM),true)
  16. BUILD_CXX_FLAGS += -pthread
  17. endif
  18. endif
  19. # ---------------------------------------------------------------------------------------------------------------------
  20. BINDIR := $(CWD)/../bin
  21. DATADIR := $(CWD)/../data
  22. ifeq ($(DEBUG),true)
  23. OBJDIR := $(CWD)/../build/plugin/Debug
  24. MODULEDIR := $(CWD)/../build/modules/Debug
  25. else
  26. OBJDIR := $(CWD)/../build/plugin/Release
  27. MODULEDIR := $(CWD)/../build/modules/Release
  28. endif
  29. ifeq ($(NEEDS_WINE),true)
  30. EXE_WRAPPER ?= wine
  31. endif
  32. # ---------------------------------------------------------------------------------------------------------------------
  33. BUILD_CXX_FLAGS += -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  34. BUILD_CXX_FLAGS += $(NATIVE_PLUGINS_FLAGS)
  35. ifeq ($(HAVE_LIBLO),true)
  36. BUILD_CXX_FLAGS += $(LIBLO_FLAGS)
  37. endif
  38. ifeq ($(HAVE_FLUIDSYNTH),true)
  39. BUILD_CXX_FLAGS += $(FLUIDSYNTH_FLAGS)
  40. endif
  41. BUILD_CXX_FLAGS += $(YSFX_FLAGS)
  42. ifeq ($(HAVE_X11),true)
  43. BUILD_CXX_FLAGS += $(X11_FLAGS)
  44. endif
  45. # ---------------------------------------------------------------------------------------------------------------------
  46. # Libs
  47. LIBS = $(MODULEDIR)/carla_engine_plugin.a
  48. LIBS += $(MODULEDIR)/carla_plugin.a
  49. LIBS += $(MODULEDIR)/jackbridge.a
  50. LIBS += $(MODULEDIR)/lilv.a
  51. LIBS += $(MODULEDIR)/rtmempool.a
  52. LIBS += $(MODULEDIR)/water.a
  53. LIBS += $(MODULEDIR)/audio_decoder.a
  54. LIBS += $(MODULEDIR)/native-plugins.a
  55. LIBS += $(MODULEDIR)/sfzero.a
  56. LIBS += $(MODULEDIR)/zita-resampler.a
  57. ifeq ($(HAVE_DGL),true)
  58. ifneq ($(USING_CUSTOM_DPF),true)
  59. LIBS += $(MODULEDIR)/dgl.a
  60. else
  61. LIBS += $(CUSTOM_DPF_PATH)/build/libdgl-opengl.a
  62. endif
  63. endif
  64. ifeq ($(HAVE_HYLIA),true)
  65. LIBS += $(MODULEDIR)/hylia.a
  66. endif
  67. ifeq ($(USING_JUCE),true)
  68. LIBS_juce = $(MODULEDIR)/carla_juce.a
  69. LIBS_juce += $(MODULEDIR)/juce_audio_basics.a
  70. LIBS_juce += $(MODULEDIR)/juce_audio_processors.a
  71. LIBS_juce += $(MODULEDIR)/juce_core.a
  72. LIBS_juce += $(MODULEDIR)/juce_data_structures.a
  73. LIBS_juce += $(MODULEDIR)/juce_events.a
  74. LIBS_juce += $(MODULEDIR)/juce_graphics.a
  75. LIBS_juce += $(MODULEDIR)/juce_gui_basics.a
  76. LIBS_juce += $(MODULEDIR)/juce_gui_extra.a
  77. endif
  78. LIBS += $(MODULEDIR)/ysfx.a
  79. # ---------------------------------------------------------------------------------------------------------------------
  80. # Link flags
  81. NATIVE_LINK_FLAGS = $(HYLIA_LIBS)
  82. NATIVE_LINK_FLAGS += $(LINK_FLAGS)
  83. NATIVE_LINK_FLAGS += $(JACKBRIDGE_LIBS)
  84. NATIVE_LINK_FLAGS += $(LILV_LIBS)
  85. NATIVE_LINK_FLAGS += $(RTMEMPOOL_LIBS)
  86. NATIVE_LINK_FLAGS += $(WATER_LIBS)
  87. NATIVE_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  88. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  89. NATIVE_LINK_FLAGS += $(LIBLO_LIBS)
  90. NATIVE_LINK_FLAGS += $(MAGIC_LIBS)
  91. NATIVE_LINK_FLAGS += $(X11_LIBS)
  92. ifeq ($(USING_JUCE),true)
  93. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  94. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  95. LINK_FLAGS += $(JUCE_CORE_LIBS)
  96. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  97. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  98. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  99. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  100. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  101. endif
  102. LINK_FLAGS += $(YSFX_GRAPHICS_LIBS)
  103. ifeq ($(MACOS),true)
  104. SYMBOLS_NATIVE = -Wl,-exported_symbol,_carla_get_native_rack_plugin
  105. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
  106. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay16_plugin
  107. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay32_plugin
  108. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay64_plugin
  109. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay_cv_plugin
  110. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_create_native_plugin_host_handle
  111. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_host_handle_free
  112. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_plugin_engine
  113. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_folder
  114. SYMBOLS_LV2 = -Wl,-exported_symbol,_lv2_descriptor
  115. ifeq ($(HAVE_PYQT),true)
  116. SYMBOLS_LV2 += -Wl,-exported_symbol,_lv2ui_descriptor
  117. SYMBOLS_LV2_UI = -Wl,-exported_symbol,_lv2ui_descriptor
  118. endif
  119. SYMBOLS_VST = -Wl,-exported_symbol,_VSTPluginMain
  120. else ifeq ($(WASM),true)
  121. SYMBOLS_NATIVE = -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="[
  122. SYMBOLS_NATIVE += 'carla_get_native_rack_plugin',
  123. SYMBOLS_NATIVE += 'carla_get_native_patchbay_plugin',
  124. SYMBOLS_NATIVE += 'carla_get_native_patchbay16_plugin',
  125. SYMBOLS_NATIVE += 'carla_get_native_patchbay32_plugin',
  126. SYMBOLS_NATIVE += 'carla_get_native_patchbay64_plugin',
  127. SYMBOLS_NATIVE += 'carla_get_native_patchbay_cv_plugin',
  128. SYMBOLS_NATIVE += 'carla_create_native_plugin_host_handle',
  129. SYMBOLS_NATIVE += 'carla_host_handle_free',
  130. SYMBOLS_NATIVE += 'carla_get_native_plugin_engine'
  131. SYMBOLS_NATIVE += ]"
  132. ifeq ($(HAVE_PYQT),true)
  133. SYMBOLS_LV2 = -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2ui_descriptor']"
  134. SYMBOLS_LV2_UI = -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']"
  135. else
  136. SYMBOLS_LV2 = -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="['lv2_descriptor']"
  137. endif
  138. SYMBOLS_VST = -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="['VSTPluginMain']"
  139. else ifeq ($(WINDOWS),true)
  140. SYMBOLS_NATIVE = symbols/carla-native-plugin.def
  141. SYMBOLS_VST = symbols/carla-vst.def
  142. ifeq ($(HAVE_PYQT),true)
  143. SYMBOLS_LV2 = symbols/carla-lv2_dsp+ui.def
  144. SYMBOLS_LV2_UI = symbols/carla-lv2_ui.def
  145. else
  146. SYMBOLS_LV2 = symbols/carla-lv2_dsp.def
  147. endif
  148. else
  149. SYMBOLS_NATIVE = -Wl,--version-script=symbols/carla-native-plugin.version
  150. SYMBOLS_VST = -Wl,--version-script=symbols/carla-vst.version
  151. ifeq ($(HAVE_PYQT),true)
  152. SYMBOLS_LV2 = -Wl,--version-script=symbols/carla-lv2_dsp+ui.version
  153. SYMBOLS_LV2_UI = -Wl,--version-script=symbols/carla-lv2_ui.version
  154. else
  155. SYMBOLS_LV2 = -Wl,--version-script=symbols/carla-lv2_dsp.version
  156. endif
  157. endif
  158. # ---------------------------------------------------------------------------------------------------------------------
  159. # Other libs
  160. LIBS_ui = $(MODULEDIR)/water.a
  161. LIBS_wine = $(MODULEDIR)/dgl.wine.a
  162. LIBS_wine += $(MODULEDIR)/water.files.a
  163. WINE_LINK_FLAGS = $(LINK_FLAGS)
  164. WINE_LINK_FLAGS += -L$(BINDIR) -lcarla_native-plugin
  165. WINE_LINK_FLAGS += -lstdc++ -lopengl32 -lgdi32 -ldl
  166. WINE_LINK_FLAGS += -Wl,-rpath,/usr/local/lib/carla
  167. WINE_LINK_FLAGS += -Wl,-rpath,/usr/lib/carla
  168. # ---------------------------------------------------------------------------------------------------------------------
  169. TARGETS = \
  170. $(BINDIR)/libcarla_host-plugin$(LIB_EXT) \
  171. $(BINDIR)/libcarla_native-plugin$(LIB_EXT)
  172. # sometimes needed for testing:
  173. # $(BINDIR)/carla-native-plugin$(APP_EXT)
  174. # ---------------------------------------------------------------------------------------------------------------------
  175. ifneq ($(STATIC_PLUGIN_TARGET),true)
  176. TARGETS += \
  177. $(BINDIR)/carla.lv2/carla$(LIB_EXT)
  178. ifeq ($(HAVE_PYQT),true)
  179. TARGETS += \
  180. $(BINDIR)/carla.lv2/carla-ui$(LIB_EXT)
  181. endif
  182. ifeq ($(CAN_GENERATE_LV2_TTL),true)
  183. TARGETS += \
  184. $(BINDIR)/carla.lv2/manifest.ttl
  185. endif
  186. ifneq ($(HAIKU),true)
  187. ifeq ($(HAVE_DGL),true)
  188. ifeq ($(HAVE_PYQT),true)
  189. TARGETS += \
  190. $(BINDIR)/CarlaRack$(LIB_EXT) \
  191. $(BINDIR)/CarlaRackFX$(LIB_EXT) \
  192. $(BINDIR)/CarlaPatchbay$(LIB_EXT) \
  193. $(BINDIR)/CarlaPatchbay16$(LIB_EXT) \
  194. $(BINDIR)/CarlaPatchbay32$(LIB_EXT) \
  195. $(BINDIR)/CarlaPatchbay64$(LIB_EXT) \
  196. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT) \
  197. $(BINDIR)/CarlaVstShell$(LIB_EXT) \
  198. $(BINDIR)/CarlaVstFxShell$(LIB_EXT)
  199. endif
  200. endif
  201. endif
  202. endif # !STATIC_PLUGIN_TARGET
  203. # ---------------------------------------------------------------------------------------------------------------------
  204. all: $(TARGETS)
  205. ifeq ($(WINDOWS),true)
  206. wine: $(BINDIR)/CarlaVstShellBridged.dll $(BINDIR)/CarlaVstFxShellBridged.dll
  207. else
  208. wine: $(BINDIR)/CarlaVstShellBridged.dll.so $(BINDIR)/CarlaVstFxShellBridged.dll.so
  209. endif
  210. static: $(OBJDIR)/carla-host-plugin.cpp.o
  211. # ---------------------------------------------------------------------------------------------------------------------
  212. BUNDLES = audiogain files miditools
  213. bundles: \
  214. $(BINDIR)/carla-audiogain.lv2/manifest.ttl \
  215. $(BINDIR)/carla-audiogain.lv2/carla$(LIB_EXT) \
  216. $(BINDIR)/carla-files.lv2/manifest.ttl \
  217. $(BINDIR)/carla-files.lv2/carla$(LIB_EXT) \
  218. $(BINDIR)/carla-miditools.lv2/manifest.ttl \
  219. $(BINDIR)/carla-miditools.lv2/carla$(LIB_EXT)
  220. BUNDLE_LIBS += $(MODULEDIR)/water.files.a
  221. BUNDLE_LIBS += $(WATER_LIBS)
  222. BUNDLE_FILES_LIBS += $(MODULEDIR)/audio_decoder.a
  223. BUNDLE_FILES_LIBS += $(MODULEDIR)/water.a
  224. BUNDLE_FILES_LIBS += $(MODULEDIR)/zita-resampler.a
  225. BUNDLE_FILES_LIBS += $(AUDIO_DECODER_LIBS)
  226. BUNDLE_FILES_LIBS += $(WATER_LIBS)
  227. # ---------------------------------------------------------------------------------------------------------------------
  228. clean:
  229. rm -f $(OBJDIR)/*.o $(TARGETS)
  230. rm -f $(BINDIR)/carla.lv2/*.*
  231. rm -f $(BINDIR)/carla-lv2-export$(APP_EXT)
  232. rm -rf $(BINDIR)/carla-*.lv2
  233. debug:
  234. $(MAKE) DEBUG=true
  235. # ---------------------------------------------------------------------------------------------------------------------
  236. $(BINDIR)/libcarla_host-plugin$(LIB_EXT): $(OBJDIR)/carla-host-plugin.cpp.o $(LIBS) $(LIBS_juce)
  237. -@mkdir -p $(BINDIR)
  238. @echo "Linking libcarla-host-plugin$(LIB_EXT)"
  239. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(NATIVE_LINK_FLAGS) -o $@
  240. # ---------------------------------------------------------------------------------------------------------------------
  241. $(BINDIR)/carla-native-plugin$(APP_EXT): $(OBJDIR)/carla-native-plugin.cpp.o $(LIBS) $(LIBS_juce)
  242. -@mkdir -p $(BINDIR)
  243. @echo "Linking carla-native-plugin$(APP_EXT)"
  244. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(NATIVE_LINK_FLAGS) -o $@
  245. $(BINDIR)/libcarla_native-plugin$(LIB_EXT): $(OBJDIR)/carla-native-plugin.cpp.o $(LIBS) $(LIBS_juce)
  246. -@mkdir -p $(BINDIR)
  247. @echo "Linking libcarla-native-plugin$(LIB_EXT)"
  248. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_NATIVE) $(NATIVE_LINK_FLAGS) -o $@
  249. # ---------------------------------------------------------------------------------------------------------------------
  250. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS) $(LIBS_juce)
  251. -@mkdir -p $(BINDIR)/carla.lv2
  252. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  253. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_LV2) $(NATIVE_LINK_FLAGS) -o $@
  254. $(BINDIR)/carla.lv2/carla-ui$(LIB_EXT): $(OBJDIR)/carla-lv2-ui.cpp.o $(LIBS_ui)
  255. -@mkdir -p $(BINDIR)/carla.lv2
  256. @echo "Linking carla.lv2/carla-ui$(LIB_EXT)"
  257. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS_ui) $(LIBS_END) $(SHARED) $(SYMBOLS_LV2_UI) $(NATIVE_LINK_FLAGS) -o $@
  258. # ---------------------------------------------------------------------------------------------------------------------
  259. $(BINDIR)/carla-%.lv2/manifest.ttl: $(DATADIR)/lv2-bundles/%/*.ttl
  260. -@mkdir -p $(shell dirname $@)
  261. $(SILENT)cp -v $^ $(shell dirname $@)
  262. $(BINDIR)/carla-audiogain.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2-bundles.cpp.audiogain.o $(MODULEDIR)/native-plugins_audiogain.a
  263. -@mkdir -p $(BINDIR)/carla-audiogain.lv2
  264. @echo "Linking carla-audiogain.lv2/carla$(LIB_EXT)"
  265. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(SHARED) $(SYMBOLS_LV2) $(BUNDLE_LIBS) $(LINK_FLAGS) -ldl -o $@
  266. $(BINDIR)/carla-files.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2-bundles.cpp.files.o $(MODULEDIR)/native-plugins_files.a
  267. -@mkdir -p $(BINDIR)/carla-files.lv2
  268. @echo "Linking carla-files.lv2/carla$(LIB_EXT)"
  269. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(SHARED) $(SYMBOLS_LV2) $(BUNDLE_FILES_LIBS) $(LINK_FLAGS) -o $@
  270. $(BINDIR)/carla-miditools.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2-bundles.cpp.miditools.o $(MODULEDIR)/native-plugins_miditools.a
  271. -@mkdir -p $(BINDIR)/carla-miditools.lv2
  272. @echo "Linking carla-miditools.lv2/carla$(LIB_EXT)"
  273. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(SHARED) $(SYMBOLS_LV2) $(BUNDLE_LIBS) $(LINK_FLAGS) -o $@
  274. # ---------------------------------------------------------------------------------------------------------------------
  275. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(OBJDIR)/carla-vst-export.cpp.o
  276. -@mkdir -p $(BINDIR)
  277. @echo "Linking CarlaRack$(LIB_EXT)"
  278. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  279. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(OBJDIR)/carla-vst-export.cpp.o
  280. -@mkdir -p $(BINDIR)
  281. @echo "Linking CarlaRackFX$(LIB_EXT)"
  282. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  283. $(BINDIR)/CarlaPatchbay$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn.o $(OBJDIR)/carla-vst-export.cpp.o
  284. -@mkdir -p $(BINDIR)
  285. @echo "Linking CarlaPatchbay$(LIB_EXT)"
  286. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  287. $(BINDIR)/CarlaPatchbay16$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o $(OBJDIR)/carla-vst-export.cpp.o
  288. -@mkdir -p $(BINDIR)
  289. @echo "Linking CarlaPatchbay16$(LIB_EXT)"
  290. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  291. $(BINDIR)/CarlaPatchbay32$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o $(OBJDIR)/carla-vst-export.cpp.o
  292. -@mkdir -p $(BINDIR)
  293. @echo "Linking CarlaPatchbay32$(LIB_EXT)"
  294. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  295. $(BINDIR)/CarlaPatchbay64$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn64.o $(OBJDIR)/carla-vst-export.cpp.o
  296. -@mkdir -p $(BINDIR)
  297. @echo "Linking CarlaPatchbay64$(LIB_EXT)"
  298. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  299. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-fx.o $(OBJDIR)/carla-vst-export.cpp.o
  300. -@mkdir -p $(BINDIR)
  301. @echo "Linking CarlaPatchbayFX$(LIB_EXT)"
  302. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  303. # ---------------------------------------------------------------------------------------------------------------------
  304. $(BINDIR)/CarlaVstShell$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.shell.o $(OBJDIR)/carla-vst-export.cpp.o
  305. -@mkdir -p $(BINDIR)
  306. @echo "Linking CarlaVstShell$(LIB_EXT)"
  307. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  308. $(BINDIR)/CarlaVstFxShell$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.shellfx.o $(OBJDIR)/carla-vst-export.cpp.o
  309. -@mkdir -p $(BINDIR)
  310. @echo "Linking CarlaVstFxShell$(LIB_EXT)"
  311. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(SHARED) $(SYMBOLS_VST) $(NATIVE_LINK_FLAGS) -o $@
  312. ifeq ($(WINDOWS),true)
  313. $(BINDIR)/CarlaVstShellBridged.dll: $(OBJDIR)/carla-vst-export-bridged.cpp.synth.o
  314. -@mkdir -p $(BINDIR)
  315. @echo "Linking CarlaVstShellBridged.dll"
  316. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(SHARED) $(SYMBOLS_VST) $(LINK_FLAGS) -o $@
  317. $(BINDIR)/CarlaVstFxShellBridged.dll: $(OBJDIR)/carla-vst-export-bridged.cpp.fx.o
  318. -@mkdir -p $(BINDIR)
  319. @echo "Linking CarlaVstFxShellBridged.dll"
  320. $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(SHARED) $(SYMBOLS_VST) $(LINK_FLAGS) -o $@
  321. else
  322. # wine things
  323. $(BINDIR)/CarlaVstShellBridged.dll.so: $(OBJDIR)/carla-vst.cpp.shell.o $(OBJDIR)/carla-vst-export.cpp.dll.o
  324. -@mkdir -p $(BINDIR)
  325. @echo "Linking CarlaVstShellBridged.dll.so"
  326. $(SILENT)$(WINECC) $^ $(LIBS_START) $(LIBS_wine) $(LIBS_END) $(SHARED) symbols/carla-vst.def $(WINE_LINK_FLAGS) -o $@
  327. $(BINDIR)/CarlaVstFxShellBridged.dll.so: $(OBJDIR)/carla-vst.cpp.shellfx.o $(OBJDIR)/carla-vst-export.cpp.dll.o
  328. -@mkdir -p $(BINDIR)
  329. @echo "Linking CarlaVstFxShellBridged.dll.so"
  330. $(SILENT)$(WINECC) $^ $(LIBS_START) $(LIBS_wine) $(LIBS_END) $(SHARED) symbols/carla-vst.def $(WINE_LINK_FLAGS) -o $@
  331. endif
  332. # ---------------------------------------------------------------------------------------------------------------------
  333. ifeq ($(MACOS),true)
  334. ifeq ($(USING_JUCE),true)
  335. $(OBJDIR)/carla-host-plugin.cpp.o: carla-host-plugin.cpp
  336. -@mkdir -p $(OBJDIR)
  337. @echo "Compiling $<"
  338. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -std=gnu++14 -c -o $@
  339. endif
  340. endif
  341. $(OBJDIR)/carla-%-plugin.cpp.o: carla-%-plugin.cpp
  342. -@mkdir -p $(OBJDIR)
  343. @echo "Compiling $<"
  344. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  345. # ---------------------------------------------------------------------------------------------------------------------
  346. $(OBJDIR)/carla-lv2.cpp.o: carla-lv2.cpp
  347. -@mkdir -p $(OBJDIR)
  348. @echo "Compiling $<"
  349. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  350. $(OBJDIR)/carla-lv2-ui.cpp.o: carla-lv2-ui.cpp
  351. -@mkdir -p $(OBJDIR)
  352. @echo "Compiling $<"
  353. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  354. # ---------------------------------------------------------------------------------------------------------------------
  355. $(OBJDIR)/carla-lv2-bundles.cpp.audiogain.o: carla-lv2-bundles.cpp
  356. -@mkdir -p $(OBJDIR)
  357. @echo "Compiling $< (audiogain)"
  358. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_BUNDLE_TYPE=1 -c -o $@
  359. $(OBJDIR)/carla-lv2-bundles.cpp.files.o: carla-lv2-bundles.cpp
  360. -@mkdir -p $(OBJDIR)
  361. @echo "Compiling $< (files)"
  362. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_BUNDLE_TYPE=2 -c -o $@
  363. $(OBJDIR)/carla-lv2-bundles.cpp.miditools.o: carla-lv2-bundles.cpp
  364. -@mkdir -p $(OBJDIR)
  365. @echo "Compiling $< (miditools)"
  366. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_BUNDLE_TYPE=3 -c -o $@
  367. # ---------------------------------------------------------------------------------------------------------------------
  368. $(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp
  369. -@mkdir -p $(OBJDIR)
  370. @echo "Compiling $< (RackFX)"
  371. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  372. $(OBJDIR)/carla-vst.cpp.rack-syn.o: carla-vst.cpp
  373. -@mkdir -p $(OBJDIR)
  374. @echo "Compiling $< (RackSynth)"
  375. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  376. $(OBJDIR)/carla-vst.cpp.patchbay-fx.o: carla-vst.cpp
  377. -@mkdir -p $(OBJDIR)
  378. @echo "Compiling $< (PatchbayFX)"
  379. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  380. $(OBJDIR)/carla-vst.cpp.patchbay-syn.o: carla-vst.cpp
  381. -@mkdir -p $(OBJDIR)
  382. @echo "Compiling $< (PatchbaySynth)"
  383. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  384. $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp
  385. -@mkdir -p $(OBJDIR)
  386. @echo "Compiling $< (PatchbaySynth 16ch)"
  387. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH -c -o $@
  388. $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o: carla-vst.cpp
  389. -@mkdir -p $(OBJDIR)
  390. @echo "Compiling $< (PatchbaySynth 32ch)"
  391. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_32CH -c -o $@
  392. $(OBJDIR)/carla-vst.cpp.patchbay-syn64.o: carla-vst.cpp
  393. -@mkdir -p $(OBJDIR)
  394. @echo "Compiling $< (PatchbaySynth 64ch)"
  395. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_64CH -c -o $@
  396. $(OBJDIR)/carla-vst.cpp.shell.o: carla-vst.cpp
  397. -@mkdir -p $(OBJDIR)
  398. @echo "Compiling $< (VstShell)"
  399. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  400. $(OBJDIR)/carla-vst.cpp.shellfx.o: carla-vst.cpp
  401. -@mkdir -p $(OBJDIR)
  402. @echo "Compiling $< (VstShell)"
  403. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  404. $(OBJDIR)/carla-vst-export-bridged.cpp.fx.o: carla-vst-export-bridged.cpp
  405. -@mkdir -p $(OBJDIR)
  406. @echo "Compiling $<"
  407. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  408. $(OBJDIR)/carla-vst-export-bridged.cpp.synth.o: carla-vst-export-bridged.cpp
  409. -@mkdir -p $(OBJDIR)
  410. @echo "Compiling $<"
  411. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  412. $(OBJDIR)/carla-vst-export.cpp.o: carla-vst-export.cpp
  413. -@mkdir -p $(OBJDIR)
  414. @echo "Compiling $<"
  415. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  416. $(OBJDIR)/carla-vst-export.cpp.dll.o: carla-vst-export.cpp
  417. -@mkdir -p $(OBJDIR)
  418. @echo "Compiling $< (Wine)"
  419. $(SILENT)$(WINECC) $< $(BUILD_CXX_FLAGS) -c -o $@
  420. # ---------------------------------------------------------------------------------------------------------------------
  421. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(BINDIR)/carla.lv2/carla$(LIB_EXT)
  422. -@mkdir -p $(BINDIR)/carla.lv2
  423. @echo "Linking carla-lv2-export$(APP_EXT)"
  424. $(SILENT)$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(NATIVE_LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  425. @echo "Generating LV2 ttl data"
  426. $(SILENT)cd $(BINDIR) && $(EXE_WRAPPER) ./carla-lv2-export$(APP_EXT)
  427. $(SILENT)cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  428. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o
  429. -@mkdir -p $(BINDIR)
  430. @echo "Linking carla-lv2-export$(APP_EXT)"
  431. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(LIBS_START) $(LIBS) $(LIBS_juce) $(LIBS_END) $(NATIVE_LINK_FLAGS) -o $@
  432. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  433. -@mkdir -p $(OBJDIR)
  434. @echo "Compiling $<"
  435. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  436. # ---------------------------------------------------------------------------------------------------------------------
  437. -include $(OBJDIR)/carla-host-plugin.cpp.d
  438. -include $(OBJDIR)/carla-native-plugin.cpp.d
  439. -include $(OBJDIR)/carla-lv2.cpp.d
  440. -include $(OBJDIR)/carla-lv2-bundles.cpp.audiogain.d
  441. -include $(OBJDIR)/carla-lv2-bundles.cpp.files.d
  442. -include $(OBJDIR)/carla-lv2-bundles.cpp.miditools.d
  443. -include $(OBJDIR)/carla-lv2-export.cpp.d
  444. -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
  445. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn.d
  446. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn16.d
  447. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  448. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  449. -include $(OBJDIR)/carla-vst.cpp.shell.d
  450. -include $(OBJDIR)/carla-vst-export.cpp.d
  451. -include $(OBJDIR)/carla-vst-export.cpp.dll.d
  452. -include $(OBJDIR)/carla-vst-export-bridged.cpp.fx.d
  453. -include $(OBJDIR)/carla-vst-export-bridged.cpp.synth.d
  454. # ---------------------------------------------------------------------------------------------------------------------