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.

Makefile 27KB

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