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.

443 lines
14KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-bridges #
  3. # ---------------------------------------- #
  4. # Created by falkTX
  5. #
  6. include ../Makefile.mk
  7. # --------------------------------------------------------------
  8. HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true)
  9. HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true)
  10. # --------------------------------------------------------------
  11. BUILD_CXX_FLAGS += -DBUILD_BRIDGE -pthread
  12. BUILD_CXX_FLAGS += -I. -I../backend -I../includes -I../utils
  13. BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore QtXml)
  14. LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtXml) -lpthread
  15. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  16. BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI
  17. #-DWANT_LV2 -DWANT_VST
  18. endif
  19. ifeq ($(HAVE_QT5),true)
  20. QT_UI_FLAGS = $(shell pkg-config --cflags QtWidgets)
  21. QT_UI_LIBS = $(shell pkg-config --libs QtWidgets)
  22. else
  23. QT_UI_FLAGS = $(shell pkg-config --cflags QtGui)
  24. QT_UI_LIBS = $(shell pkg-config --libs QtGui)
  25. endif
  26. # --------------------------------------------------------------
  27. # Plugin bridges
  28. BUILD_PLUGIN_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE_PLUGIN -DBRIDGE_PLUGIN
  29. BUILD_PLUGIN_FLAGS += -DWANT_JACK -I../backend/engine -I../backend/plugin -I../libs
  30. BUILD_PLUGIN_FLAGS += $(shell pkg-config --cflags jack) $(QT_UI_FLAGS)
  31. LINK_PLUGIN_FLAGS = $(LINK_FLAGS)
  32. LINK_PLUGIN_FLAGS += $(QT_UI_LIBS)
  33. POSIX_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS)
  34. POSIX_32BIT_FLAGS = $(32BIT_FLAGS) -L/usr/lib32 -L/usr/lib/i386-linux-gnu
  35. POSIX_64BIT_FLAGS = $(64BIT_FLAGS) -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu
  36. POSIX_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) $(shell pkg-config --libs jack) -ldl
  37. WIN_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -DJACKBRIDGE_EXPORT -DPTW32_STATIC_LIB
  38. WIN_32BIT_FLAGS = $(32BIT_FLAGS)
  39. WIN_64BIT_FLAGS = $(64BIT_FLAGS)
  40. WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -mwindows -L../carla-jackbridge -lpthread -lwinspool -lole32 -luuid -limm32 -lshell32 -lws2_32
  41. # --------------------------------------------------------------
  42. # UI bridges
  43. BUILD_UI_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE_UI
  44. LINK_UI_FLAGS = $(LINK_FLAGS) -ldl
  45. BUILD_UI_LV2_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_LV2
  46. BUILD_UI_VST_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_VST
  47. BUILD_UI_LV2_GTK2_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_GTK2 -DBRIDGE_LV2_GTK2 $(shell pkg-config --cflags gtk+-2.0)
  48. LINK_UI_LV2_GTK2_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs gtk+-2.0)
  49. BUILD_UI_LV2_GTK3_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_GTK3 -DBRIDGE_LV2_GTK3 $(shell pkg-config --cflags gtk+-3.0)
  50. LINK_UI_LV2_GTK3_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs gtk+-3.0)
  51. BUILD_UI_LV2_QT4_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT4 -DBRIDGE_LV2_QT4 $(shell pkg-config --cflags QtGui)
  52. LINK_UI_LV2_QT4_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs QtGui)
  53. BUILD_UI_LV2_QT5_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT5 -DBRIDGE_LV2_QT5 $(shell pkg-config --cflags QtWidgets)
  54. LINK_UI_LV2_QT5_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs QtWidgets)
  55. BUILD_UI_LV2_HWND_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_LV2_HWND $(QT_UI_FLAGS)
  56. LINK_UI_LV2_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static
  57. BUILD_UI_LV2_X11_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_X11 -DBRIDGE_LV2_X11 $(QT_UI_FLAGS)
  58. LINK_UI_LV2_X11_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS)
  59. BUILD_UI_VST_HWND_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_VST_HWND $(QT_UI_FLAGS)
  60. LINK_UI_VST_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static
  61. BUILD_UI_VST_X11_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_X11 -DBRIDGE_VST_X11 $(QT_UI_FLAGS)
  62. LINK_UI_VST_X11_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS)
  63. # --------------------------------------------------------------
  64. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  65. all: native ui_lv2-gtk2 ui_lv2-gtk3 ui_lv2-qt4 ui_lv2-qt5 ui_lv2-x11 ui_vst-x11
  66. ifeq ($(HAVE_GTK2),true)
  67. ui_lv2-gtk2: carla-bridge-lv2-gtk2
  68. else
  69. ui_lv2-gtk2:
  70. endif
  71. ifeq ($(HAVE_GTK3),true)
  72. ui_lv2-gtk3: carla-bridge-lv2-gtk3
  73. else
  74. ui_lv2-gtk3:
  75. endif
  76. ifneq ($(HAVE_QT5),true)
  77. ui_lv2-qt4: carla-bridge-lv2-qt4
  78. ui_lv2-qt5:
  79. else
  80. ui_lv2-qt4:
  81. ui_lv2-qt5: carla-bridge-lv2-qt5
  82. endif
  83. ui_lv2-hwnd: carla-bridge-lv2-hwnd.exe
  84. ui_lv2-x11: carla-bridge-lv2-x11
  85. ui_vst-hwnd: carla-bridge-vst-hwnd.exe
  86. ui_vst-x11: carla-bridge-vst-x11
  87. else # CARLA_PLUGIN_SUPPORT
  88. all:
  89. endif
  90. # --------------------------------------------------------------
  91. native: carla-bridge-native
  92. posix32: carla-bridge-posix32
  93. posix64: carla-bridge-posix64
  94. win32: carla-bridge-win32.exe
  95. win64: carla-bridge-win64.exe
  96. # --------------------------------------------------------------
  97. # UI common
  98. %__lv2.o: %.cpp
  99. $(CXX) $< $(BUILD_UI_LV2_FLAGS) -c -o $@
  100. %__vst.o: %.cpp
  101. $(CXX) $< $(BUILD_UI_VST_FLAGS) -c -o $@
  102. OBJS_UI_LV2_LIBS = \
  103. ../libs/lilv.a \
  104. ../libs/rtmempool.a
  105. # --------------------------------------------------------------
  106. # ui_lv2-gtk2
  107. OBJS_UI_LV2_GTK2 = CarlaBridgeUI-LV2__lv2-gtk2.o \
  108. CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \
  109. CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitGtk__lv2-gtk2.o
  110. carla-bridge-lv2-gtk2: $(OBJS_UI_LV2_GTK2) $(OBJS_UI_LV2_LIBS)
  111. $(CXX) $^ $(LINK_UI_LV2_GTK2_FLAGS) -o $@ && $(STRIP) $@
  112. %__lv2-gtk2.o: %.cpp
  113. $(CXX) $< $(BUILD_UI_LV2_GTK2_FLAGS) -c -o $@
  114. # --------------------------------------------------------------
  115. # ui_lv2-gtk3
  116. OBJS_UI_LV2_GTK3 = CarlaBridgeUI-LV2__lv2-gtk3.o \
  117. CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \
  118. CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitGtk__lv2-gtk3.o
  119. carla-bridge-lv2-gtk3: $(OBJS_UI_LV2_GTK3) $(OBJS_UI_LV2_LIBS)
  120. $(CXX) $^ $(LINK_UI_LV2_GTK3_FLAGS) -o $@ && $(STRIP) $@
  121. %__lv2-gtk3.o: %.cpp
  122. $(CXX) $< $(BUILD_UI_LV2_GTK3_FLAGS) -c -o $@
  123. # --------------------------------------------------------------
  124. # ui_lv2-qt4
  125. OBJS_UI_LV2_QT4 = CarlaBridgeUI-LV2__lv2-qt4.o \
  126. CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \
  127. CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-qt4.o
  128. carla-bridge-lv2-qt4: $(OBJS_UI_LV2_QT4) $(OBJS_UI_LV2_LIBS)
  129. $(CXX) $^ $(LINK_UI_LV2_QT4_FLAGS) -o $@ && $(STRIP) $@
  130. %__lv2-qt4.o: %.cpp
  131. $(CXX) $< $(BUILD_UI_LV2_QT4_FLAGS) -c -o $@
  132. # --------------------------------------------------------------
  133. # ui_lv2-qt5
  134. OBJS_UI_LV2_QT5 = CarlaBridgeUI-LV2__lv2-qt5.o \
  135. CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \
  136. CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-qt5.o
  137. carla-bridge-lv2-qt5: $(OBJS_UI_LV2_QT5) $(OBJS_UI_LV2_LIBS)
  138. $(CXX) $^ $(LINK_UI_LV2_QT5_FLAGS) -o $@ && $(STRIP) $@
  139. %__lv2-qt5.o: %.cpp
  140. $(CXX) $< $(BUILD_UI_LV2_QT5_FLAGS) -c -o $@
  141. # --------------------------------------------------------------
  142. # ui_lv2-x11
  143. OBJS_UI_LV2_X11 = CarlaBridgeUI-LV2__lv2-x11.o \
  144. CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \
  145. CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-x11.o
  146. carla-bridge-lv2-x11: $(OBJS_UI_LV2_X11) $(OBJS_UI_LV2_LIBS)
  147. $(CXX) $^ $(LINK_UI_LV2_X11_FLAGS) -o $@ && $(STRIP) $@
  148. %__lv2-x11.o: %.cpp
  149. $(CXX) $< $(BUILD_UI_LV2_X11_FLAGS) -c -o $@
  150. # --------------------------------------------------------------
  151. # ui_vst-hwnd
  152. OBJS_UI_VST_HWND = CarlaBridgeUI-VST__vst-hwnd.o \
  153. CarlaBridgeClient__vst.o CarlaBridgeOsc__vst.o \
  154. CarlaBridgeToolkit__vst.o CarlaBridgeToolkitQt__vst-hwnd.o
  155. carla-bridge-vst-hwnd.exe: $(OBJS_UI_VST_HWND)
  156. $(CXX) $^ $(LINK_UI_VST_HWND_FLAGS) -o $@ && $(STRIP) $@
  157. %__vst-hwnd.o: %.cpp
  158. $(CXX) $< $(BUILD_UI_VST_HWND_FLAGS) -c -o $@
  159. # --------------------------------------------------------------
  160. # ui_vst-x11
  161. OBJS_UI_VST_X11 = CarlaBridgeUI-VST__vst-x11.o \
  162. CarlaBridgeClient__vst.o CarlaBridgeOsc__vst.o \
  163. CarlaBridgeToolkit__vst.o CarlaBridgeToolkitQt__vst-x11.o
  164. carla-bridge-vst-x11: $(OBJS_UI_VST_X11)
  165. $(CXX) $^ $(LINK_UI_VST_X11_FLAGS) -o $@ && $(STRIP) $@
  166. %__vst-x11.o: %.cpp
  167. $(CXX) $< $(BUILD_UI_VST_X11_FLAGS) -c -o $@
  168. # --------------------------------------------------------------
  169. # native
  170. NATIVE_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS)
  171. NATIVE_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) $(shell pkg-config --libs jack) -ldl
  172. ifeq ($(HAVE_SUIL),true)
  173. NATIVE_BUILD_FLAGS += $(shell pkg-config --cflags suil-0) -DWANT_SUIL
  174. NATIVE_LINK_FLAGS += $(shell pkg-config --libs suil-0)
  175. endif
  176. OBJS_NATIVE = CarlaBridgePlugin__native.o \
  177. CarlaBridgeClient__native.o CarlaBridgeOsc__native.o
  178. # carla-engine
  179. OBJS_NATIVE += \
  180. ../backend/engine/CarlaEngine__native.o \
  181. ../backend/engine/CarlaEngineOsc__native.o \
  182. ../backend/engine/CarlaEngineThread__native.o \
  183. ../backend/engine/CarlaEngineJack__native.o
  184. # carla-plugin
  185. OBJS_NATIVE += \
  186. ../backend/plugin/CarlaPlugin__native.o \
  187. ../backend/plugin/CarlaPluginThread__native.o \
  188. ../backend/plugin/NativePlugin__native.o \
  189. ../backend/plugin/LadspaPlugin__native.o \
  190. ../backend/plugin/DssiPlugin__native.o \
  191. ../backend/plugin/Lv2Plugin__native.o \
  192. ../backend/plugin/VstPlugin__native.o \
  193. ../backend/plugin/FluidSynthPlugin__native.o \
  194. ../backend/plugin/LinuxSamplerPlugin__native.o
  195. # carla-standalone
  196. OBJS_NATIVE += \
  197. ../backend/standalone/CarlaStandalone__native.o
  198. # libs
  199. OBJS_NATIVE += \
  200. ../libs/lilv.a \
  201. ../libs/rtmempool.a
  202. carla-bridge-native: $(OBJS_NATIVE)
  203. $(CXX) $^ $(NATIVE_LINK_FLAGS) -o $@ && $(STRIP) $@
  204. %__native.o: %.cpp
  205. $(CXX) $< $(NATIVE_BUILD_FLAGS) -c -o $@
  206. # --------------------------------------------------------------
  207. # posix32
  208. OBJS_POSIX32 = carla_bridge_plugin__posix32.o \
  209. carla_bridge_client__posix32.o carla_bridge_osc__posix32.o
  210. # carla-engine
  211. OBJS_POSIX32 += \
  212. ../carla-engine/carla_engine__posix32.o \
  213. ../carla-engine/carla_engine_osc__posix32.o \
  214. ../carla-engine/carla_engine_thread__posix32.o \
  215. ../carla-engine/jack__posix32.o
  216. # carla-plugin
  217. OBJS_POSIX32 += \
  218. ../carla-plugin/carla_plugin__posix32.o \
  219. ../carla-plugin/carla_plugin_thread__posix32.o \
  220. ../carla-plugin/ladspa__posix32.o \
  221. ../carla-plugin/dssi__posix32.o \
  222. ../carla-plugin/lv2__posix32.o \
  223. ../carla-plugin/vst__posix32.o
  224. # libs
  225. OBJS_POSIX32 += \
  226. ../carla-lilv/carla_lilv_posix32.a \
  227. ../carla-rtmempool/carla_rtmempool_posix32.a
  228. carla-bridge-posix32: $(OBJS_POSIX32)
  229. $(CXX) $^ $(POSIX_LINK_FLAGS) $(POSIX_32BIT_FLAGS) -o $@ && $(STRIP) $@
  230. %__posix32.o: %.cpp
  231. $(CXX) $< $(POSIX_BUILD_FLAGS) $(POSIX_32BIT_FLAGS) -c -o $@
  232. # --------------------------------------------------------------
  233. # posix64
  234. OBJS_POSIX64 = carla_bridge_plugin__posix64.o \
  235. carla_bridge_client__posix64.o carla_bridge_osc__posix64.o
  236. # carla
  237. OBJS_POSIX64 += \
  238. ../carla/Shared__posix64.o
  239. # carla-engine
  240. OBJS_POSIX64 += \
  241. ../carla-engine/carla_engine__posix64.o \
  242. ../carla-engine/carla_engine_osc__posix64.o \
  243. ../carla-engine/carla_engine_thread__posix64.o \
  244. ../carla-engine/jack__posix64.o
  245. # carla-plugin
  246. OBJS_POSIX64 += \
  247. ../carla-plugin/carla_plugin__posix64.o \
  248. ../carla-plugin/carla_plugin_thread__posix64.o \
  249. ../carla-plugin/ladspa__posix64.o \
  250. ../carla-plugin/dssi__posix64.o \
  251. ../carla-plugin/lv2__posix64.o \
  252. ../carla-plugin/vst__posix64.o
  253. # libs
  254. OBJS_POSIX64 += \
  255. ../carla-lilv/carla_lilv_posix64.a \
  256. ../carla-rtmempool/carla_rtmempool_posix64.a
  257. carla-bridge-posix64: $(OBJS_POSIX64)
  258. $(CXX) $^ $(POSIX_LINK_FLAGS) $(POSIX_64BIT_FLAGS) -o $@ && $(STRIP) $@
  259. %__posix64.o: %.cpp
  260. $(CXX) $< $(POSIX_BUILD_FLAGS) $(POSIX_64BIT_FLAGS) -c -o $@
  261. # --------------------------------------------------------------
  262. # win32
  263. OBJS_WIN32 = carla_bridge_plugin__win32.o \
  264. carla_bridge_client__win32.o carla_bridge_osc__win32.o
  265. # carla-engine
  266. OBJS_WIN32 += \
  267. ../carla-engine/carla_engine__win32.o \
  268. ../carla-engine/carla_engine_osc__win32.o \
  269. ../carla-engine/carla_engine_thread__win32.o \
  270. ../carla-engine/jack__win32.o
  271. # carla-plugin
  272. OBJS_WIN32 += \
  273. ../carla-plugin/carla_plugin__win32.o \
  274. ../carla-plugin/carla_plugin_thread__win32.o \
  275. ../carla-plugin/ladspa__win32.o \
  276. ../carla-plugin/dssi__win32.o \
  277. ../carla-plugin/lv2__win32.o \
  278. ../carla-plugin/vst__win32.o
  279. # libs
  280. OBJS_WIN32 += \
  281. ../carla-lilv/carla_lilv_win32.a \
  282. ../carla-rtmempool/carla_rtmempool_win32.a
  283. carla-bridge-win32.exe: $(OBJS_WIN32) ../carla-jackbridge/libcarla-jackbridge-win32.dll
  284. $(CXX) $(OBJS_WIN32) $(WIN_32BIT_FLAGS) $(WIN_LINK_FLAGS) -lcarla-jackbridge-win32 -o $@ && $(STRIP) $@
  285. %__win32.o: %.cpp
  286. $(CXX) $< $(WIN_BUILD_FLAGS) $(WIN_32BIT_FLAGS) -c -o $@
  287. # --------------------------------------------------------------
  288. # win64
  289. OBJS_WIN64 = carla_bridge_plugin__win64.o \
  290. carla_bridge_client__win64.o carla_bridge_osc__win64.o
  291. # carla-engine
  292. OBJS_WIN64 += \
  293. ../carla-engine/carla_engine__win64.o \
  294. ../carla-engine/carla_engine_osc__win64.o \
  295. ../carla-engine/carla_engine_thread__win64.o \
  296. ../carla-engine/jack__win64.o
  297. # carla-plugin
  298. OBJS_WIN64 += \
  299. ../carla-plugin/carla_plugin__win64.o \
  300. ../carla-plugin/carla_plugin_thread__win64.o \
  301. ../carla-plugin/ladspa__win64.o \
  302. ../carla-plugin/dssi__win64.o \
  303. ../carla-plugin/lv2__win64.o \
  304. ../carla-plugin/vst__win64.o
  305. # libs
  306. OBJS_WIN64 += \
  307. ../carla-lilv/carla_lilv_win64.a \
  308. ../carla-rtmempool/carla_rtmempool_win64.a
  309. carla-bridge-win64.exe: $(OBJS_WIN64) ../carla-jackbridge/libcarla-jackbridge-win64.dll
  310. $(CXX) $(OBJS_WIN64) $(WIN_64BIT_FLAGS) $(WIN_LINK_FLAGS) -lcarla-jackbridge-win64 -o $@ && $(STRIP) $@
  311. %__win64.o: %.cpp
  312. $(CXX) $< $(WIN_BUILD_FLAGS) $(WIN_64BIT_FLAGS) -c -o $@
  313. # --------------------------------------------------------------
  314. ../libs/%:
  315. $(MAKE) -C ../libs $*
  316. ../carla-jackbridge/libcarla-jackbridge-win32.dll:
  317. $(MAKE) -C ../carla-jackbridge win32
  318. ../carla-jackbridge/libcarla-jackbridge-win64.dll:
  319. $(MAKE) -C ../carla-jackbridge win64
  320. # --------------------------------------------------------------
  321. doxygen: carla_bridge.doxygen
  322. doxygen $<
  323. clean:
  324. rm -f *.o *.dll *.so *.exe
  325. rm -f $(OBJS_NATIVE)
  326. rm -f $(OBJS_POSIX32)
  327. rm -f $(OBJS_POSIX64)
  328. rm -f $(OBJS_WIN32)
  329. rm -f $(OBJS_WIN64)
  330. rm -f carla-bridge-lv2-gtk2 carla-bridge-lv2-gtk3 carla-bridge-lv2-qt4 carla-bridge-lv2-qt5 carla-bridge-lv2-x11 carla-bridge-vst-x11
  331. rm -f carla-bridge-native carla-bridge-posix32 carla-bridge-posix64