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.

892 lines
29KB

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