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.

203 lines
6.3KB

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