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.

139 lines
3.8KB

  1. #!/usr/bin/make -f
  2. # Makefile for DISTRHO Plugins #
  3. # ---------------------------- #
  4. # Created by falkTX
  5. #
  6. # --------------------------------------------------------------
  7. # Build config
  8. PREFIX ?= /usr/local
  9. DESTDIR ?=
  10. SYSDEPS ?= false
  11. # --------------------------------------------------------------
  12. # Import base definitions
  13. USE_NANOVG_FBO = true
  14. include ../dpf/Makefile.base.mk
  15. # --------------------------------------------------------------
  16. # Build setup
  17. BUILD_DIR = ../build/lv2export
  18. ifeq ($(MACOS),true)
  19. BASE_FLAGS += -DARCH_MAC
  20. else ifeq ($(WINDOWS),true)
  21. BASE_FLAGS += -DARCH_WIN
  22. else
  23. BASE_FLAGS += -DARCH_LIN
  24. endif
  25. ifeq ($(DEBUG),true)
  26. BASE_FLAGS += -UDEBUG
  27. endif
  28. BASE_FLAGS += -DHEADLESS
  29. BASE_FLAGS += -fno-finite-math-only
  30. BASE_FLAGS += -pthread
  31. # might be needed later
  32. # BASE_FLAGS += -I../include/neon-compat
  33. # ifeq ($(SYSDEPS),true)
  34. # BASE_FLAGS += -DCARDINAL_SYSDEPS
  35. # BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp)
  36. # else
  37. # BASE_FLAGS += -DZSTDLIB_VISIBILITY=
  38. # BASE_FLAGS += -I../src/Rack/dep/include
  39. # endif
  40. # BASE_FLAGS += -I../src/Rack/dep/filesystem/include
  41. # BASE_FLAGS += -I../src/Rack/dep/fuzzysearchdatabase/src
  42. # BASE_FLAGS += -I../src/Rack/dep/glfw/include
  43. # BASE_FLAGS += -I../src/Rack/dep/nanosvg/src
  44. # # BASE_FLAGS += -IRack/dep/osdialog
  45. # BASE_FLAGS += -I../src/Rack/dep/oui-blendish
  46. # BASE_FLAGS += -I../src/Rack/dep/pffft
  47. ifeq ($(WINDOWS),true)
  48. BASE_FLAGS += -D_USE_MATH_DEFINES
  49. BASE_FLAGS += -DWIN32_LEAN_AND_MEAN
  50. BASE_FLAGS += -I../include/mingw-compat
  51. BASE_FLAGS += -I../include/mingw-std-threads
  52. endif
  53. # --------------------------------------------------------------
  54. # lots of warnings from VCV side
  55. BASE_FLAGS += -Wno-unused-parameter
  56. BASE_FLAGS += -Wno-unused-variable
  57. # --------------------------------------------------------------
  58. # also from plugins
  59. BASE_FLAGS += -Wno-deprecated-declarations
  60. BASE_FLAGS += -Wno-implicit-fallthrough
  61. ifeq ($(MACOS),true)
  62. BASE_FLAGS += -Wno-unknown-warning-option
  63. endif
  64. # --------------------------------------------------------------
  65. # stuff to include
  66. BUILD_CXX_FLAGS += -I.
  67. BUILD_CXX_FLAGS += -Iincludes
  68. BUILD_CXX_FLAGS += -I../dpf/distrho
  69. BUILD_CXX_FLAGS += -I../plugins
  70. # --------------------------------------------------------------
  71. # Build targets
  72. PLUGINS = $(subst plugins/,,$(subst .cpp,,$(wildcard plugins/*.cpp)))
  73. BINARIES = $(PLUGINS:%=../bin/cardinal-%.lv2/plugin$(LIB_EXT))
  74. RESOURCES = $(PLUGINS:%=../bin/cardinal-%.lv2/manifest.ttl)
  75. RESOURCES += $(PLUGINS:%=../bin/cardinal-%.lv2/plugin.ttl)
  76. all: $(BINARIES) $(RESOURCES)
  77. clean:
  78. rm -f $(TARGETS) $(BUILD_OBJS)
  79. # --------------------------------------------------------------
  80. # Build commands
  81. ../bin/cardinal-%.lv2/manifest.ttl: manifest.ttl.in
  82. -@mkdir -p $(shell dirname $@)
  83. sed -e "s/@LIB_EXT@/$(LIB_EXT)/" -e "s/@SLUG@/$*/" $< > $@
  84. ../bin/cardinal-%.lv2/plugin.ttl: ../bin/cardinal-%.lv2/plugin$(LIB_EXT)
  85. ../dpf/utils/lv2_ttl_generator$(APP_EXT) $^ | tail -n +2 > $@
  86. ../bin/cardinal-%.lv2/plugin$(LIB_EXT): $(BUILD_DIR)/%.cpp.o
  87. -@mkdir -p $(shell dirname $@)
  88. $(SILENT)$(CXX) $< $(LINK_FLAGS) $(SHARED) -o $@
  89. # --------------------------------------------------------------
  90. $(BUILD_DIR)/aubileinstruments-%.cpp.o: plugins/aubileinstruments-%.cpp
  91. -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
  92. @echo "Compiling $<"
  93. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DSLUG='"aubileinstruments-$*"' \
  94. -DTEST \
  95. -I../plugins/AudibleInstruments/eurorack \
  96. -Wno-class-memaccess \
  97. -Wno-unused-local-typedefs \
  98. -c -o $@
  99. $(BUILD_DIR)/%.cpp.o: plugins/%.cpp
  100. -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
  101. @echo "Compiling $<"
  102. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DSLUG='"$*"' -c -o $@
  103. # --------------------------------------------------------------
  104. -include $(PLUGINS:%=$(BUILD_DIR)/%.cpp.d)
  105. # --------------------------------------------------------------