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.

520 lines
15KB

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