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.

864 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)/juce_audio_basics.a
  57. ifeq ($(USING_JUCE_AUDIO_DEVICES),true)
  58. 3RD_LIBS += $(MODULEDIR)/juce_audio_devices.a
  59. endif
  60. 3RD_LIBS += $(MODULEDIR)/juce_audio_processors.a
  61. 3RD_LIBS += $(MODULEDIR)/juce_core.a
  62. 3RD_LIBS += $(MODULEDIR)/juce_data_structures.a
  63. 3RD_LIBS += $(MODULEDIR)/juce_events.a
  64. 3RD_LIBS += $(MODULEDIR)/juce_graphics.a
  65. 3RD_LIBS += $(MODULEDIR)/juce_gui_basics.a
  66. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  67. 3RD_LIBS += $(MODULEDIR)/juce_gui_extra.a
  68. endif
  69. endif
  70. ifeq ($(USING_RTAUDIO),true)
  71. 3RD_LIBS += $(MODULEDIR)/rtaudio.a
  72. 3RD_LIBS += $(MODULEDIR)/rtmidi.a
  73. endif
  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)/juce_audio_basics.posix32.a
  203. LIBS_POSIX32 += $(MODULEDIR)/juce_audio_processors.posix32.a
  204. LIBS_POSIX32 += $(MODULEDIR)/juce_data_structures.posix32.a
  205. LIBS_POSIX32 += $(MODULEDIR)/juce_core.posix32.a
  206. LIBS_POSIX32 += $(MODULEDIR)/juce_events.posix32.a
  207. LIBS_POSIX32 += $(MODULEDIR)/juce_graphics.posix32.a
  208. LIBS_POSIX32 += $(MODULEDIR)/juce_gui_basics.posix32.a
  209. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  210. LIBS_POSIX32 += $(MODULEDIR)/juce_gui_extra.posix32.a
  211. endif
  212. endif
  213. posix32: $(LIBS_POSIX32)
  214. $(MAKE) -C source/bridges-plugin posix32
  215. $(MAKE) -C source/discovery posix32
  216. # ---------------------------------------------------------------------------------------------------------------------
  217. # Binaries (posix64)
  218. LIBS_POSIX64 = $(MODULEDIR)/jackbridge.posix64.a
  219. LIBS_POSIX64 += $(MODULEDIR)/lilv.posix64.a
  220. LIBS_POSIX64 += $(MODULEDIR)/rtmempool.posix64.a
  221. LIBS_POSIX64 += $(MODULEDIR)/water.posix64.a
  222. ifeq ($(USING_JUCE),true)
  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. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  231. LIBS_POSIX64 += $(MODULEDIR)/juce_gui_extra.posix64.a
  232. endif
  233. endif
  234. posix64: $(LIBS_POSIX64)
  235. $(MAKE) -C source/bridges-plugin posix64
  236. $(MAKE) -C source/discovery posix64
  237. # ---------------------------------------------------------------------------------------------------------------------
  238. # Binaries (win32)
  239. LIBS_WIN32 += $(MODULEDIR)/lilv.win32.a
  240. LIBS_WIN32 += $(MODULEDIR)/rtmempool.win32.a
  241. LIBS_WIN32 += $(MODULEDIR)/water.win32.a
  242. ifeq ($(USING_JUCE),true)
  243. LIBS_WIN32 += $(MODULEDIR)/juce_audio_basics.win32.a
  244. LIBS_WIN32 += $(MODULEDIR)/juce_audio_processors.win32.a
  245. LIBS_WIN32 += $(MODULEDIR)/juce_data_structures.win32.a
  246. LIBS_WIN32 += $(MODULEDIR)/juce_core.win32.a
  247. LIBS_WIN32 += $(MODULEDIR)/juce_events.win32.a
  248. LIBS_WIN32 += $(MODULEDIR)/juce_graphics.win32.a
  249. LIBS_WIN32 += $(MODULEDIR)/juce_gui_basics.win32.a
  250. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  251. LIBS_WIN32 += $(MODULEDIR)/juce_gui_extra.win32.a
  252. endif
  253. endif
  254. LIBS_WINE32 = $(LIBS_WIN32) $(MODULEDIR)/jackbridge.win32e.a
  255. LIBS_RWIN32 = $(LIBS_WIN32) $(MODULEDIR)/jackbridge.win32.a
  256. win32: $(LIBS_WINE32)
  257. $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win32
  258. $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win32
  259. win32r: $(LIBS_RWIN32)
  260. ifeq ($(CC),x86_64-w64-mingw32-gcc)
  261. $(MAKE) CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ -C source/bridges-plugin win32
  262. $(MAKE) CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ -C source/discovery win32
  263. else
  264. $(MAKE) -C source/bridges-plugin win32
  265. $(MAKE) -C source/discovery win32
  266. endif
  267. # ---------------------------------------------------------------------------------------------------------------------
  268. # Binaries (win64)
  269. LIBS_WIN64 += $(MODULEDIR)/lilv.win64.a
  270. LIBS_WIN64 += $(MODULEDIR)/rtmempool.win64.a
  271. LIBS_WIN64 += $(MODULEDIR)/water.win64.a
  272. ifeq ($(USING_JUCE),true)
  273. LIBS_WIN64 += $(MODULEDIR)/juce_audio_basics.win64.a
  274. LIBS_WIN64 += $(MODULEDIR)/juce_audio_processors.win64.a
  275. LIBS_WIN64 += $(MODULEDIR)/juce_data_structures.win64.a
  276. LIBS_WIN64 += $(MODULEDIR)/juce_core.win64.a
  277. LIBS_WIN64 += $(MODULEDIR)/juce_events.win64.a
  278. LIBS_WIN64 += $(MODULEDIR)/juce_graphics.win64.a
  279. LIBS_WIN64 += $(MODULEDIR)/juce_gui_basics.win64.a
  280. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  281. LIBS_WIN64 += $(MODULEDIR)/juce_gui_extra.win64.a
  282. endif
  283. endif
  284. LIBS_WINE64 = $(LIBS_WIN64) $(MODULEDIR)/jackbridge.win64e.a
  285. LIBS_RWIN64 = $(LIBS_WIN64) $(MODULEDIR)/jackbridge.win64.a
  286. win64: $(LIBS_WINE64)
  287. $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win64
  288. $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win64
  289. win64r: $(LIBS_RWIN64)
  290. ifeq ($(CC),i686-w64-mingw32-gcc)
  291. $(MAKE) CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ -C source/bridges-plugin win64
  292. $(MAKE) CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ -C source/discovery win64
  293. else
  294. $(MAKE) -C source/bridges-plugin win64
  295. $(MAKE) -C source/discovery win64
  296. endif
  297. # ---------------------------------------------------------------------------------------------------------------------
  298. # Binaries (wine)
  299. wine32:
  300. $(MAKE) -C source/jackbridge wine32
  301. cp -f $(MODULEDIR)/jackbridge-wine32.dll.so $(CURDIR)/bin/jackbridge-wine32.dll
  302. wine64:
  303. $(MAKE) -C source/jackbridge wine64
  304. cp -f $(MODULEDIR)/jackbridge-wine64.dll.so $(CURDIR)/bin/jackbridge-wine64.dll
  305. # ---------------------------------------------------------------------------------------------------------------------
  306. clean:
  307. $(MAKE) clean -C source/backend
  308. $(MAKE) clean -C source/bridges-plugin
  309. $(MAKE) clean -C source/bridges-ui
  310. $(MAKE) clean -C source/modules
  311. $(MAKE) clean -C source/native-plugins
  312. $(MAKE) clean -C source/plugin
  313. ifneq ($(STATIC_PLUGIN_TARGET),true)
  314. $(MAKE) clean -C source/discovery
  315. $(MAKE) clean -C source/frontend
  316. $(MAKE) clean -C source/interposer
  317. $(MAKE) clean -C source/libjack
  318. $(MAKE) clean -C source/tests
  319. $(MAKE) clean -C source/theme
  320. endif
  321. rm -f *~ source/*~
  322. distclean: clean
  323. rm -f bin/*.exe bin/*.dll bin/*.dylib bin/*.so
  324. rm -rf build build-lv2
  325. cpp:
  326. $(MAKE) CPPMODE=true
  327. debug:
  328. $(MAKE) DEBUG=true
  329. doxygen:
  330. $(MAKE) doxygen -C source/backend
  331. tests:
  332. $(MAKE) -C source/tests
  333. stoat:
  334. stoat --recursive ./build/ --suppression ./data/stoat-supression.txt --whitelist ./data/stoat-whitelist.txt --graph-view ./data/stoat-callgraph.png
  335. # stoat --recursive ./build/ \
  336. # --suppression ./data/stoat-supression.txt \
  337. # --whitelist ./data/stoat-whitelist.txt \
  338. # --graph-view ./data/stoat-callgraph.png
  339. # ---------------------------------------------------------------------------------------------------------------------
  340. install_main:
  341. # Create directories
  342. install -d $(DESTDIR)$(BINDIR)
  343. install -d $(DESTDIR)$(DATADIR)/carla/resources
  344. ifeq ($(LINUX),true)
  345. install -d $(DESTDIR)$(LIBDIR)/carla/jack
  346. else
  347. install -d $(DESTDIR)$(LIBDIR)/carla
  348. endif
  349. install -d $(DESTDIR)$(LIBDIR)/pkgconfig
  350. install -d $(DESTDIR)$(INCLUDEDIR)/carla/includes
  351. ifeq ($(LINUX),true)
  352. ifeq ($(HAVE_JACK),true)
  353. ifeq ($(JACKBRIDGE_DIRECT),true)
  354. install -d $(DESTDIR)$(JACK_LIBDIR)
  355. endif
  356. endif
  357. endif
  358. ifeq ($(HAVE_PYQT),true)
  359. # Create directories (gui)
  360. install -d $(DESTDIR)$(LIBDIR)/carla/styles
  361. install -d $(DESTDIR)$(PREFIX)/share/appdata
  362. install -d $(DESTDIR)$(DATADIR)/applications
  363. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
  364. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/32x32/apps
  365. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
  366. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
  367. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
  368. install -d $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
  369. install -d $(DESTDIR)$(DATADIR)/mime/packages
  370. install -d $(DESTDIR)$(DATADIR)/carla/resources/translations
  371. install -d $(DESTDIR)$(DATADIR)/carla/modgui
  372. install -d $(DESTDIR)$(DATADIR)/carla/patchcanvas
  373. install -d $(DESTDIR)$(DATADIR)/carla/widgets
  374. endif
  375. # -------------------------------------------------------------------------------------------------------------
  376. # Install script files (non-gui)
  377. install -m 755 \
  378. data/carla-single \
  379. $(DESTDIR)$(BINDIR)
  380. # Adjust PREFIX value in script files (non-gui)
  381. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  382. $(DESTDIR)$(BINDIR)/carla-single
  383. # Install backend libs
  384. install -m 644 \
  385. bin/libcarla_*.* \
  386. $(DESTDIR)$(LIBDIR)/carla
  387. # Install other binaries
  388. install -m 755 \
  389. bin/*bridge-* \
  390. bin/carla-discovery-* \
  391. $(DESTDIR)$(LIBDIR)/carla
  392. ifeq ($(LINUX),true)
  393. ifeq ($(HAVE_JACK),true)
  394. ifeq ($(JACKBRIDGE_DIRECT),true)
  395. # Install internal jack client
  396. ln -sf \
  397. $(LIBDIR)/carla/libcarla_standalone2.so \
  398. $(DESTDIR)$(JACK_LIBDIR)/carla.so
  399. endif
  400. endif
  401. ifneq ($(JACKBRIDGE_DIRECT),true)
  402. # Install custom libjack
  403. install -m 755 \
  404. bin/jack/libjack.so.0 \
  405. $(DESTDIR)$(LIBDIR)/carla/jack
  406. endif
  407. endif
  408. # Install pkg-config files
  409. install -m 644 \
  410. data/pkgconfig/*.pc \
  411. $(DESTDIR)$(LIBDIR)/pkgconfig
  412. # Adjust PREFIX, LIBDIR, INCLUDEDIR and VERSION in pkg-config files
  413. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  414. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
  415. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
  416. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
  417. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  418. sed $(SED_ARGS) 's?X-LIBDIR-X?$(LIBDIR)?' \
  419. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
  420. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
  421. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
  422. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  423. sed $(SED_ARGS) 's?X-INCLUDEDIR-X?$(INCLUDEDIR)?' \
  424. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
  425. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
  426. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
  427. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  428. sed $(SED_ARGS) 's?X-VERSION-X?$(VERSION)?' \
  429. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
  430. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
  431. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
  432. $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  433. # Install headers
  434. install -m 644 \
  435. source/backend/CarlaBackend.h \
  436. source/backend/CarlaHost.h \
  437. source/backend/CarlaUtils.h \
  438. source/backend/CarlaEngine.hpp \
  439. source/backend/CarlaPlugin.hpp \
  440. source/backend/CarlaPluginPtr.hpp \
  441. source/includes/CarlaNative.h \
  442. source/includes/CarlaNativePlugin.h \
  443. $(DESTDIR)$(INCLUDEDIR)/carla
  444. install -m 644 \
  445. source/includes/CarlaDefines.h \
  446. source/includes/CarlaMIDI.h \
  447. source/includes/CarlaNative.h \
  448. source/includes/CarlaNativePlugin.h \
  449. $(DESTDIR)$(INCLUDEDIR)/carla/includes
  450. # -------------------------------------------------------------------------------------------------------------
  451. ifeq ($(HAVE_PYQT),true)
  452. ifneq ($(CPPMODE),true)
  453. # Install script files (gui)
  454. install -m 755 \
  455. data/carla \
  456. data/carla-database \
  457. data/carla-jack-multi \
  458. data/carla-jack-single \
  459. data/carla-jack-patchbayplugin \
  460. data/carla-osc-gui \
  461. data/carla-patchbay \
  462. data/carla-rack \
  463. data/carla-settings \
  464. $(DESTDIR)$(BINDIR)
  465. # Adjust PREFIX value in script files (gui)
  466. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  467. $(DESTDIR)$(BINDIR)/carla \
  468. $(DESTDIR)$(BINDIR)/carla-database \
  469. $(DESTDIR)$(BINDIR)/carla-jack-multi \
  470. $(DESTDIR)$(BINDIR)/carla-jack-single \
  471. $(DESTDIR)$(BINDIR)/carla-jack-patchbayplugin \
  472. $(DESTDIR)$(BINDIR)/carla-osc-gui \
  473. $(DESTDIR)$(BINDIR)/carla-patchbay \
  474. $(DESTDIR)$(BINDIR)/carla-rack \
  475. $(DESTDIR)$(BINDIR)/carla-settings
  476. ifeq ($(HAVE_LIBLO),true)
  477. install -m 755 \
  478. data/carla-control \
  479. $(DESTDIR)$(BINDIR)
  480. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  481. $(DESTDIR)$(BINDIR)/carla-control
  482. endif
  483. # Install the real modgui bridge
  484. install -m 755 \
  485. data/carla-bridge-lv2-modgui \
  486. $(DESTDIR)$(LIBDIR)/carla
  487. sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
  488. $(DESTDIR)$(LIBDIR)/carla/carla-bridge-lv2-modgui
  489. # Install frontend
  490. install -m 644 \
  491. source/frontend/carla \
  492. source/frontend/carla-control \
  493. source/frontend/carla-jack-multi \
  494. source/frontend/carla-jack-single \
  495. source/frontend/carla-patchbay \
  496. source/frontend/carla-rack \
  497. source/frontend/*.py \
  498. $(DESTDIR)$(DATADIR)/carla/
  499. install -m 644 \
  500. source/frontend/modgui/*.py \
  501. $(DESTDIR)$(DATADIR)/carla/modgui/
  502. install -m 644 \
  503. source/frontend/patchcanvas/*.py \
  504. $(DESTDIR)$(DATADIR)/carla/patchcanvas/
  505. install -m 644 \
  506. source/frontend/widgets/*.py \
  507. $(DESTDIR)$(DATADIR)/carla/widgets/
  508. # Adjust LIBDIR and DATADIR value in python code
  509. sed $(SED_ARGS) 's?X_LIBDIR_X = None?X_LIBDIR_X = "$(LIBDIR)"?' \
  510. $(DESTDIR)$(DATADIR)/carla/carla_shared.py
  511. sed $(SED_ARGS) 's?X_DATADIR_X = None?X_DATADIR_X = "$(DATADIR)"?' \
  512. $(DESTDIR)$(DATADIR)/carla/carla_shared.py
  513. # Install resources (gui)
  514. install -m 755 \
  515. bin/resources/carla-plugin \
  516. bin/resources/carla-plugin-patchbay \
  517. bin/resources/*-ui \
  518. $(DESTDIR)$(DATADIR)/carla/resources
  519. endif # CPPMODE
  520. ifeq ($(HAVE_THEME),true)
  521. # Install theme
  522. install -m 644 \
  523. bin/styles/* \
  524. $(DESTDIR)$(LIBDIR)/carla/styles
  525. endif
  526. # Install desktop files
  527. install -m 644 data/desktop/carla.desktop $(DESTDIR)$(DATADIR)/applications
  528. install -m 644 data/desktop/carla-rack.desktop $(DESTDIR)$(DATADIR)/applications
  529. install -m 644 data/desktop/carla-patchbay.desktop $(DESTDIR)$(DATADIR)/applications
  530. install -m 644 data/desktop/carla-jack-single.desktop $(DESTDIR)$(DATADIR)/applications
  531. install -m 644 data/desktop/carla-jack-multi.desktop $(DESTDIR)$(DATADIR)/applications
  532. ifeq ($(HAVE_LIBLO),true)
  533. install -m 644 data/desktop/carla-control.desktop $(DESTDIR)$(DATADIR)/applications
  534. endif
  535. # Install app data
  536. sed -e 's?X-VERSION-X?$(VERSION)?' \
  537. data/appdata.xml.in > $(DESTDIR)$(PREFIX)/share/appdata/studio.kx.carla.appdata.xml
  538. # Install mime package
  539. install -m 644 data/carla.xml $(DESTDIR)$(DATADIR)/mime/packages
  540. # Install icons, 16x16
  541. install -m 644 resources/16x16/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
  542. install -m 644 resources/16x16/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
  543. # Install icons, 32x32
  544. install -m 644 resources/32x32/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/32x32/apps
  545. install -m 644 resources/32x32/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/32x32/apps
  546. # Install icons, 48x48
  547. install -m 644 resources/48x48/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
  548. install -m 644 resources/48x48/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
  549. # Install icons, 128x128
  550. install -m 644 resources/128x128/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
  551. install -m 644 resources/128x128/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
  552. # Install icons, 256x256
  553. install -m 644 resources/256x256/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
  554. install -m 644 resources/256x256/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
  555. # Install icons, scalable
  556. install -m 644 resources/scalable/carla.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
  557. install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
  558. # Install resources (re-use python files)
  559. $(LINK) ../modgui $(DESTDIR)$(DATADIR)/carla/resources
  560. $(LINK) ../patchcanvas $(DESTDIR)$(DATADIR)/carla/resources
  561. $(LINK) ../widgets $(DESTDIR)$(DATADIR)/carla/resources
  562. $(LINK) ../carla_app.py $(DESTDIR)$(DATADIR)/carla/resources
  563. $(LINK) ../carla_backend.py $(DESTDIR)$(DATADIR)/carla/resources
  564. $(LINK) ../carla_backend_qt.py $(DESTDIR)$(DATADIR)/carla/resources
  565. $(LINK) ../carla_database.py $(DESTDIR)$(DATADIR)/carla/resources
  566. $(LINK) ../carla_host.py $(DESTDIR)$(DATADIR)/carla/resources
  567. $(LINK) ../carla_host_control.py $(DESTDIR)$(DATADIR)/carla/resources
  568. $(LINK) ../carla_settings.py $(DESTDIR)$(DATADIR)/carla/resources
  569. $(LINK) ../carla_skin.py $(DESTDIR)$(DATADIR)/carla/resources
  570. $(LINK) ../carla_shared.py $(DESTDIR)$(DATADIR)/carla/resources
  571. $(LINK) ../carla_utils.py $(DESTDIR)$(DATADIR)/carla/resources
  572. $(LINK) ../carla_widgets.py $(DESTDIR)$(DATADIR)/carla/resources
  573. $(LINK) ../externalui.py $(DESTDIR)$(DATADIR)/carla/resources
  574. $(LINK) ../resources_rc.py $(DESTDIR)$(DATADIR)/carla/resources
  575. $(LINK) ../ui_carla_about.py $(DESTDIR)$(DATADIR)/carla/resources
  576. $(LINK) ../ui_carla_about_juce.py $(DESTDIR)$(DATADIR)/carla/resources
  577. $(LINK) ../ui_carla_add_jack.py $(DESTDIR)$(DATADIR)/carla/resources
  578. $(LINK) ../ui_carla_database.py $(DESTDIR)$(DATADIR)/carla/resources
  579. $(LINK) ../ui_carla_edit.py $(DESTDIR)$(DATADIR)/carla/resources
  580. $(LINK) ../ui_carla_host.py $(DESTDIR)$(DATADIR)/carla/resources
  581. $(LINK) ../ui_carla_parameter.py $(DESTDIR)$(DATADIR)/carla/resources
  582. $(LINK) ../ui_carla_plugin_calf.py $(DESTDIR)$(DATADIR)/carla/resources
  583. $(LINK) ../ui_carla_plugin_classic.py $(DESTDIR)$(DATADIR)/carla/resources
  584. $(LINK) ../ui_carla_plugin_compact.py $(DESTDIR)$(DATADIR)/carla/resources
  585. $(LINK) ../ui_carla_plugin_default.py $(DESTDIR)$(DATADIR)/carla/resources
  586. $(LINK) ../ui_carla_plugin_presets.py $(DESTDIR)$(DATADIR)/carla/resources
  587. $(LINK) ../ui_carla_refresh.py $(DESTDIR)$(DATADIR)/carla/resources
  588. $(LINK) ../ui_carla_settings.py $(DESTDIR)$(DATADIR)/carla/resources
  589. $(LINK) ../ui_carla_settings_driver.py $(DESTDIR)$(DATADIR)/carla/resources
  590. $(LINK) ../ui_inputdialog_value.py $(DESTDIR)$(DATADIR)/carla/resources
  591. $(LINK) ../ui_midipattern.py $(DESTDIR)$(DATADIR)/carla/resources
  592. $(LINK) ../ui_xycontroller.py $(DESTDIR)$(DATADIR)/carla/resources
  593. # Install translations
  594. $(foreach l,$(I18N_LANGUAGES),install -m 644 \
  595. source/frontend/translations/carla_$(l).qm \
  596. $(DESTDIR)$(DATADIR)/carla/resources/translations/;)
  597. endif # HAVE_PYQT
  598. # -------------------------------------------------------------------------------------------------------------
  599. ifeq ($(CAN_GENERATE_LV2_TTL),true)
  600. # Install lv2 plugin
  601. install -d $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
  602. install -m 644 \
  603. bin/carla.lv2/carla.* \
  604. bin/carla.lv2/*.ttl \
  605. $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
  606. # Link binaries for lv2 plugin
  607. @for i in `find $(DESTDIR)$(LIBDIR)/carla/ -maxdepth 1 -type f -exec basename {} ';'`; do \
  608. $(LINK) ../../carla/$$i $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/$$i; \
  609. done
  610. rm -f $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/libcarla_standalone2.*
  611. ifeq ($(LINUX),true)
  612. # Link jack app bridge
  613. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/jack
  614. $(LINK) ../../carla/jack $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/jack
  615. endif
  616. endif # CAN_GENERATE_LV2_TTL
  617. ifeq ($(HAVE_PYQT),true)
  618. # Link resources for lv2 plugin
  619. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/resources
  620. $(LINK) ../../../share/carla/resources $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/resources
  621. # Link styles for lv2 plugin
  622. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/styles
  623. $(LINK) ../../carla/styles $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/styles
  624. endif
  625. # -------------------------------------------------------------------------------------------------------------
  626. ifneq ($(HAIKU),true)
  627. ifeq ($(HAVE_PYQT),true)
  628. # Install vst plugin
  629. install -d $(DESTDIR)$(LIBDIR)/vst/carla.vst
  630. install -m 644 \
  631. bin/CarlaRack*.* \
  632. bin/CarlaPatchbay*.* \
  633. $(DESTDIR)$(LIBDIR)/vst/carla.vst
  634. # Link binaries for vst plugin
  635. @for i in `find $(DESTDIR)$(LIBDIR)/carla/ -maxdepth 1 -type f -exec basename {} ';'`; do \
  636. $(LINK) ../../carla/$$i $(DESTDIR)$(LIBDIR)/vst/carla.vst/$$i; \
  637. done
  638. rm -f $(DESTDIR)$(LIBDIR)/vst/carla.vst/libcarla_standalone2.*
  639. # Link jack app bridge
  640. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/jack
  641. $(LINK) ../../carla/jack $(DESTDIR)$(LIBDIR)/vst/carla.vst/jack
  642. # Link resources for vst plugin
  643. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/resources
  644. $(LINK) ../../../share/carla/resources $(DESTDIR)$(LIBDIR)/vst/carla.vst/resources
  645. # Link styles for vst plugin
  646. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/styles
  647. $(LINK) ../../carla/styles $(DESTDIR)$(LIBDIR)/vst/carla.vst/styles
  648. endif
  649. endif
  650. # -------------------------------------------------------------------------------------------------------------
  651. ifneq ($(HAVE_PYQT),true)
  652. # Remove gui files for non-gui build
  653. rm $(DESTDIR)$(LIBDIR)/carla/carla-bridge-lv2-modgui
  654. ifeq ($(CAN_GENERATE_LV2_TTL),true)
  655. rm $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/carla-bridge-lv2-modgui
  656. endif
  657. endif
  658. # ---------------------------------------------------------------------------------------------------------------------
  659. ifneq ($(EXTERNAL_PLUGINS),true)
  660. install_external_plugins:
  661. endif
  662. install: install_main install_external_plugins
  663. # ---------------------------------------------------------------------------------------------------------------------
  664. uninstall:
  665. rm -f $(DESTDIR)$(BINDIR)/carla*
  666. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc
  667. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc
  668. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc
  669. rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
  670. rm -f $(DESTDIR)$(DATADIR)/applications/carla.desktop
  671. rm -f $(DESTDIR)$(DATADIR)/applications/carla-control.desktop
  672. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/*/apps/carla.png
  673. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/*/apps/carla-control.png
  674. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/carla.svg
  675. rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/carla-control.svg
  676. rm -f $(DESTDIR)$(DATADIR)/mime/packages/carla.xml
  677. rm -rf $(DESTDIR)$(LIBDIR)/carla
  678. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
  679. rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla-native.lv2
  680. rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst
  681. rm -rf $(DESTDIR)$(DATADIR)/carla
  682. rm -rf $(DESTDIR)$(INCLUDEDIR)/carla
  683. # ----------------------------------------------------------------------------------------------------------------------------
  684. ifeq ($(MACOS),true)
  685. ifneq ($(MACOS_OLD),true)
  686. HAVE_DIST = true
  687. endif
  688. endif
  689. ifeq ($(WIN32),true)
  690. HAVE_DIST = true
  691. endif
  692. ifeq ($(HAVE_DIST),true)
  693. include Makefile.dist.mk
  694. else
  695. dist:
  696. endif
  697. include Makefile.print.mk
  698. # ---------------------------------------------------------------------------------------------------------------------
  699. .FORCE:
  700. .PHONY: .FORCE
  701. # ---------------------------------------------------------------------------------------------------------------------