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.

845 lines
27KB

  1. #!/usr/bin/make -f
  2. # Makefile for Carla #
  3. # ------------------ #
  4. # Created by falkTX
  5. #
  6. CWD=source
  7. include source/Makefile.mk
  8. # ---------------------------------------------------------------------------------------------------------------------
  9. PREFIX := /usr/local
  10. BINDIR := $(PREFIX)/bin
  11. LIBDIR := $(PREFIX)/lib
  12. DATADIR := $(PREFIX)/share
  13. INCLUDEDIR := $(PREFIX)/include
  14. DESTDIR :=
  15. ifeq ($(DEBUG),true)
  16. MODULEDIR := $(CURDIR)/build/modules/Debug
  17. else
  18. MODULEDIR := $(CURDIR)/build/modules/Release
  19. endif
  20. VERSION := 2.3
  21. # ---------------------------------------------------------------------------------------------------------------------
  22. all: backend discovery bridges-plugin bridges-ui frontend interposer libjack plugin theme
  23. # ---------------------------------------------------------------------------------------------------------------------
  24. # Binaries (native)
  25. ALL_LIBS += $(MODULEDIR)/carla_engine.a
  26. ALL_LIBS += $(MODULEDIR)/carla_engine_plugin.a
  27. ALL_LIBS += $(MODULEDIR)/carla_plugin.a
  28. ALL_LIBS += $(MODULEDIR)/jackbridge.a
  29. ALL_LIBS += $(MODULEDIR)/native-plugins.a
  30. ALL_LIBS += $(MODULEDIR)/rtmempool.a
  31. 3RD_LIBS += $(MODULEDIR)/audio_decoder.a
  32. 3RD_LIBS += $(MODULEDIR)/lilv.a
  33. 3RD_LIBS += $(MODULEDIR)/sfzero.a
  34. 3RD_LIBS += $(MODULEDIR)/water.a
  35. 3RD_LIBS += $(MODULEDIR)/zita-resampler.a
  36. ifeq ($(HAVE_DGL),true)
  37. 3RD_LIBS += $(MODULEDIR)/dgl.a
  38. endif
  39. ifeq ($(HAVE_HYLIA),true)
  40. 3RD_LIBS += $(MODULEDIR)/hylia.a
  41. endif
  42. ifeq ($(HAVE_QT4),true)
  43. 3RD_LIBS += $(MODULEDIR)/theme.qt4.a
  44. endif
  45. ifeq ($(HAVE_QT5),true)
  46. 3RD_LIBS += $(MODULEDIR)/theme.qt5.a
  47. endif
  48. ifeq ($(USING_JUCE),true)
  49. 3RD_LIBS += $(MODULEDIR)/juce_audio_basics.a
  50. ifeq ($(USING_JUCE_AUDIO_DEVICES),true)
  51. 3RD_LIBS += $(MODULEDIR)/juce_audio_devices.a
  52. endif
  53. 3RD_LIBS += $(MODULEDIR)/juce_audio_processors.a
  54. 3RD_LIBS += $(MODULEDIR)/juce_core.a
  55. 3RD_LIBS += $(MODULEDIR)/juce_data_structures.a
  56. 3RD_LIBS += $(MODULEDIR)/juce_events.a
  57. 3RD_LIBS += $(MODULEDIR)/juce_graphics.a
  58. 3RD_LIBS += $(MODULEDIR)/juce_gui_basics.a
  59. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  60. 3RD_LIBS += $(MODULEDIR)/juce_gui_extra.a
  61. endif
  62. endif
  63. ifneq ($(USING_JUCE_AUDIO_DEVICES),true)
  64. 3RD_LIBS += $(MODULEDIR)/rtaudio.a
  65. 3RD_LIBS += $(MODULEDIR)/rtmidi.a
  66. endif
  67. ALL_LIBS += $(3RD_LIBS)
  68. 3rd: $(3RD_LIBS)
  69. @$(MAKE) -C source/theme
  70. ifeq ($(HAVE_QT4),true)
  71. @$(MAKE) -C source/bridges-ui ui_lv2-qt4
  72. endif
  73. libs: $(ALL_LIBS)
  74. $(MODULEDIR)/carla_engine.a: .FORCE
  75. @$(MAKE) -C source/backend/engine
  76. $(MODULEDIR)/carla_engine_plugin.a: $(MODULEDIR)/carla_engine.a
  77. @$(MAKE) -C source/backend/engine
  78. $(MODULEDIR)/carla_plugin.a: .FORCE
  79. @$(MAKE) -C source/backend/plugin
  80. $(MODULEDIR)/jackbridge.a: .FORCE
  81. @$(MAKE) -C source/jackbridge
  82. $(MODULEDIR)/jackbridge.%.a: .FORCE
  83. @$(MAKE) -C source/jackbridge $*
  84. $(MODULEDIR)/native-plugins.a: .FORCE
  85. @$(MAKE) -C source/native-plugins
  86. $(MODULEDIR)/theme.qt4.a: .FORCE
  87. @$(MAKE) -C source/theme qt4
  88. $(MODULEDIR)/theme.qt5.a: .FORCE
  89. @$(MAKE) -C source/theme qt5
  90. $(MODULEDIR)/%.arm32.a: .FORCE
  91. ifneq ($(WIN32),true)
  92. @$(MAKE) -C source/modules/$* arm32
  93. else
  94. $(error Trying to build ARM binaries with a Windows toolchain, this cannot work)
  95. endif
  96. $(MODULEDIR)/%.posix32.a: .FORCE
  97. ifneq ($(WIN32),true)
  98. @$(MAKE) -C source/modules/$* posix32
  99. else
  100. $(error Trying to build POSIX binaries with a Windows toolchain, this cannot work)
  101. endif
  102. $(MODULEDIR)/%.posix64.a: .FORCE
  103. ifneq ($(WIN32),true)
  104. @$(MAKE) -C source/modules/$* posix64
  105. else
  106. $(error Trying to build POSIX binaries with a Windows toolchain, this cannot work)
  107. endif
  108. $(MODULEDIR)/%.win32.a: .FORCE
  109. ifeq ($(WIN32),true)
  110. @$(MAKE) -C source/modules/$* win32
  111. else
  112. $(error Trying to build Windows binaries with a regular toolchain, this cannot work)
  113. endif
  114. $(MODULEDIR)/%.win64.a: .FORCE
  115. ifeq ($(WIN32),true)
  116. @$(MAKE) -C source/modules/$* win64
  117. else
  118. $(error Trying to build Windows binaries with a regular toolchain, this cannot work)
  119. endif
  120. $(MODULEDIR)/dgl.wine.a: .FORCE
  121. @$(MAKE) -C source/modules/dgl wine
  122. $(MODULEDIR)/water.files.a: .FORCE
  123. @$(MAKE) -C source/modules/water files
  124. $(MODULEDIR)/%.a: .FORCE
  125. @$(MAKE) -C source/modules/$*
  126. # ---------------------------------------------------------------------------------------------------------------------
  127. backend: libs
  128. @$(MAKE) -C source/backend
  129. bridges-plugin: libs
  130. @$(MAKE) -C source/bridges-plugin
  131. bridges-ui: libs
  132. @$(MAKE) -C source/bridges-ui
  133. discovery: libs
  134. @$(MAKE) -C source/discovery
  135. frontend: libs
  136. ifeq ($(HAVE_PYQT),true)
  137. @$(MAKE) -C source/frontend
  138. endif
  139. interposer:
  140. ifeq ($(LINUX),true)
  141. @$(MAKE) -C source/interposer
  142. endif
  143. libjack: libs
  144. @$(MAKE) -C source/libjack
  145. lv2-bundles-dep: $(MODULEDIR)/audio_decoder.a $(MODULEDIR)/water.a $(MODULEDIR)/zita-resampler.a
  146. @$(MAKE) -C source/native-plugins bundles
  147. lv2-bundles: lv2-bundles-dep
  148. @$(MAKE) -C source/plugin bundles
  149. plugin: backend bridges-plugin bridges-ui discovery
  150. @$(MAKE) -C source/plugin
  151. ifeq ($(WIN32),true)
  152. plugin-wine:
  153. @$(MAKE) -C source/plugin wine
  154. else
  155. plugin-wine: $(MODULEDIR)/dgl.wine.a
  156. @$(MAKE) -C source/plugin wine
  157. endif
  158. rest: libs
  159. @$(MAKE) -C source/rest
  160. theme: libs
  161. @$(MAKE) -C source/theme
  162. # ---------------------------------------------------------------------------------------------------------------------
  163. # hacks
  164. msys2fix:
  165. rm -rf source/includes/serd
  166. rm -rf source/includes/sord
  167. rm -rf source/includes/sratom
  168. rm -rf source/includes/lilv
  169. cp -r source/modules/lilv/serd-0.24.0/serd source/includes/serd
  170. cp -r source/modules/lilv/sord-0.16.0/sord source/includes/sord
  171. cp -r source/modules/lilv/sratom-0.6.0/sratom source/includes/sratom
  172. cp -r source/modules/lilv/lilv-0.24.0/lilv source/includes/lilv
  173. # ---------------------------------------------------------------------------------------------------------------------
  174. # nuitka
  175. nuitka: bin/carla bin/carla-rack bin/carla-plugin
  176. bin/carla:
  177. python3 -m nuitka \
  178. -j 4 \
  179. --python-flag -O --warn-unusual-code --warn-implicit-exceptions \
  180. --follow-imports \
  181. -o ./$@ \
  182. ./source/frontend/carla
  183. bin/carla-rack:
  184. python3 -m nuitka \
  185. -j 8 \
  186. --recurse-all \
  187. --python-flag -O --warn-unusual-code --warn-implicit-exceptions \
  188. --recurse-not-to=PyQt5 \
  189. --file-reference-choice=runtime \
  190. -o ./$@ \
  191. ./source/frontend/carla
  192. bin/carla-plugin:
  193. python3 -m nuitka \
  194. -j 8 \
  195. --recurse-all \
  196. --python-flag -O --warn-unusual-code --warn-implicit-exceptions \
  197. --recurse-not-to=PyQt5 \
  198. --file-reference-choice=runtime \
  199. -o ./$@ \
  200. ./source/native-plugins/resources/carla-plugin
  201. # ---------------------------------------------------------------------------------------------------------------------
  202. # Binaries (arm32)
  203. LIBS_ARM32 = $(MODULEDIR)/jackbridge.arm32.a
  204. LIBS_ARM32 += $(MODULEDIR)/lilv.arm32.a
  205. LIBS_ARM32 += $(MODULEDIR)/rtmempool.arm32.a
  206. LIBS_ARM32 += $(MODULEDIR)/water.arm32.a
  207. arm32: $(LIBS_ARM32)
  208. $(MAKE) -C source/bridges-plugin arm32
  209. $(MAKE) -C source/discovery arm32
  210. # ---------------------------------------------------------------------------------------------------------------------
  211. # Binaries (posix32)
  212. LIBS_POSIX32 = $(MODULEDIR)/jackbridge.posix32.a
  213. LIBS_POSIX32 += $(MODULEDIR)/lilv.posix32.a
  214. LIBS_POSIX32 += $(MODULEDIR)/rtmempool.posix32.a
  215. LIBS_POSIX32 += $(MODULEDIR)/water.posix32.a
  216. ifeq ($(USING_JUCE),true)
  217. LIBS_POSIX32 += $(MODULEDIR)/juce_audio_basics.posix32.a
  218. LIBS_POSIX32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  219. LIBS_POSIX32 += $(MODULEDIR)/juce_data_structures.posix32.a
  220. LIBS_POSIX32 += $(MODULEDIR)/juce_core.posix32.a
  221. LIBS_POSIX32 += $(MODULEDIR)/juce_events.posix32.a
  222. LIBS_POSIX32 += $(MODULEDIR)/juce_graphics.posix32.a
  223. LIBS_POSIX32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  224. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  225. LIBS_POSIX32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  226. endif
  227. endif
  228. posix32: $(LIBS_POSIX32)
  229. $(MAKE) -C source/bridges-plugin posix32
  230. $(MAKE) -C source/discovery posix32
  231. # ---------------------------------------------------------------------------------------------------------------------
  232. # Binaries (posix64)
  233. LIBS_POSIX64 = $(MODULEDIR)/jackbridge.posix64.a
  234. LIBS_POSIX64 += $(MODULEDIR)/lilv.posix64.a
  235. LIBS_POSIX64 += $(MODULEDIR)/rtmempool.posix64.a
  236. LIBS_POSIX64 += $(MODULEDIR)/water.posix64.a
  237. ifeq ($(USING_JUCE),true)
  238. LIBS_POSIX64 += $(MODULEDIR)/juce_audio_basics.posix64.a
  239. LIBS_POSIX64 += $(MODULEDIR)/juce_audio_processors.posix64.a
  240. LIBS_POSIX64 += $(MODULEDIR)/juce_data_structures.posix64.a
  241. LIBS_POSIX64 += $(MODULEDIR)/juce_core.posix64.a
  242. LIBS_POSIX64 += $(MODULEDIR)/juce_events.posix64.a
  243. LIBS_POSIX64 += $(MODULEDIR)/juce_graphics.posix64.a
  244. LIBS_POSIX64 += $(MODULEDIR)/juce_gui_basics.posix64.a
  245. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  246. LIBS_POSIX64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  247. endif
  248. endif
  249. posix64: $(LIBS_POSIX64)
  250. $(MAKE) -C source/bridges-plugin posix64
  251. $(MAKE) -C source/discovery posix64
  252. # ---------------------------------------------------------------------------------------------------------------------
  253. # Binaries (win32)
  254. LIBS_WIN32 += $(MODULEDIR)/lilv.win32.a
  255. LIBS_WIN32 += $(MODULEDIR)/rtmempool.win32.a
  256. LIBS_WIN32 += $(MODULEDIR)/water.win32.a
  257. ifeq ($(USING_JUCE),true)
  258. LIBS_WIN32 += $(MODULEDIR)/juce_audio_basics.win32.a
  259. LIBS_WIN32 += $(MODULEDIR)/juce_audio_processors.win32.a
  260. LIBS_WIN32 += $(MODULEDIR)/juce_data_structures.win32.a
  261. LIBS_WIN32 += $(MODULEDIR)/juce_core.win32.a
  262. LIBS_WIN32 += $(MODULEDIR)/juce_events.win32.a
  263. LIBS_WIN32 += $(MODULEDIR)/juce_graphics.win32.a
  264. LIBS_WIN32 += $(MODULEDIR)/juce_gui_basics.win32.a
  265. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  266. LIBS_WIN32 += $(MODULEDIR)/juce_gui_extra.win32.a
  267. endif
  268. endif
  269. LIBS_WINE32 = $(LIBS_WIN32) $(MODULEDIR)/jackbridge.win32e.a
  270. LIBS_RWIN32 = $(LIBS_WIN32) $(MODULEDIR)/jackbridge.win32.a
  271. win32: $(LIBS_WINE32)
  272. $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win32
  273. $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win32
  274. win32r: $(LIBS_RWIN32)
  275. $(MAKE) -C source/bridges-plugin win32
  276. $(MAKE) -C source/discovery win32
  277. # ---------------------------------------------------------------------------------------------------------------------
  278. # Binaries (win64)
  279. LIBS_WIN64 += $(MODULEDIR)/lilv.win64.a
  280. LIBS_WIN64 += $(MODULEDIR)/rtmempool.win64.a
  281. LIBS_WIN64 += $(MODULEDIR)/water.win64.a
  282. ifeq ($(USING_JUCE),true)
  283. LIBS_WIN64 += $(MODULEDIR)/juce_audio_basics.win64.a
  284. LIBS_WIN64 += $(MODULEDIR)/juce_audio_processors.win64.a
  285. LIBS_WIN64 += $(MODULEDIR)/juce_data_structures.win64.a
  286. LIBS_WIN64 += $(MODULEDIR)/juce_core.win64.a
  287. LIBS_WIN64 += $(MODULEDIR)/juce_events.win64.a
  288. LIBS_WIN64 += $(MODULEDIR)/juce_graphics.win64.a
  289. LIBS_WIN64 += $(MODULEDIR)/juce_gui_basics.win64.a
  290. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  291. LIBS_WIN64 += $(MODULEDIR)/juce_gui_extra.win64.a
  292. endif
  293. endif
  294. LIBS_WINE64 = $(LIBS_WIN64) $(MODULEDIR)/jackbridge.win64e.a
  295. LIBS_RWIN64 = $(LIBS_WIN64) $(MODULEDIR)/jackbridge.win64.a
  296. win64: $(LIBS_WINE64)
  297. $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win64
  298. $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win64
  299. win64r: $(LIBS_RWIN64)
  300. $(MAKE) -C source/bridges-plugin win64
  301. $(MAKE) -C source/discovery win64
  302. # ---------------------------------------------------------------------------------------------------------------------
  303. # Binaries (wine)
  304. wine32:
  305. $(MAKE) -C source/jackbridge wine32
  306. cp -f $(MODULEDIR)/jackbridge-wine32.dll.so $(CURDIR)/bin/jackbridge-wine32.dll
  307. wine64:
  308. $(MAKE) -C source/jackbridge wine64
  309. cp -f $(MODULEDIR)/jackbridge-wine64.dll.so $(CURDIR)/bin/jackbridge-wine64.dll
  310. # ---------------------------------------------------------------------------------------------------------------------
  311. clean:
  312. $(MAKE) clean -C source/backend
  313. $(MAKE) clean -C source/bridges-plugin
  314. $(MAKE) clean -C source/bridges-ui
  315. $(MAKE) clean -C source/discovery
  316. $(MAKE) clean -C source/frontend
  317. $(MAKE) clean -C source/interposer
  318. $(MAKE) clean -C source/libjack
  319. $(MAKE) clean -C source/modules
  320. $(MAKE) clean -C source/native-plugins
  321. $(MAKE) clean -C source/plugin
  322. $(MAKE) clean -C source/tests
  323. $(MAKE) clean -C source/theme
  324. rm -f *~ source/*~
  325. distclean: clean
  326. rm -f bin/*.exe bin/*.dll bin/*.dylib bin/*.so
  327. rm -rf build build-lv2
  328. cpp:
  329. $(MAKE) CPPMODE=true
  330. debug:
  331. $(MAKE) DEBUG=true
  332. doxygen:
  333. $(MAKE) doxygen -C source/backend
  334. tests:
  335. $(MAKE) -C source/tests
  336. stoat:
  337. stoat --recursive ./build/ --suppression ./data/stoat-supression.txt --whitelist ./data/stoat-whitelist.txt --graph-view ./data/stoat-callgraph.png
  338. # stoat --recursive ./build/ \
  339. # --suppression ./data/stoat-supression.txt \
  340. # --whitelist ./data/stoat-whitelist.txt \
  341. # --graph-view ./data/stoat-callgraph.png
  342. # ---------------------------------------------------------------------------------------------------------------------
  343. install_main:
  344. # Create directories
  345. install -d $(DESTDIR)$(BINDIR)
  346. install -d $(DESTDIR)$(DATADIR)/carla/resources
  347. ifeq ($(LINUX),true)
  348. install -d $(DESTDIR)$(LIBDIR)/carla/jack
  349. else
  350. install -d $(DESTDIR)$(LIBDIR)/carla
  351. endif
  352. install -d $(DESTDIR)$(LIBDIR)/pkgconfig
  353. install -d $(DESTDIR)$(INCLUDEDIR)/carla/includes
  354. ifeq ($(LINUX),true)
  355. ifeq ($(HAVE_JACK),true)
  356. ifeq ($(JACKBRIDGE_DIRECT),true)
  357. install -d $(DESTDIR)$(JACK_LIBDIR)
  358. endif
  359. endif
  360. endif
  361. ifeq ($(HAVE_PYQT),true)
  362. # Create directories (gui)
  363. install -d $(DESTDIR)$(LIBDIR)/carla/styles
  364. install -d $(DESTDIR)$(DATADIR)/applications
  365. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
  366. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
  367. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
  368. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
  369. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
  370. install -d $(DESTDIR)$(DATADIR)/mime/packages
  371. install -d $(DESTDIR)$(DATADIR)/carla/resources/translations
  372. install -d $(DESTDIR)$(DATADIR)/carla/modgui
  373. install -d $(DESTDIR)$(DATADIR)/carla/patchcanvas
  374. install -d $(DESTDIR)$(DATADIR)/carla/widgets
  375. endif
  376. # -------------------------------------------------------------------------------------------------------------
  377. # Install script files (non-gui)
  378. install -m 755 \
  379. data/carla-single \
  380. $(DESTDIR)$(BINDIR)
  381. # Adjust PREFIX value in script files (non-gui)
  382. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  383. $(DESTDIR)$(BINDIR)/carla-single
  384. # Install backend libs
  385. install -m 644 \
  386. bin/libcarla_*.* \
  387. $(DESTDIR)$(LIBDIR)/carla
  388. # Install other binaries
  389. install -m 755 \
  390. bin/*bridge-* \
  391. bin/carla-discovery-* \
  392. $(DESTDIR)$(LIBDIR)/carla
  393. ifeq ($(LINUX),true)
  394. ifeq ($(HAVE_JACK),true)
  395. ifeq ($(JACKBRIDGE_DIRECT),true)
  396. # Install internal jack client
  397. ln -sf \
  398. $(LIBDIR)/carla/libcarla_standalone2.so \
  399. $(DESTDIR)$(JACK_LIBDIR)/carla.so
  400. endif
  401. endif
  402. ifneq ($(JACKBRIDGE_DIRECT),true)
  403. # Install custom libjack
  404. install -m 755 \
  405. bin/jack/libjack.so.0 \
  406. $(DESTDIR)$(LIBDIR)/carla/jack
  407. endif
  408. endif
  409. # Install pkg-config files
  410. install -m 644 \
  411. data/*.pc \
  412. $(DESTDIR)$(LIBDIR)/pkgconfig
  413. # Adjust PREFIX, LIBDIR and INCLUDEDIR in pkg-config files
  414. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  415. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
  416. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
  417. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
  418. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  419. sed $(SED_ARGS) 's?X-LIBDIR-X?$(LIBDIR)?' \
  420. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
  421. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
  422. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
  423. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  424. sed $(SED_ARGS) 's?X-INCLUDEDIR-X?$(INCLUDEDIR)?' \
  425. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
  426. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
  427. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
  428. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  429. # Install headers
  430. install -m 644 \
  431. source/backend/CarlaBackend.h \
  432. source/backend/CarlaHost.h \
  433. source/backend/CarlaUtils.h \
  434. source/backend/CarlaEngine.hpp \
  435. source/backend/CarlaPlugin.hpp \
  436. source/includes/CarlaNative.h \
  437. $(DESTDIR)$(INCLUDEDIR)/carla
  438. install -m 644 \
  439. source/includes/CarlaDefines.h \
  440. source/includes/CarlaMIDI.h \
  441. source/includes/CarlaNative.h \
  442. source/includes/CarlaNativePlugin.h \
  443. $(DESTDIR)$(INCLUDEDIR)/carla/includes
  444. # -------------------------------------------------------------------------------------------------------------
  445. ifeq ($(HAVE_PYQT),true)
  446. ifneq ($(CPPMODE),true)
  447. # Install script files (gui)
  448. install -m 755 \
  449. data/carla \
  450. data/carla-database \
  451. data/carla-jack-multi \
  452. data/carla-jack-single \
  453. data/carla-jack-patchbayplugin \
  454. data/carla-osc-gui \
  455. data/carla-patchbay \
  456. data/carla-rack \
  457. data/carla-settings \
  458. $(DESTDIR)$(BINDIR)
  459. # Adjust PREFIX value in script files (gui)
  460. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  461. $(DESTDIR)$(BINDIR)/carla \
  462. $(DESTDIR)$(BINDIR)/carla-database \
  463. $(DESTDIR)$(BINDIR)/carla-jack-multi \
  464. $(DESTDIR)$(BINDIR)/carla-jack-single \
  465. $(DESTDIR)$(BINDIR)/carla-jack-patchbayplugin \
  466. $(DESTDIR)$(BINDIR)/carla-osc-gui \
  467. $(DESTDIR)$(BINDIR)/carla-patchbay \
  468. $(DESTDIR)$(BINDIR)/carla-rack \
  469. $(DESTDIR)$(BINDIR)/carla-settings
  470. ifeq ($(HAVE_LIBLO),true)
  471. install -m 755 \
  472. data/carla-control \
  473. $(DESTDIR)$(BINDIR)
  474. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  475. $(DESTDIR)$(BINDIR)/carla-control
  476. endif
  477. # Install the real modgui bridge
  478. install -m 755 \
  479. data/carla-bridge-lv2-modgui \
  480. $(DESTDIR)$(LIBDIR)/carla
  481. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  482. $(DESTDIR)$(LIBDIR)/carla/carla-bridge-lv2-modgui
  483. # Install frontend
  484. install -m 644 \
  485. source/frontend/carla \
  486. source/frontend/carla-control \
  487. source/frontend/carla-jack-multi \
  488. source/frontend/carla-jack-single \
  489. source/frontend/carla-patchbay \
  490. source/frontend/carla-rack \
  491. source/frontend/*.py \
  492. $(DESTDIR)$(DATADIR)/carla/
  493. install -m 644 \
  494. source/frontend/modgui/*.py \
  495. $(DESTDIR)$(DATADIR)/carla/modgui/
  496. install -m 644 \
  497. source/frontend/patchcanvas/*.py \
  498. $(DESTDIR)$(DATADIR)/carla/patchcanvas/
  499. install -m 644 \
  500. source/frontend/widgets/*.py \
  501. $(DESTDIR)$(DATADIR)/carla/widgets/
  502. # Adjust LIBDIR and DATADIR value in python code
  503. sed $(SED_ARGS) 's?X_LIBDIR_X = None?X_LIBDIR_X = "$(LIBDIR)"?' \
  504. $(DESTDIR)$(DATADIR)/carla/carla_shared.py
  505. sed $(SED_ARGS) 's?X_DATADIR_X = None?X_DATADIR_X = "$(DATADIR)"?' \
  506. $(DESTDIR)$(DATADIR)/carla/carla_shared.py
  507. # Install resources (gui)
  508. install -m 755 \
  509. bin/resources/carla-plugin \
  510. bin/resources/carla-plugin-patchbay \
  511. bin/resources/*-ui \
  512. $(DESTDIR)$(DATADIR)/carla/resources
  513. endif # CPPMODE
  514. ifeq ($(HAVE_THEME),true)
  515. # Install theme
  516. install -m 644 \
  517. bin/styles/* \
  518. $(DESTDIR)$(LIBDIR)/carla/styles
  519. endif
  520. # Install desktop files
  521. install -m 644 data/desktop/carla.desktop $(DESTDIR)$(DATADIR)/applications
  522. install -m 644 data/desktop/carla-rack.desktop $(DESTDIR)$(DATADIR)/applications
  523. install -m 644 data/desktop/carla-patchbay.desktop $(DESTDIR)$(DATADIR)/applications
  524. install -m 644 data/desktop/carla-jack-single.desktop $(DESTDIR)$(DATADIR)/applications
  525. install -m 644 data/desktop/carla-jack-multi.desktop $(DESTDIR)$(DATADIR)/applications
  526. ifeq ($(HAVE_LIBLO),true)
  527. install -m 644 data/desktop/carla-control.desktop $(DESTDIR)$(DATADIR)/applications
  528. endif
  529. # Install mime package
  530. install -m 644 data/carla.xml $(DESTDIR)$(DATADIR)/mime/packages
  531. # Install icons, 16x16
  532. install -m 644 resources/16x16/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
  533. install -m 644 resources/16x16/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
  534. # Install icons, 48x48
  535. install -m 644 resources/48x48/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
  536. install -m 644 resources/48x48/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
  537. # Install icons, 128x128
  538. install -m 644 resources/128x128/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
  539. install -m 644 resources/128x128/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
  540. # Install icons, 256x256
  541. install -m 644 resources/256x256/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
  542. install -m 644 resources/256x256/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
  543. # Install icons, scalable
  544. install -m 644 resources/scalable/carla.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
  545. install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
  546. # Install resources (re-use python files)
  547. $(LINK) ../modgui $(DESTDIR)$(DATADIR)/carla/resources
  548. $(LINK) ../patchcanvas $(DESTDIR)$(DATADIR)/carla/resources
  549. $(LINK) ../widgets $(DESTDIR)$(DATADIR)/carla/resources
  550. $(LINK) ../carla_app.py $(DESTDIR)$(DATADIR)/carla/resources
  551. $(LINK) ../carla_backend.py $(DESTDIR)$(DATADIR)/carla/resources
  552. $(LINK) ../carla_backend_qt.py $(DESTDIR)$(DATADIR)/carla/resources
  553. $(LINK) ../carla_database.py $(DESTDIR)$(DATADIR)/carla/resources
  554. $(LINK) ../carla_host.py $(DESTDIR)$(DATADIR)/carla/resources
  555. $(LINK) ../carla_host_control.py $(DESTDIR)$(DATADIR)/carla/resources
  556. $(LINK) ../carla_settings.py $(DESTDIR)$(DATADIR)/carla/resources
  557. $(LINK) ../carla_skin.py $(DESTDIR)$(DATADIR)/carla/resources
  558. $(LINK) ../carla_shared.py $(DESTDIR)$(DATADIR)/carla/resources
  559. $(LINK) ../carla_utils.py $(DESTDIR)$(DATADIR)/carla/resources
  560. $(LINK) ../carla_widgets.py $(DESTDIR)$(DATADIR)/carla/resources
  561. $(LINK) ../externalui.py $(DESTDIR)$(DATADIR)/carla/resources
  562. $(LINK) ../resources_rc.py $(DESTDIR)$(DATADIR)/carla/resources
  563. $(LINK) ../ui_carla_about.py $(DESTDIR)$(DATADIR)/carla/resources
  564. $(LINK) ../ui_carla_about_juce.py $(DESTDIR)$(DATADIR)/carla/resources
  565. $(LINK) ../ui_carla_add_jack.py $(DESTDIR)$(DATADIR)/carla/resources
  566. $(LINK) ../ui_carla_database.py $(DESTDIR)$(DATADIR)/carla/resources
  567. $(LINK) ../ui_carla_edit.py $(DESTDIR)$(DATADIR)/carla/resources
  568. $(LINK) ../ui_carla_host.py $(DESTDIR)$(DATADIR)/carla/resources
  569. $(LINK) ../ui_carla_parameter.py $(DESTDIR)$(DATADIR)/carla/resources
  570. $(LINK) ../ui_carla_plugin_calf.py $(DESTDIR)$(DATADIR)/carla/resources
  571. $(LINK) ../ui_carla_plugin_classic.py $(DESTDIR)$(DATADIR)/carla/resources
  572. $(LINK) ../ui_carla_plugin_compact.py $(DESTDIR)$(DATADIR)/carla/resources
  573. $(LINK) ../ui_carla_plugin_default.py $(DESTDIR)$(DATADIR)/carla/resources
  574. $(LINK) ../ui_carla_plugin_presets.py $(DESTDIR)$(DATADIR)/carla/resources
  575. $(LINK) ../ui_carla_refresh.py $(DESTDIR)$(DATADIR)/carla/resources
  576. $(LINK) ../ui_carla_settings.py $(DESTDIR)$(DATADIR)/carla/resources
  577. $(LINK) ../ui_carla_settings_driver.py $(DESTDIR)$(DATADIR)/carla/resources
  578. $(LINK) ../ui_inputdialog_value.py $(DESTDIR)$(DATADIR)/carla/resources
  579. $(LINK) ../ui_midipattern.py $(DESTDIR)$(DATADIR)/carla/resources
  580. # Install translations
  581. $(foreach l,$(I18N_LANGUAGES),install -m 644 \
  582. source/frontend/translations/carla_$(l).qm \
  583. $(DESTDIR)$(DATADIR)/carla/resources/translations/;)
  584. endif # HAVE_PYQT
  585. # -------------------------------------------------------------------------------------------------------------
  586. ifeq ($(CAN_GENERATE_LV2_TTL),true)
  587. # Install lv2 plugin
  588. install -d $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
  589. install -m 644 \
  590. bin/carla.lv2/carla.* \
  591. bin/carla.lv2/*.ttl \
  592. $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
  593. # Link binaries for lv2 plugin
  594. @for i in `find $(DESTDIR)$(LIBDIR)/carla/ -maxdepth 1 -type f -exec basename {} ';'`; do \
  595. $(LINK) ../../carla/$$i $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/$$i; \
  596. done
  597. rm -f $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/libcarla_standalone2.*
  598. ifeq ($(LINUX),true)
  599. # Link jack app bridge
  600. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/jack
  601. $(LINK) ../../carla/jack $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/jack
  602. endif
  603. endif # CAN_GENERATE_LV2_TTL
  604. ifeq ($(HAVE_PYQT),true)
  605. # Link resources for lv2 plugin
  606. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/resources
  607. $(LINK) ../../../share/carla/resources $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/resources
  608. # Link styles for lv2 plugin
  609. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/styles
  610. $(LINK) ../../carla/styles $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/styles
  611. endif
  612. # -------------------------------------------------------------------------------------------------------------
  613. ifneq ($(HAIKU),true)
  614. ifeq ($(HAVE_PYQT),true)
  615. # Install vst plugin
  616. install -d $(DESTDIR)$(LIBDIR)/vst/carla.vst
  617. install -m 644 \
  618. bin/CarlaRack*.* \
  619. bin/CarlaPatchbay*.* \
  620. $(DESTDIR)$(LIBDIR)/vst/carla.vst
  621. # Link binaries for vst plugin
  622. @for i in `find $(DESTDIR)$(LIBDIR)/carla/ -maxdepth 1 -type f -exec basename {} ';'`; do \
  623. $(LINK) ../../carla/$$i $(DESTDIR)$(LIBDIR)/vst/carla.vst/$$i; \
  624. done
  625. rm -f $(DESTDIR)$(LIBDIR)/vst/carla.vst/libcarla_standalone2.*
  626. # Link jack app bridge
  627. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/jack
  628. $(LINK) ../../carla/jack $(DESTDIR)$(LIBDIR)/vst/carla.vst/jack
  629. # Link resources for vst plugin
  630. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/resources
  631. $(LINK) ../../../share/carla/resources $(DESTDIR)$(LIBDIR)/vst/carla.vst/resources
  632. # Link styles for vst plugin
  633. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/styles
  634. $(LINK) ../../carla/styles $(DESTDIR)$(LIBDIR)/vst/carla.vst/styles
  635. endif
  636. endif
  637. # -------------------------------------------------------------------------------------------------------------
  638. ifneq ($(HAVE_PYQT),true)
  639. # Remove gui files for non-gui build
  640. rm $(DESTDIR)$(LIBDIR)/carla/carla-bridge-lv2-modgui
  641. ifeq ($(CAN_GENERATE_LV2_TTL),true)
  642. rm $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/carla-bridge-lv2-modgui
  643. endif
  644. endif
  645. # ---------------------------------------------------------------------------------------------------------------------
  646. ifneq ($(EXTERNAL_PLUGINS),true)
  647. install_external_plugins:
  648. endif
  649. install: install_main install_external_plugins
  650. # ---------------------------------------------------------------------------------------------------------------------
  651. uninstall:
  652. rm -f $(DESTDIR)$(BINDIR)/carla*
  653. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc
  654. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc
  655. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc
  656. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  657. rm -f $(DESTDIR)$(DATADIR)/applications/carla.desktop
  658. rm -f $(DESTDIR)$(DATADIR)/applications/carla-control.desktop
  659. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/*/apps/carla.png
  660. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/*/apps/carla-control.png
  661. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/carla.svg
  662. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/carla-control.svg
  663. rm -f $(DESTDIR)$(DATADIR)/mime/packages/carla.xml
  664. rm -rf $(DESTDIR)$(LIBDIR)/carla
  665. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
  666. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla-native.lv2
  667. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst
  668. rm -rf $(DESTDIR)$(DATADIR)/carla
  669. rm -rf $(DESTDIR)$(INCLUDEDIR)/carla
  670. # ----------------------------------------------------------------------------------------------------------------------------
  671. ifeq ($(MACOS),true)
  672. ifneq ($(MACOS_OLD),true)
  673. HAVE_DIST = true
  674. endif
  675. endif
  676. ifeq ($(HAVE_DIST),true)
  677. include Makefile.dist.mk
  678. else
  679. dist:
  680. endif
  681. include Makefile.print.mk
  682. # ---------------------------------------------------------------------------------------------------------------------
  683. .FORCE:
  684. .PHONY: .FORCE
  685. # ---------------------------------------------------------------------------------------------------------------------