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.

207 lines
6.8KB

  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_inputdialog_value.py
  60. UI: $(UIs)
  61. source/ui_%.py: resources/ui/%.ui
  62. $(PYUIC) $< -o $@
  63. # -------------------------------------------------------------------------------------------------------------------------------------
  64. # Widgets
  65. WIDGETS = \
  66. source/canvaspreviewframe.py \
  67. source/digitalpeakmeter.py \
  68. source/ledbutton.py \
  69. source/paramspinbox.py \
  70. source/pixmapbutton.py \
  71. source/pixmapdial.py \
  72. source/pixmapkeyboard.py
  73. WIDGETS: $(WIDGETS)
  74. source/%.py: source/widgets/%.py
  75. $(LINK) widgets/$*.py $@
  76. # -------------------------------------------------------------------------------------------------------------------------------------
  77. clean:
  78. $(MAKE) clean -C source/backend
  79. $(MAKE) clean -C source/bridges
  80. $(MAKE) clean -C source/discovery
  81. $(MAKE) clean -C source/libs
  82. rm -f $(RES)
  83. rm -f $(UIs)
  84. rm -f $(WIDGETS)
  85. rm -f *~ source/*~ source/*.pyc source/*_rc.py source/ui_*.py
  86. # -------------------------------------------------------------------------------------------------------------------------------------
  87. config:
  88. $(MAKE) config -C source/backend
  89. # -------------------------------------------------------------------------------------------------------------------------------------
  90. debug:
  91. $(MAKE) DEBUG=true
  92. # -------------------------------------------------------------------------------------------------------------------------------------
  93. install:
  94. # Create directories
  95. install -d $(DESTDIR)$(PREFIX)/bin/
  96. install -d $(DESTDIR)$(PREFIX)/lib/carla/
  97. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/
  98. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/nekofilter/
  99. install -d $(DESTDIR)$(PREFIX)/lib/carla/resources/zynaddsubfx/
  100. install -d $(DESTDIR)$(PREFIX)/share/applications/
  101. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  102. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  103. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  104. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  105. install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  106. install -d $(DESTDIR)$(PREFIX)/share/carla/
  107. # Install script files
  108. install -m 755 \
  109. data/carla \
  110. data/carla-control \
  111. data/carla-single \
  112. $(DESTDIR)$(PREFIX)/bin/
  113. # Install desktop files
  114. install -m 644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications/
  115. # Install icons, 16x16
  116. install -m 644 resources/16x16/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  117. install -m 644 resources/16x16/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
  118. # Install icons, 48x48
  119. install -m 644 resources/48x48/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  120. install -m 644 resources/48x48/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
  121. # Install icons, 128x128
  122. install -m 644 resources/128x128/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  123. install -m 644 resources/128x128/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
  124. # Install icons, 256x256
  125. install -m 644 resources/256x256/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  126. install -m 644 resources/256x256/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
  127. # Install icons, scalable
  128. install -m 644 resources/scalable/carla.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  129. install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
  130. # Install binaries
  131. install -m 755 \
  132. source/backend/*.so \
  133. source/bridges/carla-bridge-* \
  134. source/discovery/carla-discovery-* \
  135. $(DESTDIR)$(PREFIX)/lib/carla/
  136. # Install python code
  137. install -m 755 source/*.py $(DESTDIR)$(PREFIX)/share/carla/
  138. # Install resources
  139. install -m 644 source/backend/resources/nekofilter-ui $(DESTDIR)$(PREFIX)/lib/carla/resources/
  140. install -m 644 source/backend/resources/nekofilter/*.png $(DESTDIR)$(PREFIX)/lib/carla/resources/nekofilter/
  141. install -m 644 source/backend/resources/zynaddsubfx/*.png $(DESTDIR)$(PREFIX)/lib/carla/resources/zynaddsubfx/
  142. # Adjust PREFIX value in script files
  143. sed -i "s/X-PREFIX-X/$(SED_PREFIX)/" \
  144. $(DESTDIR)$(PREFIX)/bin/carla \
  145. $(DESTDIR)$(PREFIX)/bin/carla-single
  146. # $(DESTDIR)$(PREFIX)/bin/carla-control \
  147. # -------------------------------------------------------------------------------------------------------------------------------------
  148. uninstall:
  149. rm -f $(DESTDIR)$(PREFIX)/bin/carla*
  150. rm -f $(DESTDIR)$(PREFIX)/share/applications/carla.desktop
  151. rm -f $(DESTDIR)$(PREFIX)/share/applications/carla-control.desktop
  152. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla.png
  153. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla-control.png
  154. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla.svg
  155. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla-control.svg
  156. rm -rf $(DESTDIR)$(PREFIX)/lib/carla/
  157. rm -rf $(DESTDIR)$(PREFIX)/share/carla/