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.

861 lines
28KB

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