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.

146 lines
3.5KB

  1. #!/usr/bin/make -f
  2. # Makefile for DISTRHO Plugins #
  3. # ---------------------------- #
  4. # Created by falkTX
  5. #
  6. include dpf/Makefile.base.mk
  7. all: cardinal carla deps dgl plugins gen resources
  8. # --------------------------------------------------------------
  9. # Build config
  10. PREFIX ?= /usr/local
  11. DESTDIR ?=
  12. SYSDEPS ?= false
  13. # --------------------------------------------------------------
  14. # Carla config
  15. CARLA_EXTRA_ARGS = \
  16. HAVE_FFMPEG=false \
  17. HAVE_FLUIDSYNTH=false \
  18. HAVE_LIBMAGIC=false \
  19. HAVE_SNDFILE=false \
  20. USING_JUCE=false \
  21. USING_JUCE_GUI_EXTRA=false
  22. # --------------------------------------------------------------
  23. # Check for system-wide dependencies
  24. ifeq ($(SYSDEPS),true)
  25. ifneq ($(shell pkg-config --exists jansson && echo true),true)
  26. $(error jansson dependency not installed/available)
  27. endif
  28. ifneq ($(shell pkg-config --exists libarchive && echo true),true)
  29. $(error libarchive dependency not installed/available)
  30. endif
  31. ifneq ($(shell pkg-config --exists samplerate && echo true),true)
  32. $(error samplerate dependency not installed/available)
  33. endif
  34. ifneq ($(shell pkg-config --exists speexdsp && echo true),true)
  35. $(error speexdsp dependency not installed/available)
  36. endif
  37. endif
  38. # --------------------------------------------------------------
  39. # Check for X11+OpenGL dependencies (unless headless build)
  40. ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
  41. ifneq ($(WASM),true)
  42. ifneq ($(HEADLESS),true)
  43. ifneq ($(HAVE_OPENGL),true)
  44. $(error X11 dependency not installed/available)
  45. endif
  46. ifneq ($(HAVE_X11),true)
  47. $(error X11 dependency not installed/available)
  48. endif
  49. ifneq ($(HAVE_XEXT),true)
  50. $(warning Xext dependency not installed/available)
  51. endif
  52. ifneq ($(HAVE_XRANDR),true)
  53. $(warning Xrandr dependency not installed/available)
  54. endif
  55. else
  56. CARLA_EXTRA_ARGS += HAVE_OPENGL=false
  57. CARLA_EXTRA_ARGS += HAVE_X11=false
  58. CARLA_EXTRA_ARGS += HAVE_XEXT=false
  59. CARLA_EXTRA_ARGS += HAVE_XRANDR=false
  60. endif
  61. endif
  62. endif
  63. # --------------------------------------------------------------
  64. cardinal: carla deps dgl plugins
  65. $(MAKE) all -C src $(CARLA_EXTRA_ARGS)
  66. carla:
  67. $(MAKE) static-plugin -C carla $(CARLA_EXTRA_ARGS) \
  68. CAN_GENERATE_LV2_TTL=false \
  69. STATIC_PLUGIN_TARGET=true
  70. deps:
  71. ifneq ($(SYSDEPS),true)
  72. $(MAKE) all -C deps
  73. endif
  74. dgl:
  75. ifneq ($(HEADLESS),true)
  76. $(MAKE) -C dpf/dgl opengl USE_NANOVG_FBO=true
  77. endif
  78. plugins: deps
  79. $(MAKE) all -C plugins
  80. resources: cardinal
  81. $(MAKE) resources -C plugins
  82. ifneq ($(CROSS_COMPILING),true)
  83. gen: cardinal resources dpf/utils/lv2_ttl_generator
  84. @$(CURDIR)/dpf/utils/generate-ttl.sh
  85. dpf/utils/lv2_ttl_generator:
  86. $(MAKE) -C dpf/utils/lv2-ttl-generator
  87. else
  88. gen:
  89. endif
  90. # --------------------------------------------------------------
  91. clean:
  92. $(MAKE) distclean -C carla
  93. $(MAKE) clean -C deps
  94. $(MAKE) clean -C dpf/dgl
  95. $(MAKE) clean -C dpf/utils/lv2-ttl-generator
  96. $(MAKE) clean -C plugins
  97. $(MAKE) clean -C src
  98. rm -rf bin build
  99. # --------------------------------------------------------------
  100. install:
  101. install -d $(DESTDIR)$(PREFIX)/bin
  102. install -d $(DESTDIR)$(PREFIX)/lib/lv2
  103. install -d $(DESTDIR)$(PREFIX)/lib/vst
  104. install -d $(DESTDIR)$(PREFIX)/lib/vst3
  105. install -d $(DESTDIR)$(PREFIX)/share/Cardinal
  106. cp -rL bin/Cardinal.lv2 $(DESTDIR)$(PREFIX)/lib/lv2/
  107. cp -rL bin/Cardinal.vst $(DESTDIR)$(PREFIX)/lib/vst/
  108. cp -rL bin/Cardinal.vst3 $(DESTDIR)$(PREFIX)/lib/vst3/
  109. install -m 755 bin/Cardinal$(APP_EXT) $(DESTDIR)$(PREFIX)/bin/
  110. cp -rL bin/Cardinal.lv2/resources/* $(DESTDIR)$(PREFIX)/share/Cardinal/
  111. # --------------------------------------------------------------
  112. .PHONY: carla deps plugins