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.

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