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.

385 lines
14KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-bridges-plugin #
  3. # --------------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. MODULENAME=carla-bridge
  8. include $(CWD)/Makefile.mk
  9. # ----------------------------------------------------------------------------------------------------------------------------
  10. BINDIR := $(CWD)/../bin
  11. ifeq ($(DEBUG),true)
  12. OBJDIR := $(CWD)/../build/bridges-plugin/Debug
  13. MODULEDIR := $(CWD)/../build/modules/Debug
  14. else
  15. OBJDIR := $(CWD)/../build/bridges-plugin/Release
  16. MODULEDIR := $(CWD)/../build/modules/Release
  17. endif
  18. # ----------------------------------------------------------------------------------------------------------------------------
  19. BUILD_CXX_FLAGS += -DBUILD_BRIDGE -I. -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  20. BUILD_CXX_FLAGS += -I$(CWD)/backend/engine -I$(CWD)/backend/plugin
  21. BUILD_CXX_FLAGS += $(LIBLO_FLAGS)
  22. ifeq ($(CARLA_VESTIGE_HEADER),true)
  23. BUILD_CXX_FLAGS += -DVESTIGE_HEADER
  24. endif
  25. 32BIT_FLAGS += -DBRIDGE_PLUGIN
  26. 64BIT_FLAGS += -DBRIDGE_PLUGIN
  27. # ----------------------------------------------------------------------------------------------------------------------------
  28. LIBS_native = $(MODULEDIR)/jackbridge.a
  29. LIBS_posix32 = $(MODULEDIR)/jackbridge.posix32.a
  30. LIBS_posix64 = $(MODULEDIR)/jackbridge.posix64.a
  31. LIBS_win32 = $(MODULEDIR)/jackbridge.win32e.a
  32. LIBS_win64 = $(MODULEDIR)/jackbridge.win64e.a
  33. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  34. LIBS_native += $(MODULEDIR)/juce_audio_basics.a
  35. LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a
  36. LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a
  37. LIBS_win32 += $(MODULEDIR)/juce_audio_basics.win32.a
  38. LIBS_win64 += $(MODULEDIR)/juce_audio_basics.win64.a
  39. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  40. LIBS_native += $(MODULEDIR)/juce_core.a
  41. LIBS_posix32 += $(MODULEDIR)/juce_core.posix32.a
  42. LIBS_posix64 += $(MODULEDIR)/juce_core.posix64.a
  43. LIBS_win32 += $(MODULEDIR)/juce_core.win32.a
  44. LIBS_win64 += $(MODULEDIR)/juce_core.win64.a
  45. LINK_FLAGS += $(JUCE_CORE_LIBS)
  46. LIBS_native += $(MODULEDIR)/lilv.a
  47. LIBS_posix32 += $(MODULEDIR)/lilv.posix32.a
  48. LIBS_posix64 += $(MODULEDIR)/lilv.posix64.a
  49. LIBS_win32 += $(MODULEDIR)/lilv.win32.a
  50. LIBS_win64 += $(MODULEDIR)/lilv.win64.a
  51. LINK_FLAGS += $(LILV_LIBS)
  52. LIBS_native += $(MODULEDIR)/rtmempool.a
  53. LIBS_posix32 += $(MODULEDIR)/rtmempool.posix32.a
  54. LIBS_posix64 += $(MODULEDIR)/rtmempool.posix64.a
  55. LIBS_win32 += $(MODULEDIR)/rtmempool.win32.a
  56. LIBS_win64 += $(MODULEDIR)/rtmempool.win64.a
  57. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  58. ifeq ($(MACOS_OR_WIN32),true)
  59. LIBS_native += $(MODULEDIR)/juce_audio_processors.a
  60. LIBS_posix32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  61. LIBS_posix64 += $(MODULEDIR)/juce_audio_processors.posix64.a
  62. LIBS_win32 += $(MODULEDIR)/juce_audio_processors.win32.a
  63. LIBS_win64 += $(MODULEDIR)/juce_audio_processors.win64.a
  64. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  65. LIBS_native += $(MODULEDIR)/juce_data_structures.a
  66. LIBS_posix32 += $(MODULEDIR)/juce_data_structures.posix32.a
  67. LIBS_posix64 += $(MODULEDIR)/juce_data_structures.posix64.a
  68. LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a
  69. LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a
  70. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  71. LIBS_native += $(MODULEDIR)/juce_events.a
  72. LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a
  73. LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a
  74. LIBS_win32 += $(MODULEDIR)/juce_events.win32.a
  75. LIBS_win64 += $(MODULEDIR)/juce_events.win64.a
  76. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  77. LIBS_native += $(MODULEDIR)/juce_graphics.a
  78. LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a
  79. LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a
  80. LIBS_win32 += $(MODULEDIR)/juce_graphics.win32.a
  81. LIBS_win64 += $(MODULEDIR)/juce_graphics.win64.a
  82. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  83. LIBS_native += $(MODULEDIR)/juce_gui_basics.a
  84. LIBS_posix32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  85. LIBS_posix64 += $(MODULEDIR)/juce_gui_basics.posix64.a
  86. LIBS_win32 += $(MODULEDIR)/juce_gui_basics.win32.a
  87. LIBS_win64 += $(MODULEDIR)/juce_gui_basics.win64.a
  88. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  89. ifeq ($(MACOS),true)
  90. LIBS_native += $(MODULEDIR)/juce_gui_extra.a
  91. LIBS_posix32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  92. LIBS_posix64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  93. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  94. endif
  95. endif
  96. LINK_FLAGS += $(LIBLO_LIBS)
  97. ifeq ($(HAVE_X11),true)
  98. LINK_FLAGS += $(X11_LIBS)
  99. endif
  100. ifeq ($(UNIX),true)
  101. LINK_FLAGS += -ldl -lpthread
  102. endif
  103. # ----------------------------------------------------------------------------------------------------------------------------
  104. NATIVE_BUILD_FLAGS =
  105. NATIVE_LINK_FLAGS =
  106. ifeq ($(HAVE_FLUIDSYNTH),true)
  107. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  108. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  109. endif
  110. ifeq ($(HAVE_LINUXSAMPLER),true)
  111. NATIVE_BUILD_FLAGS += $(LINUXSAMPLER_FLAGS)
  112. NATIVE_LINK_FLAGS += $(LINUXSAMPLER_LIBS)
  113. endif
  114. ifeq ($(HAVE_ZYN_DEPS),true)
  115. NATIVE_BUILD_FLAGS += -DWANT_ZYNADDSUBFX
  116. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  117. NATIVE_BUILD_FLAGS += -DWANT_ZYNADDSUBFX_UI
  118. endif
  119. endif
  120. LIBS_native += $(MODULEDIR)/juce_audio_formats.a
  121. NATIVE_LINK_FLAGS += $(JUCE_AUDIO_FORMATS_LIBS)
  122. LIBS_native += $(MODULEDIR)/native-plugins.a
  123. NATIVE_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  124. # ----------------------------------------------------------------------------------------------------------------------------
  125. OBJS_native = \
  126. $(OBJDIR)/CarlaBridgePlugin.cpp.o \
  127. $(OBJDIR)/CarlaEngine.cpp.o \
  128. $(OBJDIR)/CarlaEngineClient.cpp.o \
  129. $(OBJDIR)/CarlaEngineData.cpp.o \
  130. $(OBJDIR)/CarlaEngineInternal.cpp.o \
  131. $(OBJDIR)/CarlaEngineOsc.cpp.o \
  132. $(OBJDIR)/CarlaEngineOscSend.cpp.o \
  133. $(OBJDIR)/CarlaEnginePorts.cpp.o \
  134. $(OBJDIR)/CarlaEngineThread.cpp.o \
  135. $(OBJDIR)/CarlaEngineJack.cpp.o \
  136. $(OBJDIR)/CarlaEngineBridge.cpp.o \
  137. $(OBJDIR)/CarlaPlugin.cpp.o \
  138. $(OBJDIR)/CarlaPluginInternal.cpp.o \
  139. $(OBJDIR)/CarlaPluginThread.cpp.o \
  140. $(OBJDIR)/CarlaPluginNative.cpp.o \
  141. $(OBJDIR)/CarlaPluginLADSPA.cpp.o \
  142. $(OBJDIR)/CarlaPluginDSSI.cpp.o \
  143. $(OBJDIR)/CarlaPluginLV2.cpp.o \
  144. $(OBJDIR)/CarlaPluginVST2.cpp.o \
  145. $(OBJDIR)/CarlaPluginVST3.cpp.o \
  146. $(OBJDIR)/CarlaPluginAU.cpp.o \
  147. $(OBJDIR)/CarlaPluginJuce.cpp.o \
  148. $(OBJDIR)/CarlaPluginFluidSynth.cpp.o \
  149. $(OBJDIR)/CarlaPluginLinuxSampler.cpp.o \
  150. $(OBJDIR)/CarlaStandalone.cpp.o
  151. OBJS_arch = \
  152. $(OBJDIR)/CarlaBridgePlugin.cpp.arch.o \
  153. $(OBJDIR)/CarlaEngine.cpp.arch.o \
  154. $(OBJDIR)/CarlaEngineClient.cpp.arch.o \
  155. $(OBJDIR)/CarlaEngineData.cpp.arch.o \
  156. $(OBJDIR)/CarlaEngineInternal.cpp.arch.o \
  157. $(OBJDIR)/CarlaEngineOsc.cpp.arch.o \
  158. $(OBJDIR)/CarlaEngineOscSend.cpp.arch.o \
  159. $(OBJDIR)/CarlaEnginePorts.cpp.arch.o \
  160. $(OBJDIR)/CarlaEngineThread.cpp.arch.o \
  161. $(OBJDIR)/CarlaEngineJack.cpp.arch.o \
  162. $(OBJDIR)/CarlaEngineBridge.cpp.arch.o \
  163. $(OBJDIR)/CarlaPlugin.cpp.arch.o \
  164. $(OBJDIR)/CarlaPluginInternal.cpp.arch.o \
  165. $(OBJDIR)/CarlaPluginThread.cpp.arch.o \
  166. $(OBJDIR)/CarlaPluginLADSPA.cpp.arch.o \
  167. $(OBJDIR)/CarlaPluginDSSI.cpp.arch.o \
  168. $(OBJDIR)/CarlaPluginLV2.cpp.arch.o \
  169. $(OBJDIR)/CarlaPluginVST2.cpp.arch.o \
  170. $(OBJDIR)/CarlaPluginVST3.cpp.arch.o \
  171. $(OBJDIR)/CarlaPluginAU.cpp.arch.o \
  172. $(OBJDIR)/CarlaPluginJuce.cpp.arch.o \
  173. $(OBJDIR)/CarlaStandalone.cpp.arch.o
  174. OBJS_posix32 = $(OBJS_arch:%.arch.o=%.posix32.o)
  175. OBJS_posix64 = $(OBJS_arch:%.arch.o=%.posix64.o)
  176. OBJS_win32 = $(OBJS_arch:%.arch.o=%.win32.o)
  177. OBJS_win64 = $(OBJS_arch:%.arch.o=%.win64.o)
  178. # ----------------------------------------------------------------------------------------------------------------------------
  179. all: native
  180. # ----------------------------------------------------------------------------------------------------------------------------
  181. clean:
  182. rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-*
  183. debug:
  184. $(MAKE) DEBUG=true
  185. # ----------------------------------------------------------------------------------------------------------------------------
  186. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT)
  187. posix32: $(BINDIR)/$(MODULENAME)-posix32
  188. posix64: $(BINDIR)/$(MODULENAME)-posix64
  189. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  190. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  191. # ----------------------------------------------------------------------------------------------------------------------------
  192. # linking
  193. $(BINDIR)/$(MODULENAME)-native$(APP_EXT): $(OBJS_native) $(LIBS_native)
  194. -@mkdir -p $(BINDIR)
  195. @echo "Linking $(MODULENAME)-native$(APP_EXT)"
  196. @$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  197. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  198. -@mkdir -p $(BINDIR)
  199. @echo "Linking $(MODULENAME)-posix32"
  200. @$(CXX) $(OBJS_posix32) $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  201. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  202. -@mkdir -p $(BINDIR)
  203. @echo "Linking $(MODULENAME)-posix64"
  204. @$(CXX) $(OBJS_posix64) $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  205. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  206. -@mkdir -p $(BINDIR)
  207. @echo "Linking $(MODULENAME)-win32.exe"
  208. @$(CXX) $(OBJS_win32) $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  209. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  210. -@mkdir -p $(BINDIR)
  211. @echo "Linking $(MODULENAME)-win64.exe"
  212. @$(CXX) $(OBJS_win64) $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  213. # ----------------------------------------------------------------------------------------------------------------------------
  214. # native
  215. $(OBJDIR)/CarlaBridgePlugin.cpp.o: CarlaBridgePlugin.cpp
  216. -@mkdir -p $(OBJDIR)
  217. @echo "Compiling $<"
  218. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  219. $(OBJDIR)/CarlaEng%.cpp.o: $(CWD)/backend/engine/CarlaEng%.cpp
  220. -@mkdir -p $(OBJDIR)
  221. @echo "Compiling CarlaEng$*.cpp (bridge)"
  222. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  223. $(OBJDIR)/CarlaPlug%.cpp.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  224. -@mkdir -p $(OBJDIR)
  225. @echo "Compiling CarlaPlug$*.cpp (bridge)"
  226. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  227. $(OBJDIR)/CarlaStandalone.cpp.o: $(CWD)/backend/CarlaStandalone.cpp
  228. -@mkdir -p $(OBJDIR)
  229. @echo "Compiling CarlaStandalone.cpp (bridge)"
  230. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  231. # ----------------------------------------------------------------------------------------------------------------------------
  232. # posix32
  233. $(OBJDIR)/CarlaBridgePlugin.cpp.posix32.o: CarlaBridgePlugin.cpp
  234. -@mkdir -p $(OBJDIR)
  235. @echo "Compiling $< (posix32 bridge)"
  236. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  237. $(OBJDIR)/CarlaEng%.cpp.posix32.o: $(CWD)/backend/engine/CarlaEng%.cpp
  238. -@mkdir -p $(OBJDIR)
  239. @echo "Compiling CarlaEng$*.cpp (posix32 bridge)"
  240. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  241. $(OBJDIR)/CarlaPlug%.cpp.posix32.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  242. -@mkdir -p $(OBJDIR)
  243. @echo "Compiling CarlaPlug$*.cpp (posix32 bridge)"
  244. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  245. $(OBJDIR)/CarlaStandalone.cpp.posix32.o: $(CWD)/backend/CarlaStandalone.cpp
  246. -@mkdir -p $(OBJDIR)
  247. @echo "Compiling CarlaStandalone.cpp (posix32 bridge)"
  248. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  249. # ----------------------------------------------------------------------------------------------------------------------------
  250. # posix64
  251. $(OBJDIR)/CarlaBridgePlugin.cpp.posix64.o: CarlaBridgePlugin.cpp
  252. -@mkdir -p $(OBJDIR)
  253. @echo "Compiling $< (posix64 bridge)"
  254. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  255. $(OBJDIR)/CarlaEng%.cpp.posix64.o: $(CWD)/backend/engine/CarlaEng%.cpp
  256. -@mkdir -p $(OBJDIR)
  257. @echo "Compiling CarlaEng$*.cpp (posix64 bridge)"
  258. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  259. $(OBJDIR)/CarlaPlug%.cpp.posix64.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  260. -@mkdir -p $(OBJDIR)
  261. @echo "Compiling CarlaPlug$*.cpp (posix64 bridge)"
  262. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  263. $(OBJDIR)/CarlaStandalone.cpp.posix64.o: $(CWD)/backend/CarlaStandalone.cpp
  264. -@mkdir -p $(OBJDIR)
  265. @echo "Compiling CarlaStandalone.cpp (posix64 bridge)"
  266. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  267. # ----------------------------------------------------------------------------------------------------------------------------
  268. # win32
  269. $(OBJDIR)/CarlaBridgePlugin.cpp.win32.o: CarlaBridgePlugin.cpp
  270. -@mkdir -p $(OBJDIR)
  271. @echo "Compiling $< (win32 bridge)"
  272. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  273. $(OBJDIR)/CarlaEng%.cpp.win32.o: $(CWD)/backend/engine/CarlaEng%.cpp
  274. -@mkdir -p $(OBJDIR)
  275. @echo "Compiling CarlaEng$*.cpp (win32 bridge)"
  276. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  277. $(OBJDIR)/CarlaPlug%.cpp.win32.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  278. -@mkdir -p $(OBJDIR)
  279. @echo "Compiling CarlaPlug$*.cpp (win32 bridge)"
  280. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  281. $(OBJDIR)/CarlaStandalone.cpp.win32.o: $(CWD)/backend/CarlaStandalone.cpp
  282. -@mkdir -p $(OBJDIR)
  283. @echo "Compiling CarlaStandalone.cpp (win32 bridge)"
  284. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  285. # ----------------------------------------------------------------------------------------------------------------------------
  286. # win64
  287. $(OBJDIR)/CarlaBridgePlugin.cpp.win64.o: CarlaBridgePlugin.cpp
  288. -@mkdir -p $(OBJDIR)
  289. @echo "Compiling $< (win64 bridge)"
  290. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  291. $(OBJDIR)/CarlaEng%.cpp.win64.o: $(CWD)/backend/engine/CarlaEng%.cpp
  292. -@mkdir -p $(OBJDIR)
  293. @echo "Compiling CarlaEng$*.cpp (win64 bridge)"
  294. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  295. $(OBJDIR)/CarlaPlug%.cpp.win64.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  296. -@mkdir -p $(OBJDIR)
  297. @echo "Compiling CarlaPlug$*.cpp (win64 bridge)"
  298. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  299. $(OBJDIR)/CarlaStandalone.cpp.win64.o: $(CWD)/backend/CarlaStandalone.cpp
  300. -@mkdir -p $(OBJDIR)
  301. @echo "Compiling CarlaStandalone.cpp (win64 bridge)"
  302. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  303. # ----------------------------------------------------------------------------------------------------------------------------
  304. -include $(OBJS_native:%.o=%.d)
  305. -include $(OBJS_posix32:%.o=%.d)
  306. -include $(OBJS_posix64:%.o=%.d)
  307. -include $(OBJS_win32:%.o=%.d)
  308. -include $(OBJS_win64:%.o=%.d)
  309. # ----------------------------------------------------------------------------------------------------------------------------