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.

194 lines
6.4KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-frontend #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. include $(CWD)/Makefile.mk
  8. # ---------------------------------------------------------------------------------------------------------------------
  9. BINDIR := $(CWD)/../bin
  10. RESDIR := $(CWD)/../resources
  11. # ---------------------------------------------------------------------------------------------------------------------
  12. ifeq ($(WINDOWS),true)
  13. QT5_LINK_FLAGS = $(shell echo $(LINK_FLAGS) | awk 'sub(" -static","")') -static-libgcc
  14. else
  15. QT5_LINK_FLAGS = $(LINK_FLAGS)
  16. endif
  17. ifeq ($(HAVE_QT5),true)
  18. QT5_PREFIX = $(shell pkg-config --variable=prefix Qt5Core)
  19. BUILD_CXX_FLAGS += $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)
  20. QT5_LINK_FLAGS += -Wl,-rpath,$(QT5_PREFIX)/lib $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets)
  21. else ifeq ($(HAVE_QT5PKG),true)
  22. QT5_PREFIX = $(shell pkg-config --variable=prefix Qt5OpenGLExtensions)
  23. BUILD_CXX_FLAGS += -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I $(QT5_PREFIX)/include/qt5
  24. QT5_LINK_FLAGS += -Wl,-rpath,$(QT5_PREFIX)/lib -F $(QT5_PREFIX)/lib -framework QtCore -framework QtGui -framework QtWidgets
  25. endif
  26. # ---------------------------------------------------------------------------------------------------------------------
  27. # Translations
  28. TSs = $(patsubst %,translations/carla_%.ts,$(I18N_LANGUAGES))
  29. QMs = $(patsubst %,translations/carla_%.qm,$(I18N_LANGUAGES))
  30. # ---------------------------------------------------------------------------------------------------------------------
  31. # Resources
  32. RES = \
  33. resources_rc.py \
  34. $(BINDIR)/resources/modgui \
  35. $(BINDIR)/resources/patchcanvas \
  36. $(BINDIR)/resources/widgets \
  37. $(BINDIR)/resources/bigmeter-ui \
  38. $(BINDIR)/resources/carla-plugin \
  39. $(BINDIR)/resources/carla-plugin-patchbay \
  40. $(BINDIR)/resources/carla_app.py \
  41. $(BINDIR)/resources/carla_backend.py \
  42. $(BINDIR)/resources/carla_backend_qt.py \
  43. $(BINDIR)/resources/carla_host.py \
  44. $(BINDIR)/resources/carla_host_control.py \
  45. $(BINDIR)/resources/carla_modgui.py \
  46. $(BINDIR)/resources/carla_settings.py \
  47. $(BINDIR)/resources/carla_skin.py \
  48. $(BINDIR)/resources/carla_shared.py \
  49. $(BINDIR)/resources/carla_utils.py \
  50. $(BINDIR)/resources/carla_widgets.py \
  51. $(BINDIR)/resources/externalui.py \
  52. $(BINDIR)/resources/midipattern-ui \
  53. $(BINDIR)/resources/notes-ui \
  54. $(BINDIR)/resources/xycontroller-ui \
  55. $(BINDIR)/resources/resources_rc.py \
  56. $(BINDIR)/resources/ui_carla_about.py \
  57. $(BINDIR)/resources/ui_carla_about_juce.py \
  58. $(BINDIR)/resources/ui_carla_edit.py \
  59. $(BINDIR)/resources/ui_carla_host.py \
  60. $(BINDIR)/resources/ui_carla_osc_connect.py \
  61. $(BINDIR)/resources/ui_carla_parameter.py \
  62. $(BINDIR)/resources/ui_carla_plugin_calf.py \
  63. $(BINDIR)/resources/ui_carla_plugin_classic.py \
  64. $(BINDIR)/resources/ui_carla_plugin_compact.py \
  65. $(BINDIR)/resources/ui_carla_plugin_default.py \
  66. $(BINDIR)/resources/ui_carla_plugin_presets.py \
  67. $(BINDIR)/resources/ui_carla_settings.py \
  68. $(BINDIR)/resources/ui_carla_settings_driver.py \
  69. $(BINDIR)/resources/ui_inputdialog_value.py \
  70. $(BINDIR)/resources/ui_midipattern.py \
  71. $(BINDIR)/resources/ui_xycontroller.py
  72. ifneq ($(SKIP_ZYN_SYNTH),true)
  73. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  74. RES += \
  75. $(BINDIR)/resources/zynaddsubfx \
  76. $(BINDIR)/resources/zynaddsubfx-ui
  77. endif
  78. endif
  79. # ---------------------------------------------------------------------------------------------------------------------
  80. # UI code
  81. UI_FILES = $(wildcard pluginlist/*.ui)
  82. UIs = $(UI_FILES:%.ui=%_ui.hpp)
  83. UIs += $(UI_FILES:%.ui=%_ui.py)
  84. # old stuff, not yet converted
  85. UIs += \
  86. ui_carla_about.py \
  87. ui_carla_about_juce.py \
  88. ui_carla_edit.py \
  89. ui_carla_host.py \
  90. ui_carla_osc_connect.py \
  91. ui_carla_parameter.py \
  92. ui_carla_plugin_calf.py \
  93. ui_carla_plugin_classic.py \
  94. ui_carla_plugin_compact.py \
  95. ui_carla_plugin_default.py \
  96. ui_carla_plugin_presets.py \
  97. ui_carla_settings.py \
  98. ui_carla_settings_driver.py \
  99. ui_inputdialog_value.py \
  100. ui_midipattern.py \
  101. ui_xycontroller.py
  102. # ---------------------------------------------------------------------------------------------------------------------
  103. all: $(QMs) $(RES) $(UIs)
  104. # ---------------------------------------------------------------------------------------------------------------------
  105. %_ui.hpp: %.ui
  106. $(UIC_QT5) $< -o $@
  107. %_ui.py: %.ui
  108. $(PYUIC) $< -o $@
  109. ui_%.py: $(RESDIR)/ui/%.ui
  110. $(PYUIC) $< -o $@
  111. resources_rc.py: $(RESDIR)/resources.qrc $(RESDIR)/*/*.png $(RESDIR)/*/*.svg $(RESDIR)/*/*.svgz
  112. $(PYRCC) $< -o $@
  113. $(BINDIR)/resources/%: %
  114. -@mkdir -p $(BINDIR)/resources
  115. $(LINK) $(CURDIR)/$* $(BINDIR)/resources/
  116. $(BINDIR)/resources/zynaddsubfx: ../native-plugins/resources/zynaddsubfx
  117. -@mkdir -p $(BINDIR)/resources
  118. $(LINK) $(CURDIR)/$< $(BINDIR)/resources/
  119. $(BINDIR)/resources/zynaddsubfx-ui: ../native-plugins/resources/zynaddsubfx-ui
  120. -@mkdir -p $(BINDIR)/resources
  121. $(LINK) $(CURDIR)/$< $(BINDIR)/resources/
  122. # ---------------------------------------------------------------------------------------------------------------------
  123. clean:
  124. rm -rf $(UIs) $(RES) $(QMs) __pycache__ *.pyc
  125. # old files
  126. rm -f ui_carla_add_jack.py
  127. rm -f ui_carla_database.py
  128. rm -f ui_carla_refresh.py
  129. debug:
  130. $(MAKE) DEBUG=true
  131. # ---------------------------------------------------------------------------------------------------------------------
  132. tests: $(UI_FILES:%.ui=%$(APP_EXT))
  133. pluginlist/jackappdialog$(APP_EXT): pluginlist/jackappdialog.cpp pluginlist/jackappdialog.ui pluginlist/jackappdialog_ui.hpp
  134. $(CXX) $< $(BUILD_CXX_FLAGS) $(QT5_LINK_FLAGS) -o $@
  135. pluginlist/pluginlistdialog$(APP_EXT): pluginlist/pluginlistdialog.cpp pluginlist/pluginlistdialog.ui pluginlist/pluginlistdialog_ui.hpp
  136. $(CXX) $< $(BUILD_CXX_FLAGS) $(QT5_LINK_FLAGS) -o $@
  137. # ---------------------------------------------------------------------------------------------------------------------
  138. lint:
  139. pylint \
  140. --extension-pkg-whitelist=PyQt5 \
  141. --max-line-length=120 \
  142. --max-locals=25 \
  143. --max-statements=100 \
  144. --disable=bare-except,duplicate-code,invalid-name,missing-docstring,too-many-branches,too-many-instance-attributes,too-many-statements \
  145. $(wildcard widgets/*.py)
  146. # ---------------------------------------------------------------------------------------------------------------------
  147. i18n_update: $(TSs)
  148. i18n_release: $(QMs)
  149. translations/%.ts:
  150. @install -d translations
  151. pylupdate5 *.py $(RESDIR)/ui/*.ui -ts $@
  152. %.qm: %.ts
  153. lrelease $< -qm $@
  154. # ---------------------------------------------------------------------------------------------------------------------