Audio plugin host https://kx.studio/carla
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.

Makefile.mk 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. #!/usr/bin/make -f
  2. # Makefile for native-plugins #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. ifeq ($(TESTBUILD),true)
  7. ifeq ($(LINUX),true)
  8. CXXFLAGS += -isystem /opt/kxstudio/include/ntk
  9. endif
  10. endif
  11. ifeq ($(MACOS_OR_WIN32),true)
  12. HAVE_DGL = true
  13. SKIP_ZYN_SYNTH = true
  14. else
  15. HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
  16. endif
  17. HAVE_NTK = $(shell pkg-config --exists ntk ntk_images && echo true)
  18. HAVE_PROJECTM = $(shell pkg-config --exists libprojectM && echo true)
  19. ifneq ($(MACOS_OLD),true)
  20. HAVE_ZYN_DEPS = $(shell pkg-config --exists liblo fftw3 mxml zlib && echo true)
  21. endif
  22. # ---------------------------------------------------------------------------------------------------------------------
  23. # Check for optional libs (special non-pkgconfig unix tests)
  24. ifeq ($(UNIX),true)
  25. # fltk doesn't have a pkg-config file but has fltk-config instead.
  26. # Also, don't try looking for it if we already have NTK.
  27. ifneq ($(HAVE_NTK),true)
  28. ifeq ($(shell which fltk-config 1>/dev/null 2>/dev/null && echo true),true)
  29. ifeq ($(shell which fluid 1>/dev/null 2>/dev/null && echo true),true)
  30. HAVE_FLTK = true
  31. endif
  32. endif
  33. endif
  34. endif
  35. # ---------------------------------------------------------------------------------------------------------------------
  36. ifeq ($(HAVE_FLTK),true)
  37. HAVE_ZYN_UI_DEPS = true
  38. endif
  39. ifeq ($(HAVE_NTK),true)
  40. HAVE_ZYN_UI_DEPS = true
  41. endif
  42. # ---------------------------------------------------------------------------------------------------------------------
  43. ifeq ($(HAVE_DGL),true)
  44. BASE_FLAGS += -DHAVE_DGL
  45. endif
  46. ifeq ($(HAVE_PROJECTM),true)
  47. BASE_FLAGS += -DHAVE_PROJECTM
  48. endif
  49. ifeq ($(HAVE_ZYN_DEPS),true)
  50. BASE_FLAGS += -DHAVE_ZYN_DEPS
  51. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  52. BASE_FLAGS += -DHAVE_ZYN_UI_DEPS
  53. endif
  54. endif
  55. # ---------------------------------------------------------------------------------------------------------------------
  56. ifeq ($(HAVE_DGL),true)
  57. ifeq ($(MACOS_OR_WIN32),true)
  58. ifeq ($(MACOS),true)
  59. DGL_LIBS = -framework OpenGL -framework Cocoa
  60. endif
  61. ifeq ($(WIN32),true)
  62. DGL_LIBS = -lopengl32 -lgdi32
  63. endif
  64. else
  65. DGL_FLAGS = $(shell pkg-config --cflags gl x11)
  66. DGL_LIBS = $(shell pkg-config --libs gl x11)
  67. endif
  68. DGL_FLAGS += -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES
  69. endif
  70. # ---------------------------------------------------------------------------------------------------------------------
  71. ifeq ($(HAVE_PROJECTM),true)
  72. PROJECTM_FLAGS = $(shell pkg-config --cflags libprojectM)
  73. PROJECTM_LIBS = $(shell pkg-config --libs libprojectM)
  74. endif
  75. # ---------------------------------------------------------------------------------------------------------------------
  76. # Flags for DPF Plugins
  77. DPF_FLAGS = -I$(CWDE)/modules/distrho
  78. ifeq ($(HAVE_DGL),true)
  79. ifneq ($(MACOS_OR_WIN32),true)
  80. DPF_FLAGS += $(shell pkg-config --cflags gl)
  81. endif
  82. DPF_FLAGS += -I$(CWDE)/modules/dgl -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES
  83. endif
  84. # ---------------------------------------------------------------------------------------------------------------------
  85. # Flags for ZynAddSubFX (DSP and UI separated)
  86. ifeq ($(HAVE_ZYN_DEPS),true)
  87. # Common flags
  88. ZYN_BASE_FLAGS = $(shell pkg-config --cflags liblo mxml)
  89. ZYN_BASE_FLAGS += -Iexternal/zynaddsubfx -Iexternal/zynaddsubfx/rtosc
  90. ifneq ($(WIN32),true)
  91. ZYN_BASE_FLAGS += -DHAVE_ASYNC
  92. endif
  93. ZYN_BASE_LIBS = $(shell pkg-config --libs liblo mxml) -lpthread
  94. ZYN_BASE_LIBS += $(LIBDL_LIBS)
  95. # DSP flags
  96. ZYN_DSP_FLAGS = $(ZYN_BASE_FLAGS)
  97. ZYN_DSP_FLAGS += $(shell pkg-config --cflags fftw3 zlib)
  98. ZYN_DSP_LIBS = $(ZYN_BASE_LIBS)
  99. ZYN_DSP_LIBS += $(shell pkg-config --libs fftw3 zlib)
  100. ifeq ($(SKIP_ZYN_SYNTH),true)
  101. BASE_FLAGS += -DSKIP_ZYN_SYNTH
  102. else
  103. # UI flags
  104. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  105. # Common UI flags
  106. ZYN_UI_FLAGS = $(ZYN_BASE_FLAGS)
  107. ZYN_UI_LIBS = $(ZYN_BASE_LIBS)
  108. # NTK or FLTK UI flags
  109. ifeq ($(HAVE_NTK),true)
  110. FLUID = ntk-fluid
  111. ZYN_UI_FLAGS += $(shell pkg-config --cflags ntk_images ntk) -DNTK_GUI
  112. ZYN_UI_LIBS += $(shell pkg-config --libs ntk_images ntk)
  113. else # HAVE_NTK
  114. FLUID = fluid
  115. ZYN_UI_FLAGS += $(shell fltk-config --use-images --cxxflags) -DFLTK_GUI
  116. ZYN_UI_LIBS += $(shell fltk-config --use-images --ldflags)
  117. endif # HAVE_NTK
  118. # UI extra flags
  119. ifeq ($(HAVE_X11),true)
  120. ZYN_UI_FLAGS += $(shell pkg-config --cflags x11)
  121. ZYN_UI_LIBS += $(shell pkg-config --libs x11)
  122. endif
  123. ifeq ($(LINUX),true)
  124. ZYN_UI_LIBS += -lrt
  125. endif
  126. else # HAVE_ZYN_UI_DEPS
  127. ZYN_DSP_FLAGS += -DNO_UI
  128. endif # SKIP_ZYN_SYNTH
  129. endif # HAVE_ZYN_UI_DEPS
  130. endif # HAVE_ZYN_DEPS
  131. # ---------------------------------------------------------------------------------------------------------------------
  132. NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
  133. NATIVE_PLUGINS_LIBS += $(PROJECTM_LIBS)
  134. NATIVE_PLUGINS_LIBS += $(ZYN_DSP_LIBS)
  135. NATIVE_PLUGINS_LIBS += $(ZITA_DSP_LIBS)
  136. # ---------------------------------------------------------------------------------------------------------------------
  137. ifeq ($(HAVE_DGL),true)
  138. ALL_LIBS += $(MODULEDIR)/dgl.a
  139. endif
  140. # ---------------------------------------------------------------------------------------------------------------------
  141. all:
  142. install_external_plugins:
  143. ifeq ($(HAVE_ZYN_DEPS),true)
  144. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  145. # Create directories (zynaddsubfx)
  146. install -d $(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx
  147. # Install resources (zynaddsubfx)
  148. install -m 644 \
  149. bin/resources/zynaddsubfx/*.png \
  150. $(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx
  151. install -m 755 \
  152. bin/resources/zynaddsubfx-ui \
  153. $(DESTDIR)$(DATADIR)/carla/resources
  154. endif
  155. endif
  156. features_print_external_plugins:
  157. @printf -- "\n"
  158. @printf -- "$(tS)---> External plugins: $(tE)\n"
  159. ifeq ($(HAVE_DGL),true)
  160. @printf -- "DPF Plugins: $(ANS_YES) (with UI)\n"
  161. ifeq ($(HAVE_PROJECTM),true)
  162. @printf -- "DPF ProM: $(ANS_YES)\n"
  163. else
  164. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing libprojectM$(mE)\n"
  165. endif
  166. else
  167. @printf -- "DPF Plugins: $(ANS_YES) (without UI)\n"
  168. ifeq ($(HAVE_PROJECTM),true)
  169. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL$(mE)\n"
  170. else
  171. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL and libprojectM$(mE)\n"
  172. endif
  173. endif
  174. ifeq ($(HAVE_ZYN_DEPS),true)
  175. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  176. ifeq ($(HAVE_NTK),true)
  177. @printf -- "ZynAddSubFX: $(ANS_YES) (with NTK UI)\n"
  178. else
  179. @printf -- "ZynAddSubFX: $(ANS_YES) (with FLTK UI)\n"
  180. endif
  181. else
  182. @printf -- "ZynAddSubFX: $(ANS_YES) (without UI) $(mS)FLTK or NTK missing$(mE)\n"
  183. endif
  184. else
  185. @printf -- "ZynAddSubFX: $(ANS_NO) $(mS)liblo, fftw3, mxml or zlib missing$(mE)\n"
  186. endif
  187. # ---------------------------------------------------------------------------------------------------------------------