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.

919 lines
30KB

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