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.

458 lines
13KB

  1. #!/usr/bin/make -f
  2. # Makefile for Carla #
  3. # ------------------ #
  4. # Created by falkTX
  5. #
  6. include source/Makefile.mk
  7. # --------------------------------------------------------------
  8. PREFIX = /usr/local
  9. DESTDIR =
  10. SED_PREFIX = $(shell echo $(PREFIX) | sed "s/\//\\\\\\\\\//g")
  11. LINK = ln -sf
  12. ifneq ($(MACOS),true)
  13. PYUIC ?= pyuic4 -w
  14. PYRCC ?= pyrcc4 -py3
  15. else
  16. PYUIC ?= pyuic4-3.3 -w
  17. PYRCC ?= pyrcc4-3.3 -py3
  18. endif
  19. # --------------------------------------------------------------
  20. all: CXX RES UI WIDGETS
  21. # --------------------------------------------------------------
  22. # C++ code (native)
  23. CXX: backend bridges discovery plugin theme
  24. backend:
  25. $(MAKE) -C source/backend
  26. bridges:
  27. $(MAKE) -C source/bridges
  28. discovery:
  29. $(MAKE) -C source/discovery
  30. plugin:
  31. $(MAKE) -C source/plugin
  32. theme:
  33. $(MAKE) -C source/modules/theme
  34. # --------------------------------------------------------------
  35. # C++ code (variants)
  36. posix32:
  37. $(MAKE) -C source/bridges posix32
  38. $(MAKE) -C source/discovery posix32
  39. posix64:
  40. $(MAKE) -C source/bridges posix64
  41. $(MAKE) -C source/discovery posix64
  42. win32:
  43. $(MAKE) -C source/bridges win32
  44. $(MAKE) -C source/discovery win32
  45. win64:
  46. $(MAKE) -C source/bridges win64
  47. $(MAKE) -C source/discovery win64
  48. wine32:
  49. $(MAKE) -C source/libs jackbridge-wine32
  50. $(LINK) ../libs/jackbridge-win32.dll.so source/bridges/jackbridge-win32.dll
  51. wine64:
  52. $(MAKE) -C source/libs jackbridge-wine64
  53. $(LINK) ../libs/jackbridge-win64.dll.so source/bridges/jackbridge-win64.dll
  54. # --------------------------------------------------------------
  55. # Resources
  56. RES = source/resources_rc.py
  57. RES: $(RES)
  58. source/%_rc.py: resources/%.qrc resources/*/*.png resources/*/*.svg
  59. $(PYRCC) $< -o $@
  60. # --------------------------------------------------------------
  61. # UI code
  62. UIs = \
  63. source/ui_carla_control.py \
  64. source/ui_carla_about.py \
  65. source/ui_carla_database.py \
  66. source/ui_carla_edit.py \
  67. source/ui_carla_host.py \
  68. source/ui_carla_parameter.py \
  69. source/ui_carla_plugin_default.py \
  70. source/ui_carla_plugin_calf.py \
  71. source/ui_carla_plugin_zynfx.py \
  72. source/ui_carla_refresh.py \
  73. source/ui_carla_settings.py \
  74. source/ui_carla_settings_driver.py \
  75. source/ui_inputdialog_value.py
  76. UI: $(UIs)
  77. source/ui_%.py: resources/ui/%.ui
  78. $(PYUIC) $< -o $@
  79. # --------------------------------------------------------------
  80. # Widgets
  81. WIDGETS = \
  82. source/canvaspreviewframe.py \
  83. source/digitalpeakmeter.py \
  84. source/ledbutton.py \
  85. source/paramspinbox.py \
  86. source/pixmapbutton.py \
  87. source/pixmapdial.py \
  88. source/pixmapkeyboard.py
  89. WIDGETS: $(WIDGETS)
  90. source/%.py: source/widgets/%.py
  91. $(LINK) widgets/$*.py $@
  92. # --------------------------------------------------------------
  93. clean:
  94. $(MAKE) clean -C source/backend
  95. $(MAKE) clean -C source/bridges
  96. $(MAKE) clean -C source/discovery
  97. $(MAKE) clean -C source/modules
  98. $(MAKE) clean -C source/plugin
  99. rm -f $(RES)
  100. rm -f $(UIs)
  101. rm -f $(WIDGETS)
  102. rm -f *~ source/*~ source/*.pyc source/*_rc.py source/ui_*.py
  103. # --------------------------------------------------------------
  104. debug:
  105. $(MAKE) DEBUG=true
  106. # --------------------------------------------------------------
  107. doxygen:
  108. $(MAKE) doxygen -C source/backend
  109. # --------------------------------------------------------------
  110. install:
  111. # Create directories
  112. install -d $(DESTDIR)$(PREFIX)/bin/
  113. install -d $(DESTDIR)$(PREFIX)/lib/carla/
  114. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/
  115. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/nekofilter/
  116. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/zynaddsubfx/
  117. install -d $(DESTDIR)$(PREFIX)/lib/lv2/carla-native.lv2/
  118. install -d $(DESTDIR)$(PREFIX)/lib/pkgconfig/
  119. install -d $(DESTDIR)$(PREFIX)/include/carla/
  120. install -d $(DESTDIR)$(PREFIX)/include/carla/includes/
  121. install -d $(DESTDIR)$(PREFIX)/share/applications/
  122. install -d $(DESTDIR)$(PREFIX)/share/carla/
  123. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  124. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  125. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  126. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  127. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  128. install -d $(DESTDIR)$(PREFIX)/share/mime/packages/
  129. # Install script files
  130. install -m 755 \
  131. data/carla \
  132. data/carla-control \
  133. data/carla-database \
  134. data/carla-patchbay \
  135. data/carla-rack \
  136. data/carla-settings \
  137. data/carla-single \
  138. $(DESTDIR)$(PREFIX)/bin/
  139. # Install desktop files
  140. install -m 644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications/
  141. # Install icons, 16x16
  142. install -m 644 resources/16x16/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  143. install -m 644 resources/16x16/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  144. # Install icons, 48x48
  145. install -m 644 resources/48x48/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  146. install -m 644 resources/48x48/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  147. # Install icons, 128x128
  148. install -m 644 resources/128x128/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  149. install -m 644 resources/128x128/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  150. # Install icons, 256x256
  151. install -m 644 resources/256x256/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  152. install -m 644 resources/256x256/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  153. # Install icons, scalable
  154. install -m 644 resources/scalable/carla.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  155. install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  156. # Install mime package
  157. install -m 644 data/carla.xml $(DESTDIR)$(PREFIX)/share/mime/packages/
  158. # Install pkgconfig file
  159. install -m 644 data/carla-standalone.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig/
  160. # Install backend
  161. install -m 644 \
  162. source/backend/*.so \
  163. $(DESTDIR)$(PREFIX)/lib/carla/
  164. # Install binaries
  165. install -m 755 \
  166. source/bridges/carla-bridge-* \
  167. source/discovery/carla-discovery-* \
  168. $(DESTDIR)$(PREFIX)/lib/carla/
  169. # Install plugin
  170. install -m 644 \
  171. source/plugin/carla-native.lv2/*.so \
  172. source/plugin/carla-native.lv2/*.ttl \
  173. $(DESTDIR)$(PREFIX)/lib/lv2/carla-native.lv2/
  174. # Install python code
  175. install -m 644 source/*.py $(DESTDIR)$(PREFIX)/share/carla/
  176. # Install python "binaries"
  177. install -m 755 \
  178. source/carla \
  179. source/carla-patchbay \
  180. source/carla-rack \
  181. $(DESTDIR)$(PREFIX)/share/carla/
  182. # Install headers
  183. install -m 644 source/backend/CarlaBackend.h $(DESTDIR)$(PREFIX)/include/carla/
  184. install -m 644 source/backend/CarlaHost.h $(DESTDIR)$(PREFIX)/include/carla/
  185. install -m 644 source/includes/CarlaDefines.h $(DESTDIR)$(PREFIX)/include/carla/includes/
  186. # Install resources
  187. install -m 644 source/modules/carla_native/resources/*-ui $(DESTDIR)$(PREFIX)/lib/carla/resources/
  188. install -m 644 source/modules/carla_native/resources/*.py $(DESTDIR)$(PREFIX)/lib/carla/resources/
  189. install -m 644 source/modules/carla_native/resources/nekofilter/*.png $(DESTDIR)$(PREFIX)/lib/carla/resources/nekofilter/
  190. install -m 644 source/modules/carla_native/resources/zynaddsubfx/*.png $(DESTDIR)$(PREFIX)/lib/carla/resources/zynaddsubfx/
  191. # Install theme
  192. $(MAKE) STYLES_DIR=$(DESTDIR)$(PREFIX)/lib/carla/styles install-main -C source/modules/theme
  193. # Adjust PREFIX value in script files
  194. sed -i "s/X-PREFIX-X/$(SED_PREFIX)/" \
  195. $(DESTDIR)$(PREFIX)/bin/carla \
  196. $(DESTDIR)$(PREFIX)/bin/carla-control \
  197. $(DESTDIR)$(PREFIX)/bin/carla-database \
  198. $(DESTDIR)$(PREFIX)/bin/carla-patchbay \
  199. $(DESTDIR)$(PREFIX)/bin/carla-rack \
  200. $(DESTDIR)$(PREFIX)/bin/carla-settings \
  201. $(DESTDIR)$(PREFIX)/bin/carla-single \
  202. $(DESTDIR)$(PREFIX)/lib/pkgconfig/carla-standalone.pc
  203. # Set plugin resources
  204. cd $(DESTDIR)$(PREFIX)/lib/lv2/carla-native.lv2/ && \
  205. $(LINK) $(PREFIX)/lib/carla/resources/
  206. # --------------------------------------------------------------
  207. uninstall:
  208. rm -f $(DESTDIR)$(PREFIX)/bin/carla*
  209. rm -f $(DESTDIR)$(PREFIX)/share/applications/carla.desktop
  210. rm -f $(DESTDIR)$(PREFIX)/share/applications/carla-control.desktop
  211. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla.png
  212. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla-control.png
  213. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla.svg
  214. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla-control.svg
  215. rm -f $(DESTDIR)$(PREFIX)/share/mime/packages/carla.xml
  216. rm -f $(DESTDIR)$(PREFIX)/lib/dssi/carla-dssi.so
  217. rm -f $(DESTDIR)$(PREFIX)/lib/vst/carla-vst.so
  218. rm -rf $(DESTDIR)$(PREFIX)/lib/carla/
  219. rm -rf $(DESTDIR)$(PREFIX)/lib/lv2/carla.lv2/
  220. rm -rf $(DESTDIR)$(PREFIX)/share/carla/
  221. # --------------------------------------------------------------
  222. ifneq ($(HAIKU),true)
  223. ANS_NO=\033[31m NO \033[0m
  224. ANS_YES=\033[32m YES \033[0m
  225. mS=\033[33m[
  226. mZ=\033[30;1m[
  227. mE=]\033[0m
  228. tS=\033[36m
  229. tE=\033[0m
  230. else
  231. ANS_NO=" NO "
  232. ANS_YES=" YES "
  233. endif
  234. features:
  235. @echo "$(tS)---> Engine driver $(tE)"
  236. @echo "JACK: $(ANS_YES)"
  237. ifeq ($(LINUX),true)
  238. ifeq ($(HAVE_ALSA),true)
  239. @echo "ALSA: $(ANS_YES)"
  240. else
  241. @echo "ALSA: $(ANS_NO) $(mS)Missing ALSA$(mE)"
  242. endif
  243. ifeq ($(HAVE_PULSEAUDIO),true)
  244. @echo "PulseAudio: $(ANS_YES)"
  245. else
  246. @echo "PulseAudio: $(ANS_NO) $(mS)Missing PulseAudio$(mE)"
  247. endif
  248. else
  249. @echo "ALSA: $(ANS_NO) $(mZ)Linux only$(mE)"
  250. @echo "PulseAudio: $(ANS_NO) $(mZ)Linux only$(mE)"
  251. endif
  252. ifeq ($(MACOS),true)
  253. @echo "CoreAudio: $(ANS_YES)"
  254. else
  255. @echo "CoreAudio: $(ANS_NO) $(mZ)MacOS only$(mE)"
  256. endif
  257. ifeq ($(WIN32),true)
  258. @echo "ASIO: $(ANS_YES)"
  259. @echo "DirectSound:$(ANS_YES)"
  260. else
  261. @echo "ASIO: $(ANS_NO) $(mZ)Windows only$(mE)"
  262. @echo "DirectSound:$(ANS_NO) $(mZ)Windows only$(mE)"
  263. endif
  264. @echo ""
  265. @echo "$(tS)---> Plugin formats: $(tE)"
  266. @echo "Internal:$(ANS_YES)"
  267. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  268. @echo "LADSPA: $(ANS_YES)"
  269. @echo "DSSI: $(ANS_YES)"
  270. @echo "LV2: $(ANS_YES)"
  271. @echo "VST: $(ANS_YES)"
  272. ifeq ($(MACOS),true)
  273. @echo "AU: $(ANS_YES)"
  274. else
  275. @echo "AU: $(ANS_NO) $(mZ)MacOS only$(mE)"
  276. endif
  277. else
  278. @echo "LADSPA: $(ANS_NO) $(mS)Plugins disabled$(mE)"
  279. @echo "DSSI: $(ANS_NO) $(mS)Plugins disabled$(mE)"
  280. @echo "LV2: $(ANS_NO) $(mS)Plugins disabled$(mE)"
  281. @echo "VST: $(ANS_NO) $(mS)Plugins disabled$(mE)"
  282. @echo "AU: $(ANS_NO) $(mS)Plugins disabled$(mE)"
  283. endif
  284. @echo ""
  285. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  286. @echo "$(tS)---> LV2 UI toolkit support: $(tE)"
  287. @echo "External:$(ANS_YES) (direct+bridge)"
  288. ifeq ($(LINUX),true)
  289. ifeq ($(HAVE_GTK2),true)
  290. @echo "Gtk2: $(ANS_YES) (bridge)"
  291. else
  292. @echo "Gtk2: $(ANS_NO) $(mS)Gtk2 missing$(mE)"
  293. endif
  294. ifeq ($(HAVE_GTK3),true)
  295. @echo "Gtk3: $(ANS_YES) (bridge)"
  296. else
  297. @echo "Gtk3: $(ANS_NO) $(mS)Gtk3 missing$(mE)"
  298. endif
  299. ifeq ($(HAVE_QT4),true)
  300. @echo "Qt4: $(ANS_YES) (bridge)"
  301. else
  302. @echo "Qt4: $(ANS_NO) $(mS)Qt4 missing$(mE)"
  303. endif
  304. ifeq ($(HAVE_QT5),true)
  305. @echo "Qt5: $(ANS_YES) (bridge)"
  306. else
  307. @echo "Qt5: $(ANS_NO) $(mS)Qt5 missing$(mE)"
  308. endif
  309. @echo "X11: $(ANS_YES) (direct+bridge)"
  310. else
  311. @echo "Gtk2: $(ANS_NO) $(mZ)Linux only$(mE)"
  312. @echo "Gtk3: $(ANS_NO) $(mZ)Linux only$(mE)"
  313. @echo "Qt4: $(ANS_NO) $(mZ)Linux only$(mE)"
  314. @echo "Qt5: $(ANS_NO) $(mZ)Linux only$(mE)"
  315. @echo "X11: $(ANS_NO) $(mZ)Linux only$(mE)"
  316. endif
  317. ifeq ($(MACOS),true)
  318. @echo "Cocoa: $(ANS_YES) (direct+bridge)"
  319. else
  320. @echo "Cocoa: $(ANS_NO) $(mZ)MacOS only$(mE)"
  321. endif
  322. ifeq ($(WIN32),true)
  323. @echo "Windows: $(ANS_YES) (direct+bridge)"
  324. else
  325. @echo "Windows: $(ANS_NO) $(mZ)Windows only$(mE)"
  326. endif
  327. @echo ""
  328. endif
  329. @echo "$(tS)---> File formats: $(tE)"
  330. ifeq ($(CARLA_CSOUND_SUPPORT),true)
  331. @echo "CSD:$(ANS_YES)"
  332. else
  333. @echo "CSD:$(ANS_NO) $(mS)CSound disabled$(mE)"
  334. endif
  335. ifeq ($(CARLA_SAMPLERS_SUPPORT),true)
  336. ifeq ($(HAVE_LINUXSAMPLER),true)
  337. @echo "GIG:$(ANS_YES)"
  338. else
  339. @echo "GIG:$(ANS_NO) $(mS)LinuxSampler missing$(mE)"
  340. endif
  341. ifeq ($(HAVE_FLUIDSYNTH),true)
  342. @echo "SF2:$(ANS_YES)"
  343. else
  344. @echo "SF2:$(ANS_NO) $(mS)FluidSynth missing$(mE)"
  345. endif
  346. ifeq ($(HAVE_LINUXSAMPLER),true)
  347. @echo "SFZ:$(ANS_YES)"
  348. else
  349. @echo "SFZ:$(ANS_NO) $(mS)LinuxSampler missing$(mE)"
  350. endif
  351. else
  352. @echo "GIG:$(ANS_NO) $(mS)Samplers disabled$(mE)"
  353. @echo "SF2:$(ANS_NO) $(mS)Samplers disabled$(mE)"
  354. @echo "SFZ:$(ANS_NO) $(mS)Samplers disabled$(mE)"
  355. endif
  356. @echo ""
  357. @echo "$(tS)---> Internal plugins: $(tE)"
  358. ifeq ($(HAVE_AF_DEPS),true)
  359. ifeq ($(HAVE_FFMPEG),true)
  360. @echo "AudioFile: $(ANS_YES) (with ffmpeg)"
  361. else
  362. @echo "AudioFile: $(ANS_YES) (without ffmpeg) $(mS)ffmpeg/libav missing or too new$(mE)"
  363. endif
  364. else
  365. @echo "AudioFile: $(ANS_NO) $(mS)libsndfile missing$(mE)"
  366. endif
  367. ifeq ($(HAVE_MF_DEPS),true)
  368. @echo "MidiFile: $(ANS_YES)"
  369. else
  370. @echo "MidiFile: $(ANS_NO) $(mS)LibSMF missing$(mE)"
  371. endif
  372. ifeq ($(HAVE_OPENGL),true)
  373. @echo "DISTRHO: $(ANS_YES)"
  374. else
  375. @echo "DISTRHO: $(ANS_NO) $(mS)OpenGL missing$(mE)"
  376. endif
  377. ifeq ($(HAVE_ZYN_DEPS),true)
  378. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  379. @echo "ZynAddSubFX:$(ANS_YES) (with UI)"
  380. else
  381. @echo "ZynAddSubFX:$(ANS_YES) (without UI) $(mS)NTK missing$(mE)"
  382. endif
  383. else
  384. @echo "ZynAddSubFX:$(ANS_NO) $(mS)fftw3, mxml or zlib missing$(mE)"
  385. endif
  386. # --------------------------------------------------------------