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.

182 lines
4.6KB

  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_PROJECTM=false \
  19. HAVE_ZYN_DEPS=false \
  20. HAVE_ZYN_UI_DEPS=false
  21. ifneq ($(DEBUG),true)
  22. CARLA_EXTRA_ARGS += EXTERNAL_PLUGINS=true
  23. endif
  24. # ifneq ($(MACOS),true)
  25. CARLA_EXTRA_ARGS += USING_JUCE=false
  26. CARLA_EXTRA_ARGS += USING_JUCE_GUI_EXTRA=false
  27. # endif
  28. # --------------------------------------------------------------
  29. # Check for system-wide dependencies
  30. ifeq ($(SYSDEPS),true)
  31. ifneq ($(shell pkg-config --exists jansson && echo true),true)
  32. $(error jansson dependency not installed/available)
  33. endif
  34. ifneq ($(shell pkg-config --exists libarchive && echo true),true)
  35. $(error libarchive dependency not installed/available)
  36. endif
  37. ifneq ($(shell pkg-config --exists samplerate && echo true),true)
  38. $(error samplerate dependency not installed/available)
  39. endif
  40. ifneq ($(shell pkg-config --exists speexdsp && echo true),true)
  41. $(error speexdsp dependency not installed/available)
  42. endif
  43. endif
  44. # --------------------------------------------------------------
  45. # Check for X11+OpenGL dependencies (unless headless build)
  46. ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
  47. ifneq ($(WASM),true)
  48. ifneq ($(HEADLESS),true)
  49. ifneq ($(HAVE_OPENGL),true)
  50. $(error OpenGL dependency not installed/available)
  51. endif
  52. ifneq ($(HAVE_X11),true)
  53. $(error X11 dependency not installed/available)
  54. endif
  55. ifneq ($(HAVE_XEXT),true)
  56. $(warning Xext dependency not installed/available)
  57. endif
  58. ifneq ($(HAVE_XRANDR),true)
  59. $(warning Xrandr dependency not installed/available)
  60. endif
  61. else
  62. CARLA_EXTRA_ARGS += HAVE_OPENGL=false
  63. CARLA_EXTRA_ARGS += HAVE_X11=false
  64. CARLA_EXTRA_ARGS += HAVE_XEXT=false
  65. CARLA_EXTRA_ARGS += HAVE_XRANDR=false
  66. endif
  67. endif
  68. endif
  69. # --------------------------------------------------------------
  70. cardinal: carla deps dgl plugins
  71. $(MAKE) all -C src $(CARLA_EXTRA_ARGS)
  72. carla:
  73. $(MAKE) static-plugin -C carla $(CARLA_EXTRA_ARGS) \
  74. CAN_GENERATE_LV2_TTL=false \
  75. STATIC_PLUGIN_TARGET=true
  76. deps:
  77. ifeq ($(SYSDEPS),true)
  78. $(MAKE) quickjs -C deps
  79. else
  80. $(MAKE) all -C deps
  81. endif
  82. dgl:
  83. ifneq ($(HEADLESS),true)
  84. $(MAKE) -C dpf/dgl opengl NVG_DISABLE_SKIPPING_WHITESPACE=true NVG_FONT_TEXTURE_FLAGS=NVG_IMAGE_NEAREST USE_NANOVG_FBO=true
  85. endif
  86. plugins: deps
  87. $(MAKE) all -C plugins
  88. resources: cardinal
  89. $(MAKE) resources -C plugins
  90. ifneq ($(CROSS_COMPILING),true)
  91. gen: cardinal resources dpf/utils/lv2_ttl_generator
  92. @$(CURDIR)/dpf/utils/generate-ttl.sh
  93. dpf/utils/lv2_ttl_generator:
  94. $(MAKE) -C dpf/utils/lv2-ttl-generator
  95. else
  96. gen:
  97. endif
  98. # --------------------------------------------------------------
  99. unzipfx: deps/unzipfx/unzipfx2cat$(APP_EXT) Cardinal.zip
  100. cat deps/unzipfx/unzipfx2cat$(APP_EXT) Cardinal.zip > Cardinal
  101. chmod +x Cardinal
  102. Cardinal.zip: bin/Cardinal bin/CardinalFX.lv2/resources
  103. mkdir -p build/unzipfx
  104. ln -sf ../../bin/Cardinal build/unzipfx/Cardinal
  105. ln -s ../../bin/CardinalFX.lv2/resources build/unzipfx/resources
  106. cd build/unzipfx && \
  107. zip -r -9 ../../Cardinal.zip Cardinal resources
  108. deps/unzipfx/unzipfx2cat:
  109. make -C deps/unzipfx -f Makefile.linux
  110. deps/unzipfx/unzipfx2cat.exe:
  111. make -C deps/unzipfx -f Makefile.win32
  112. # --------------------------------------------------------------
  113. clean:
  114. $(MAKE) distclean -C carla
  115. $(MAKE) clean -C deps
  116. $(MAKE) clean -C dpf/dgl
  117. $(MAKE) clean -C dpf/utils/lv2-ttl-generator
  118. $(MAKE) clean -C plugins
  119. $(MAKE) clean -C src
  120. rm -rf bin build
  121. # --------------------------------------------------------------
  122. install:
  123. install -d $(DESTDIR)$(PREFIX)/bin
  124. install -d $(DESTDIR)$(PREFIX)/lib/lv2
  125. install -d $(DESTDIR)$(PREFIX)/lib/vst
  126. install -d $(DESTDIR)$(PREFIX)/lib/vst3
  127. install -d $(DESTDIR)$(PREFIX)/share/Cardinal
  128. cp -rL bin/Cardinal.lv2 $(DESTDIR)$(PREFIX)/lib/lv2/
  129. cp -rL bin/Cardinal.vst3 $(DESTDIR)$(PREFIX)/lib/vst3/
  130. cp -rL bin/CardinalFX.lv2 $(DESTDIR)$(PREFIX)/lib/lv2/
  131. cp -rL bin/CardinalFX.vst $(DESTDIR)$(PREFIX)/lib/vst/
  132. cp -rL bin/CardinalFX.vst3 $(DESTDIR)$(PREFIX)/lib/vst3/
  133. cp -rL bin/CardinalSynth.lv2 $(DESTDIR)$(PREFIX)/lib/lv2/
  134. cp -rL bin/CardinalSynth.vst $(DESTDIR)$(PREFIX)/lib/vst/
  135. cp -rL bin/CardinalSynth.vst3 $(DESTDIR)$(PREFIX)/lib/vst3/
  136. install -m 755 bin/Cardinal$(APP_EXT) $(DESTDIR)$(PREFIX)/bin/
  137. cp -rL bin/Cardinal.lv2/resources/* $(DESTDIR)$(PREFIX)/share/Cardinal/
  138. # --------------------------------------------------------------
  139. .PHONY: carla deps plugins