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.

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