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.

192 lines
4.8KB

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