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.

189 lines
5.6KB

  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. USE_CLAP_BUNDLE = true
  64. USE_VST2_BUNDLE = true
  65. include ../../dpf/Makefile.plugins.mk
  66. ifeq ($(WASM),true)
  67. LINK_FLAGS += -sALLOW_MEMORY_GROWTH
  68. LINK_FLAGS += -sLZ4=1
  69. LINK_FLAGS += --preload-file=./jsfx
  70. LINK_FLAGS += --preload-file=./lv2
  71. LINK_FLAGS += --shell-file=./emscripten/shell.html
  72. # LINK_FLAGS += --use-preload-cache
  73. LINK_FLAGS += --use-preload-plugins
  74. else ifneq ($(HAIKU),true)
  75. BUILD_CXX_FLAGS += -pthread
  76. endif
  77. BUILD_CXX_FLAGS += -I../Common
  78. BUILD_CXX_FLAGS += -I../../dpf-widgets/generic
  79. BUILD_CXX_FLAGS += -I../../dpf-widgets/opengl
  80. BUILD_CXX_FLAGS += -DCARLA_BACKEND_NAMESPACE=$(CARLA_BACKEND_NAMESPACE)
  81. BUILD_CXX_FLAGS += -DSTATIC_PLUGIN_TARGET
  82. BUILD_CXX_FLAGS += -I../../carla/source/backend
  83. BUILD_CXX_FLAGS += -I../../carla/source/includes
  84. BUILD_CXX_FLAGS += -I../../carla/source/modules
  85. BUILD_CXX_FLAGS += -I../../carla/source/utils
  86. ifeq ($(MACOS),true)
  87. $(BUILD_DIR)/../Common/PluginHostWindow.cpp.o: BUILD_CXX_FLAGS += -ObjC++
  88. $(BUILD_DIR)/../Common/SizeUtils.cpp.o: BUILD_CXX_FLAGS += -ObjC++
  89. endif
  90. # ---------------------------------------------------------------------------------------------------------------------
  91. # Enable all possible plugin types
  92. ifeq ($(STANDALONE),true)
  93. TARGETS_BASE =
  94. TARGETS_EXTRA = jack
  95. ifeq ($(MACOS),true)
  96. TARGETS_EXTRA += carlabins
  97. endif
  98. else
  99. TARGETS_BASE = lv2 vst2 clap
  100. TARGETS_EXTRA = carlabins
  101. # VST3 does not do MIDI filter plugins, by design
  102. ifneq ($(NAME),Ildaeil-MIDI)
  103. TARGETS_BASE += vst3
  104. endif
  105. endif
  106. all: $(TARGETS_BASE) $(TARGETS_EXTRA)
  107. # ---------------------------------------------------------------------------------------------------------------------
  108. # special step for carla binaries
  109. ifneq ($(USE_SYSTEM_CARLA_BINS),true)
  110. CARLA_BINARIES = $(CURDIR)/../../carla/bin/carla-bridge-native$(APP_EXT)
  111. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-lv2-gtk2$(APP_EXT)
  112. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-lv2-gtk3$(APP_EXT)
  113. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-discovery-native$(APP_EXT)
  114. ifeq ($(CARLA_EXTRA_TARGETS),true)
  115. # 32bit bridge
  116. ifeq ($(WINDOWS)$(CPU_X86_64),truetrue)
  117. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-win32$(APP_EXT)
  118. else ifneq ($(MACOS)$(WINDOWS),true)
  119. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-posix32$(APP_EXT)
  120. endif
  121. # Windows bridges
  122. ifeq ($(CPU_I386_OR_X86_64)$(LINUX),truetrue)
  123. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-win32.exe
  124. CARLA_BINARIES += $(CURDIR)/../../carla/bin/jackbridge-wine32.dll
  125. endif
  126. ifeq ($(CPU_X86_64)$(LINUX),truetrue)
  127. CARLA_BINARIES += $(CURDIR)/../../carla/bin/carla-bridge-win64.exe
  128. CARLA_BINARIES += $(CURDIR)/../../carla/bin/jackbridge-wine64.dll
  129. endif
  130. endif # CARLA_EXTRA_TARGETS
  131. carlabins: $(TARGETS_BASE)
  132. ifeq ($(STANDALONE),true)
  133. mkdir -p $(shell dirname $(jack))
  134. install -m 755 $(CARLA_BINARIES) $(shell dirname $(jack))
  135. else
  136. install -m 755 $(CARLA_BINARIES) $(shell dirname $(lv2))
  137. install -m 755 $(CARLA_BINARIES) $(shell dirname $(vst2))
  138. install -m 755 $(CARLA_BINARIES) $(shell dirname $(clap))
  139. ifneq ($(NAME),Ildaeil-MIDI)
  140. install -m 755 $(CARLA_BINARIES) $(shell dirname $(vst3))
  141. endif
  142. endif
  143. else # USE_SYSTEM_CARLA_BINS
  144. carlabins:
  145. endif # USE_SYSTEM_CARLA_BINS
  146. # ---------------------------------------------------------------------------------------------------------------------