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.

348 lines
12KB

  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) -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/utils -isystem $(CWD)/modules
  20. BUILD_CXX_FLAGS += -I$(CWD)/backend/engine -I$(CWD)/backend/plugin
  21. BUILD_CXX_FLAGS += $(LIBLO_FLAGS)
  22. 32BIT_FLAGS += -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  23. 64BIT_FLAGS += -DBUILD_BRIDGE_ALTERNATIVE_ARCH
  24. # ----------------------------------------------------------------------------------------------------------------------
  25. LIBS_native = $(MODULEDIR)/jackbridge.a
  26. LIBS_posix32 = $(MODULEDIR)/jackbridge.posix32.a
  27. LIBS_posix64 = $(MODULEDIR)/jackbridge.posix64.a
  28. ifeq ($(BUILDING_FOR_WINDOWS),true)
  29. LIBS_win32 = $(MODULEDIR)/jackbridge.win32.a
  30. LIBS_win64 = $(MODULEDIR)/jackbridge.win64.a
  31. else
  32. LIBS_win32 = $(MODULEDIR)/jackbridge.win32e.a
  33. LIBS_win64 = $(MODULEDIR)/jackbridge.win64e.a
  34. endif
  35. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  36. LIBS_native += $(MODULEDIR)/lilv.a
  37. LIBS_posix32 += $(MODULEDIR)/lilv.posix32.a
  38. LIBS_posix64 += $(MODULEDIR)/lilv.posix64.a
  39. LIBS_win32 += $(MODULEDIR)/lilv.win32.a
  40. LIBS_win64 += $(MODULEDIR)/lilv.win64.a
  41. LINK_FLAGS += $(LILV_LIBS)
  42. LIBS_native += $(MODULEDIR)/rtmempool.a
  43. LIBS_posix32 += $(MODULEDIR)/rtmempool.posix32.a
  44. LIBS_posix64 += $(MODULEDIR)/rtmempool.posix64.a
  45. LIBS_win32 += $(MODULEDIR)/rtmempool.win32.a
  46. LIBS_win64 += $(MODULEDIR)/rtmempool.win64.a
  47. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  48. LIBS_native += $(MODULEDIR)/water.a
  49. LIBS_posix32 += $(MODULEDIR)/water.posix32.a
  50. LIBS_posix64 += $(MODULEDIR)/water.posix64.a
  51. LIBS_win32 += $(MODULEDIR)/water.win32.a
  52. LIBS_win64 += $(MODULEDIR)/water.win64.a
  53. LINK_FLAGS += $(WATER_LIBS)
  54. ifeq ($(HAVE_LIBLO),true)
  55. LINK_FLAGS += $(LIBLO_LIBS)
  56. endif
  57. ifeq ($(HAVE_LIBMAGIC),true)
  58. LINK_FLAGS += $(MAGIC_LIBS)
  59. endif
  60. ifeq ($(HAVE_X11),true)
  61. LINK_FLAGS += $(X11_LIBS)
  62. endif
  63. ifeq ($(UNIX),true)
  64. LINK_FLAGS += -ldl -lpthread
  65. endif
  66. # ----------------------------------------------------------------------------------------------------------------------
  67. NATIVE_BUILD_FLAGS = $(NATIVE_PLUGINS_FLAGS)
  68. NATIVE_LINK_FLAGS =
  69. ifeq ($(HAVE_FLUIDSYNTH),true)
  70. NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
  71. NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  72. endif
  73. ifeq ($(HAVE_LINUXSAMPLER),true)
  74. NATIVE_BUILD_FLAGS += $(LINUXSAMPLER_FLAGS)
  75. NATIVE_LINK_FLAGS += $(LINUXSAMPLER_LIBS)
  76. endif
  77. LIBS_native += $(MODULEDIR)/native-plugins.a
  78. NATIVE_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  79. ifeq ($(HAVE_DGL),true)
  80. LIBS_native += $(MODULEDIR)/dgl.a
  81. endif
  82. # ----------------------------------------------------------------------------------------------------------------------
  83. OBJS_native = \
  84. $(OBJDIR)/CarlaBridgePlugin.cpp.o \
  85. $(OBJDIR)/CarlaEngine.cpp.o \
  86. $(OBJDIR)/CarlaEngineClient.cpp.o \
  87. $(OBJDIR)/CarlaEngineData.cpp.o \
  88. $(OBJDIR)/CarlaEngineInternal.cpp.o \
  89. $(OBJDIR)/CarlaEngineOsc.cpp.o \
  90. $(OBJDIR)/CarlaEngineOscSend.cpp.o \
  91. $(OBJDIR)/CarlaEnginePorts.cpp.o \
  92. $(OBJDIR)/CarlaEngineThread.cpp.o \
  93. $(OBJDIR)/CarlaEngineJack.cpp.o \
  94. $(OBJDIR)/CarlaEngineBridge.cpp.o \
  95. $(OBJDIR)/CarlaPlugin.cpp.o \
  96. $(OBJDIR)/CarlaPluginBridge.cpp.o \
  97. $(OBJDIR)/CarlaPluginInternal.cpp.o \
  98. $(OBJDIR)/CarlaPluginJack.cpp.o \
  99. $(OBJDIR)/CarlaPluginNative.cpp.o \
  100. $(OBJDIR)/CarlaPluginLADSPA.cpp.o \
  101. $(OBJDIR)/CarlaPluginDSSI.cpp.o \
  102. $(OBJDIR)/CarlaPluginLV2.cpp.o \
  103. $(OBJDIR)/CarlaPluginVST2.cpp.o \
  104. $(OBJDIR)/CarlaPluginFluidSynth.cpp.o \
  105. $(OBJDIR)/CarlaPluginLinuxSampler.cpp.o \
  106. $(OBJDIR)/CarlaStandalone.cpp.o
  107. OBJS_lv2 = $(OBJS_native) \
  108. $(OBJDIR)/CarlaBridgeLV2.cpp.o
  109. OBJS_arch = \
  110. $(OBJDIR)/CarlaBridgePlugin.cpp.arch.o \
  111. $(OBJDIR)/CarlaEngine.cpp.arch.o \
  112. $(OBJDIR)/CarlaEngineClient.cpp.arch.o \
  113. $(OBJDIR)/CarlaEngineData.cpp.arch.o \
  114. $(OBJDIR)/CarlaEngineInternal.cpp.arch.o \
  115. $(OBJDIR)/CarlaEngineOsc.cpp.arch.o \
  116. $(OBJDIR)/CarlaEngineOscSend.cpp.arch.o \
  117. $(OBJDIR)/CarlaEnginePorts.cpp.arch.o \
  118. $(OBJDIR)/CarlaEngineThread.cpp.arch.o \
  119. $(OBJDIR)/CarlaEngineJack.cpp.arch.o \
  120. $(OBJDIR)/CarlaEngineBridge.cpp.arch.o \
  121. $(OBJDIR)/CarlaPlugin.cpp.arch.o \
  122. $(OBJDIR)/CarlaPluginBridge.cpp.arch.o \
  123. $(OBJDIR)/CarlaPluginInternal.cpp.arch.o \
  124. $(OBJDIR)/CarlaPluginJack.cpp.arch.o \
  125. $(OBJDIR)/CarlaPluginLADSPA.cpp.arch.o \
  126. $(OBJDIR)/CarlaPluginDSSI.cpp.arch.o \
  127. $(OBJDIR)/CarlaPluginLV2.cpp.arch.o \
  128. $(OBJDIR)/CarlaPluginVST2.cpp.arch.o \
  129. $(OBJDIR)/CarlaStandalone.cpp.arch.o
  130. OBJS_posix32 = $(OBJS_arch:%.arch.o=%.posix32.o)
  131. OBJS_posix64 = $(OBJS_arch:%.arch.o=%.posix64.o)
  132. OBJS_win32 = $(OBJS_arch:%.arch.o=%.win32.o)
  133. OBJS_win64 = $(OBJS_arch:%.arch.o=%.win64.o)
  134. # ----------------------------------------------------------------------------------------------------------------------
  135. all: native
  136. # ----------------------------------------------------------------------------------------------------------------------
  137. clean:
  138. rm -f $(OBJDIR)/*.o
  139. rm -f $(BINDIR)/$(MODULENAME)-native
  140. rm -f $(BINDIR)/$(MODULENAME)-posix32
  141. rm -f $(BINDIR)/$(MODULENAME)-posix64
  142. rm -f $(BINDIR)/$(MODULENAME)-win*.exe
  143. debug:
  144. $(MAKE) DEBUG=true
  145. # ----------------------------------------------------------------------------------------------------------------------
  146. native: $(BINDIR)/$(MODULENAME)-native$(APP_EXT) $(BINDIR)/$(MODULENAME)-lv2$(LIB_EXT)
  147. posix32: $(BINDIR)/$(MODULENAME)-posix32
  148. posix64: $(BINDIR)/$(MODULENAME)-posix64
  149. win32: $(BINDIR)/$(MODULENAME)-win32.exe
  150. win64: $(BINDIR)/$(MODULENAME)-win64.exe
  151. # ----------------------------------------------------------------------------------------------------------------------
  152. # linking
  153. $(BINDIR)/$(MODULENAME)-native$(APP_EXT): $(OBJS_native) $(LIBS_native)
  154. -@mkdir -p $(BINDIR)
  155. @echo "Linking $(MODULENAME)-native$(APP_EXT)"
  156. @$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  157. $(BINDIR)/$(MODULENAME)-lv2$(LIB_EXT): $(OBJS_lv2) $(LIBS_native)
  158. -@mkdir -p $(BINDIR)
  159. @echo "Linking $(MODULENAME)-lv2$(LIB_EXT)"
  160. @$(CXX) $(OBJS_lv2) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(SHARED) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@
  161. $(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32)
  162. -@mkdir -p $(BINDIR)
  163. @echo "Linking $(MODULENAME)-posix32"
  164. @$(CXX) $(OBJS_posix32) $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  165. $(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64)
  166. -@mkdir -p $(BINDIR)
  167. @echo "Linking $(MODULENAME)-posix64"
  168. @$(CXX) $(OBJS_posix64) $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  169. $(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32)
  170. -@mkdir -p $(BINDIR)
  171. @echo "Linking $(MODULENAME)-win32.exe"
  172. @$(CXX) $(OBJS_win32) $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@
  173. $(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64)
  174. -@mkdir -p $(BINDIR)
  175. @echo "Linking $(MODULENAME)-win64.exe"
  176. @$(CXX) $(OBJS_win64) $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@
  177. # ----------------------------------------------------------------------------------------------------------------------
  178. # native
  179. $(OBJDIR)/CarlaBridgeLV2.cpp.o: CarlaBridgeLV2.cpp
  180. -@mkdir -p $(OBJDIR)
  181. @echo "Compiling $<"
  182. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  183. $(OBJDIR)/CarlaBridgePlugin.cpp.o: CarlaBridgePlugin.cpp
  184. -@mkdir -p $(OBJDIR)
  185. @echo "Compiling $<"
  186. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  187. $(OBJDIR)/CarlaEng%.cpp.o: $(CWD)/backend/engine/CarlaEng%.cpp
  188. -@mkdir -p $(OBJDIR)
  189. @echo "Compiling CarlaEng$*.cpp (bridge)"
  190. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  191. $(OBJDIR)/CarlaPlug%.cpp.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  192. -@mkdir -p $(OBJDIR)
  193. @echo "Compiling CarlaPlug$*.cpp (bridge)"
  194. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  195. $(OBJDIR)/CarlaStandalone.cpp.o: $(CWD)/backend/CarlaStandalone.cpp
  196. -@mkdir -p $(OBJDIR)
  197. @echo "Compiling CarlaStandalone.cpp (bridge)"
  198. @$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -c -o $@
  199. # ----------------------------------------------------------------------------------------------------------------------
  200. # posix32
  201. $(OBJDIR)/CarlaBridgePlugin.cpp.posix32.o: CarlaBridgePlugin.cpp
  202. -@mkdir -p $(OBJDIR)
  203. @echo "Compiling $< (posix32 bridge)"
  204. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  205. $(OBJDIR)/CarlaEng%.cpp.posix32.o: $(CWD)/backend/engine/CarlaEng%.cpp
  206. -@mkdir -p $(OBJDIR)
  207. @echo "Compiling CarlaEng$*.cpp (posix32 bridge)"
  208. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  209. $(OBJDIR)/CarlaPlug%.cpp.posix32.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  210. -@mkdir -p $(OBJDIR)
  211. @echo "Compiling CarlaPlug$*.cpp (posix32 bridge)"
  212. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  213. $(OBJDIR)/CarlaStandalone.cpp.posix32.o: $(CWD)/backend/CarlaStandalone.cpp
  214. -@mkdir -p $(OBJDIR)
  215. @echo "Compiling CarlaStandalone.cpp (posix32 bridge)"
  216. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  217. # ----------------------------------------------------------------------------------------------------------------------
  218. # posix64
  219. $(OBJDIR)/CarlaBridgePlugin.cpp.posix64.o: CarlaBridgePlugin.cpp
  220. -@mkdir -p $(OBJDIR)
  221. @echo "Compiling $< (posix64 bridge)"
  222. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  223. $(OBJDIR)/CarlaEng%.cpp.posix64.o: $(CWD)/backend/engine/CarlaEng%.cpp
  224. -@mkdir -p $(OBJDIR)
  225. @echo "Compiling CarlaEng$*.cpp (posix64 bridge)"
  226. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  227. $(OBJDIR)/CarlaPlug%.cpp.posix64.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  228. -@mkdir -p $(OBJDIR)
  229. @echo "Compiling CarlaPlug$*.cpp (posix64 bridge)"
  230. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  231. $(OBJDIR)/CarlaStandalone.cpp.posix64.o: $(CWD)/backend/CarlaStandalone.cpp
  232. -@mkdir -p $(OBJDIR)
  233. @echo "Compiling CarlaStandalone.cpp (posix64 bridge)"
  234. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  235. # ----------------------------------------------------------------------------------------------------------------------
  236. # win32
  237. $(OBJDIR)/CarlaBridgePlugin.cpp.win32.o: CarlaBridgePlugin.cpp
  238. -@mkdir -p $(OBJDIR)
  239. @echo "Compiling $< (win32 bridge)"
  240. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  241. $(OBJDIR)/CarlaEng%.cpp.win32.o: $(CWD)/backend/engine/CarlaEng%.cpp
  242. -@mkdir -p $(OBJDIR)
  243. @echo "Compiling CarlaEng$*.cpp (win32 bridge)"
  244. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  245. $(OBJDIR)/CarlaPlug%.cpp.win32.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  246. -@mkdir -p $(OBJDIR)
  247. @echo "Compiling CarlaPlug$*.cpp (win32 bridge)"
  248. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  249. $(OBJDIR)/CarlaStandalone.cpp.win32.o: $(CWD)/backend/CarlaStandalone.cpp
  250. -@mkdir -p $(OBJDIR)
  251. @echo "Compiling CarlaStandalone.cpp (win32 bridge)"
  252. @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  253. # ----------------------------------------------------------------------------------------------------------------------
  254. # win64
  255. $(OBJDIR)/CarlaBridgePlugin.cpp.win64.o: CarlaBridgePlugin.cpp
  256. -@mkdir -p $(OBJDIR)
  257. @echo "Compiling $< (win64 bridge)"
  258. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  259. $(OBJDIR)/CarlaEng%.cpp.win64.o: $(CWD)/backend/engine/CarlaEng%.cpp
  260. -@mkdir -p $(OBJDIR)
  261. @echo "Compiling CarlaEng$*.cpp (win64 bridge)"
  262. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  263. $(OBJDIR)/CarlaPlug%.cpp.win64.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
  264. -@mkdir -p $(OBJDIR)
  265. @echo "Compiling CarlaPlug$*.cpp (win64 bridge)"
  266. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  267. $(OBJDIR)/CarlaStandalone.cpp.win64.o: $(CWD)/backend/CarlaStandalone.cpp
  268. -@mkdir -p $(OBJDIR)
  269. @echo "Compiling CarlaStandalone.cpp (win64 bridge)"
  270. @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  271. # ----------------------------------------------------------------------------------------------------------------------
  272. -include $(OBJS_lv2:%.o=%.d)
  273. -include $(OBJS_posix32:%.o=%.d)
  274. -include $(OBJS_posix64:%.o=%.d)
  275. -include $(OBJS_win32:%.o=%.d)
  276. -include $(OBJS_win64:%.o=%.d)
  277. # ----------------------------------------------------------------------------------------------------------------------