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.

210 lines
6.2KB

  1. #!/usr/bin/make -f
  2. # Makefile for DISTRHO Plugins #
  3. # ---------------------------- #
  4. # Created by falkTX
  5. #
  6. # NOTE This file MUST be imported after setting `NAME`
  7. ifneq ($(CARLA_BACKEND_NAMESPACE),Ildaeil)
  8. $(error wrong build setup)
  9. endif
  10. ifneq ($(DGL_NAMESPACE),IldaeilDGL)
  11. $(error wrong build setup)
  12. endif
  13. ifneq ($(STATIC_PLUGIN_TARGET),true)
  14. $(error wrong build setup)
  15. endif
  16. ifneq ($(USING_CUSTOM_DPF),true)
  17. $(error wrong build setup)
  18. endif
  19. # ---------------------------------------------------------------------------------------------------------------------
  20. # Files to build
  21. FILES_DSP = \
  22. IldaeilPlugin.cpp
  23. FILES_UI = \
  24. IldaeilUI.cpp \
  25. ../Common/PluginHostWindow.cpp \
  26. ../../dpf-widgets/opengl/DearImGui.cpp
  27. ifeq ($(STANDALONE)$(WINDOWS),truetrue)
  28. FILES_UI += distrho.rc
  29. endif
  30. # ---------------------------------------------------------------------------------------------------------------------
  31. # Carla stuff
  32. ifneq ($(DEBUG),true)
  33. EXTERNAL_PLUGINS = true
  34. endif
  35. include ../../carla/source/Makefile.deps.mk
  36. # FIXME
  37. ifeq ($(WASM),true)
  38. ifneq ($(OLD_PATH),)
  39. STATIC_CARLA_PLUGIN_LIBS = -lsndfile -lopus -lFLAC -lvorbisenc -lvorbis -logg -lm
  40. endif
  41. endif
  42. CARLA_BUILD_DIR = ../../carla/build
  43. ifeq ($(DEBUG),true)
  44. CARLA_BUILD_TYPE = Debug
  45. else
  46. CARLA_BUILD_TYPE = Release
  47. endif
  48. CARLA_EXTRA_LIBS = $(CARLA_BUILD_DIR)/plugin/$(CARLA_BUILD_TYPE)/carla-host-plugin.cpp.o
  49. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/carla_engine_plugin.a
  50. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/carla_plugin.a
  51. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/native-plugins.a
  52. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/audio_decoder.a
  53. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/jackbridge.min.a
  54. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/lilv.a
  55. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/rtmempool.a
  56. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/water.a
  57. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/ysfx.a
  58. CARLA_EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/zita-resampler.a
  59. EXTRA_DEPENDENCIES = $(CARLA_EXTRA_LIBS)
  60. EXTRA_LIBS = $(CARLA_EXTRA_LIBS) $(STATIC_CARLA_PLUGIN_LIBS)
  61. # ---------------------------------------------------------------------------------------------------------------------
  62. # Do some more magic
  63. ifeq ($(WASM),true)
  64. EXTRA_DEPENDENCIES = ./jsfx
  65. UI_TYPE = gles2
  66. endif
  67. USE_CLAP_BUNDLE = true
  68. USE_VST2_BUNDLE = true
  69. include ../../dpf/Makefile.plugins.mk
  70. ifeq ($(WASM),true)
  71. LINK_FLAGS += -sALLOW_MEMORY_GROWTH
  72. LINK_FLAGS += -sLZ4=1
  73. LINK_FLAGS += --preload-file=./jsfx
  74. LINK_FLAGS += --preload-file=./lv2
  75. LINK_FLAGS += --shell-file=./emscripten/shell.html
  76. # LINK_FLAGS += --use-preload-cache
  77. LINK_FLAGS += --use-preload-plugins
  78. else ifneq ($(HAIKU),true)
  79. BUILD_CXX_FLAGS += -pthread
  80. endif
  81. BUILD_CXX_FLAGS += -I../Common
  82. BUILD_CXX_FLAGS += -I../../dpf-widgets/generic
  83. BUILD_CXX_FLAGS += -I../../dpf-widgets/opengl
  84. BUILD_CXX_FLAGS += -DCARLA_BACKEND_NAMESPACE=$(CARLA_BACKEND_NAMESPACE)
  85. BUILD_CXX_FLAGS += -DIMGUI_DISABLE_DEBUG_TOOLS
  86. BUILD_CXX_FLAGS += -DIMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
  87. BUILD_CXX_FLAGS += -DIMGUI_DISABLE_DEMO_WINDOWS
  88. BUILD_CXX_FLAGS += -DSTATIC_PLUGIN_TARGET
  89. BUILD_CXX_FLAGS += -I../../carla/source/backend
  90. BUILD_CXX_FLAGS += -I../../carla/source/includes
  91. BUILD_CXX_FLAGS += -I../../carla/source/modules
  92. BUILD_CXX_FLAGS += -I../../carla/source/utils
  93. ifeq ($(MACOS),true)
  94. $(BUILD_DIR)/../Common/PluginHostWindow.cpp.o: BUILD_CXX_FLAGS += -ObjC++
  95. $(BUILD_DIR)/../Common/SizeUtils.cpp.o: BUILD_CXX_FLAGS += -ObjC++
  96. endif
  97. # ---------------------------------------------------------------------------------------------------------------------
  98. # Enable all possible plugin types
  99. ifeq ($(STANDALONE),true)
  100. TARGETS_BASE =
  101. TARGETS_EXTRA = jack
  102. ifeq ($(MACOS),true)
  103. TARGETS_EXTRA += carlabins
  104. endif
  105. else
  106. TARGETS_BASE = lv2 vst2 clap
  107. TARGETS_EXTRA = carlabins
  108. # Skip MIDI filter for AUv2 and VST3, which deal with pure MIDI plugins in a weird way
  109. ifneq ($(NAME),Ildaeil-MIDI)
  110. TARGETS_BASE += vst3 au
  111. endif
  112. endif
  113. all: $(TARGETS_BASE) $(TARGETS_EXTRA)
  114. # ---------------------------------------------------------------------------------------------------------------------
  115. # special step for carla binaries
  116. ifneq ($(USE_SYSTEM_CARLA_BINS),true)
  117. CARLA_BINARIES = $(CURDIR)/../../carla/bin/carla-bridge-native$(APP_EXT)
  118. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-lv2-gtk2$(APP_EXT)
  119. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-lv2-gtk3$(APP_EXT)
  120. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-discovery-native$(APP_EXT)
  121. ifeq ($(CARLA_EXTRA_TARGETS),true)
  122. # 32bit bridge
  123. ifeq ($(WINDOWS)$(CPU_X86_64),truetrue)
  124. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-win32$(APP_EXT)
  125. else ifneq ($(MACOS)$(WINDOWS),true)
  126. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-posix32$(APP_EXT)
  127. endif
  128. # Windows bridges
  129. ifeq ($(CPU_I386_OR_X86_64)$(LINUX),truetrue)
  130. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-win32.exe
  131. CARLA_BINARIES += $(CURDIR)/../../carla/bin/jackbridge-wine32.dll
  132. endif
  133. ifeq ($(CPU_X86_64)$(LINUX),truetrue)
  134. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-win64.exe
  135. CARLA_BINARIES += $(CURDIR)/../../carla/bin/jackbridge-wine64.dll
  136. endif
  137. endif # CARLA_EXTRA_TARGETS
  138. carlabins: $(TARGETS_BASE)
  139. ifeq ($(STANDALONE),true)
  140. mkdir -p $(shell dirname $(jack))
  141. install -m 755 $(CARLA_BINARIES) $(shell dirname $(jack))
  142. else
  143. install -m 755 $(CARLA_BINARIES) $(shell dirname $(lv2))
  144. install -m 755 $(CARLA_BINARIES) $(shell dirname $(vst2))
  145. install -m 755 $(CARLA_BINARIES) $(shell dirname $(clap))
  146. ifneq ($(NAME),Ildaeil-MIDI)
  147. ifeq ($(MACOS),true)
  148. install -m 755 $(CARLA_BINARIES) $(shell dirname $(au))
  149. endif
  150. install -m 755 $(CARLA_BINARIES) $(shell dirname $(vst3))
  151. endif
  152. endif
  153. else # USE_SYSTEM_CARLA_BINS
  154. carlabins:
  155. endif # USE_SYSTEM_CARLA_BINS
  156. # ---------------------------------------------------------------------------------------------------------------------
  157. # special step for wasm resources
  158. ifeq ($(WASM),true)
  159. ./jsfx:
  160. wget -O - https://falktx.com/data/wasm-things-2025-09-13.tar.gz | tar xz -C $(CURDIR)
  161. endif
  162. # ---------------------------------------------------------------------------------------------------------------------