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.

850 lines
27KB

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