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.

213 lines
7.1KB

  1. #!/usr/bin/make -f
  2. # Makefile for Carla #
  3. # ------------------ #
  4. # Created by falkTX
  5. #
  6. PREFIX = /usr/local
  7. DESTDIR =
  8. SED_PREFIX = $(shell echo $(PREFIX) | sed "s/\//\\\\\\\\\//g")
  9. LINK = ln -sf
  10. PYUIC ?= pyuic4
  11. PYRCC ?= pyrcc4 -py3
  12. # -------------------------------------------------------------------------------------------------------------------------------------
  13. all: CPP RES UI WIDGETS
  14. # -------------------------------------------------------------------------------------------------------------------------------------
  15. # C++ code
  16. CPP: backend bridges discovery
  17. backend:
  18. $(MAKE) -C source/backend
  19. bridges:
  20. $(MAKE) -C source/bridges
  21. discovery:
  22. $(MAKE) -C source/discovery
  23. posix32:
  24. $(MAKE) -C source/bridges posix32
  25. $(MAKE) -C source/discovery posix32
  26. posix64:
  27. $(MAKE) -C source/bridges posix64
  28. $(MAKE) -C source/discovery posix64
  29. win32:
  30. $(MAKE) -C source/bridges win32
  31. $(MAKE) -C source/discovery win32
  32. win64:
  33. $(MAKE) -C source/bridges win64
  34. $(MAKE) -C source/discovery win64
  35. wine32:
  36. $(MAKE) -C source/libs jackbridge-win32.dll.so
  37. $(LINK) ../libs/jackbridge-win32.dll.so source/bridges/jackbridge-win32.dll
  38. wine64:
  39. $(MAKE) -C source/libs jackbridge-win64.dll.so
  40. $(LINK) ../libs/jackbridge-win64.dll.so source/bridges/jackbridge-win64.dll
  41. # -------------------------------------------------------------------------------------------------------------------------------------
  42. # Resources
  43. RES = source/resources_rc.py
  44. RES: $(RES)
  45. source/%_rc.py: resources/%.qrc
  46. $(PYRCC) $< -o $@
  47. # -------------------------------------------------------------------------------------------------------------------------------------
  48. # UI code
  49. UIs = \
  50. source/ui_carla.py \
  51. source/ui_carla_control.py \
  52. source/ui_carla_about.py \
  53. source/ui_carla_database.py \
  54. source/ui_carla_edit.py \
  55. source/ui_carla_parameter.py \
  56. source/ui_carla_plugin.py \
  57. source/ui_carla_refresh.py \
  58. source/ui_carla_settings.py \
  59. source/ui_carla_settings_driver.py \
  60. source/ui_inputdialog_value.py
  61. UI: $(UIs)
  62. source/ui_%.py: resources/ui/%.ui
  63. $(PYUIC) $< -o $@
  64. # -------------------------------------------------------------------------------------------------------------------------------------
  65. # Widgets
  66. WIDGETS = \
  67. source/canvaspreviewframe.py \
  68. source/digitalpeakmeter.py \
  69. source/ledbutton.py \
  70. source/paramspinbox.py \
  71. source/pixmapbutton.py \
  72. source/pixmapdial.py \
  73. source/pixmapkeyboard.py
  74. WIDGETS: $(WIDGETS)
  75. source/%.py: source/widgets/%.py
  76. $(LINK) widgets/$*.py $@
  77. # -------------------------------------------------------------------------------------------------------------------------------------
  78. clean:
  79. $(MAKE) clean -C source/backend
  80. $(MAKE) clean -C source/bridges
  81. $(MAKE) clean -C source/discovery
  82. $(MAKE) clean -C source/libs
  83. rm -f $(RES)
  84. rm -f $(UIs)
  85. rm -f $(WIDGETS)
  86. rm -f *~ source/*~ source/*.pyc source/*_rc.py source/ui_*.py
  87. # -------------------------------------------------------------------------------------------------------------------------------------
  88. config:
  89. $(MAKE) config -C source/backend
  90. # -------------------------------------------------------------------------------------------------------------------------------------
  91. debug:
  92. $(MAKE) DEBUG=true
  93. # -------------------------------------------------------------------------------------------------------------------------------------
  94. install:
  95. # Create directories
  96. install -d $(DESTDIR)$(PREFIX)/bin/
  97. install -d $(DESTDIR)$(PREFIX)/lib/carla/
  98. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/
  99. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/nekofilter/
  100. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/zynaddsubfx/
  101. install -d $(DESTDIR)$(PREFIX)/lib/lv2/carla.lv2/
  102. install -d $(DESTDIR)$(PREFIX)/share/applications/
  103. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  104. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  105. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  106. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  107. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  108. install -d $(DESTDIR)$(PREFIX)/share/carla/
  109. # Install script files
  110. install -m 755 \
  111. data/carla \
  112. data/carla-control \
  113. data/carla-single \
  114. $(DESTDIR)$(PREFIX)/bin/
  115. # Install desktop files
  116. install -m 644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications/
  117. # Install icons, 16x16
  118. install -m 644 resources/16x16/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  119. install -m 644 resources/16x16/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  120. # Install icons, 48x48
  121. install -m 644 resources/48x48/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  122. install -m 644 resources/48x48/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  123. # Install icons, 128x128
  124. install -m 644 resources/128x128/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  125. install -m 644 resources/128x128/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  126. # Install icons, 256x256
  127. install -m 644 resources/256x256/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  128. install -m 644 resources/256x256/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  129. # Install icons, scalable
  130. install -m 644 resources/scalable/carla.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  131. install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  132. # Install binaries
  133. install -m 755 \
  134. source/backend/*.so \
  135. source/bridges/carla-bridge-* \
  136. source/discovery/carla-discovery-* \
  137. $(DESTDIR)$(PREFIX)/lib/carla/
  138. # Install python code
  139. install -m 755 source/*.py $(DESTDIR)$(PREFIX)/share/carla/
  140. # Install LV2 plugin
  141. install -m 644 data/lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/carla.lv2/
  142. $(LINK) $(PREFIX)/lib/carla/libcarla_standalone.so $(DESTDIR)$(PREFIX)/lib/lv2/carla.lv2/carla.so
  143. # Install resources
  144. install -m 644 source/backend/resources/nekofilter-ui $(DESTDIR)$(PREFIX)/lib/carla/resources/
  145. install -m 644 source/backend/resources/nekofilter/*.png $(DESTDIR)$(PREFIX)/lib/carla/resources/nekofilter/
  146. install -m 644 source/backend/resources/zynaddsubfx/*.png $(DESTDIR)$(PREFIX)/lib/carla/resources/zynaddsubfx/
  147. # Adjust PREFIX value in script files
  148. sed -i "s/X-PREFIX-X/$(SED_PREFIX)/" \
  149. $(DESTDIR)$(PREFIX)/bin/carla \
  150. $(DESTDIR)$(PREFIX)/bin/carla-control \
  151. $(DESTDIR)$(PREFIX)/bin/carla-single
  152. # -------------------------------------------------------------------------------------------------------------------------------------
  153. uninstall:
  154. rm -f $(DESTDIR)$(PREFIX)/bin/carla*
  155. rm -f $(DESTDIR)$(PREFIX)/share/applications/carla.desktop
  156. rm -f $(DESTDIR)$(PREFIX)/share/applications/carla-control.desktop
  157. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla.png
  158. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla-control.png
  159. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla.svg
  160. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla-control.svg
  161. rm -rf $(DESTDIR)$(PREFIX)/lib/carla/
  162. rm -rf $(DESTDIR)$(PREFIX)/share/carla/