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.

337 lines
11KB

  1. #!/usr/bin/make -f
  2. # Makefile for native-plugins #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. MODULENAME=native-plugins
  8. include ../modules/Makefile.mk
  9. # ----------------------------------------------------------------------------------------------------------------------------
  10. BUILD_C_FLAGS += -I..
  11. BUILD_CXX_FLAGS += -I.. -isystem $(CWD)/modules -I$(CWD)/modules/distrho
  12. # ----------------------------------------------------------------------------------------------------------------------------
  13. # Flags for Zita UIs
  14. ifeq ($(EXPERIMENTAL_PLUGINS),true)
  15. ZITA_DSP_CXX_FLAGS = $(BUILD_CXX_FLAGS) -Wno-unused-parameter
  16. ZITA_DSP_CXX_FLAGS += $(shell pkg-config --cflags fftw3f)
  17. ZITA_UI_CXX_FLAGS = $(BUILD_CXX_FLAGS) -Wno-unused-parameter -Wno-ignored-qualifiers
  18. ZITA_UI_CXX_FLAGS += $(shell pkg-config --cflags cairo libpng12 freetype2 x11 xft zlib)
  19. ZITA_UI_LINK_FLAGS = $(LINK_FLAGS) -lclxclient -lclthreads
  20. ZITA_UI_LINK_FLAGS += $(shell pkg-config --libs cairo libpng12 freetype2 x11 xft zlib)
  21. ZITA_UI_LINK_FLAGS += -ldl -lpthread -lrt
  22. endif # EXPERIMENTAL_PLUGINS
  23. # ----------------------------------------------------------------------------------------------------------------------------
  24. # Flags for ZynAddSubFX
  25. ifeq ($(HAVE_ZYN_DEPS),true)
  26. ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) -Izynaddsubfx -Izynaddsubfx/rtosc
  27. ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib)
  28. ZYN_LD_FLAGS = $(shell pkg-config --libs liblo)
  29. ifeq ($(HAVE_X11),true)
  30. ZYN_CXX_FLAGS += $(shell pkg-config --cflags x11)
  31. ZYN_LD_FLAGS += $(shell pkg-config --libs x11)
  32. endif
  33. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  34. ifeq ($(HAVE_NTK),true)
  35. FLUID = ntk-fluid
  36. ZYN_CXX_FLAGS += -DNTK_GUI
  37. ZYN_CXX_FLAGS += $(shell pkg-config --cflags ntk_images ntk)
  38. ZYN_LD_FLAGS += $(shell pkg-config --libs ntk_images ntk)
  39. else # HAVE_NTK
  40. FLUID = fluid
  41. ZYN_CXX_FLAGS += -DFLTK_GUI
  42. ZYN_CXX_FLAGS += $(shell fltk-config --use-images --cxxflags)
  43. ZYN_LD_FLAGS += $(shell fltk-config --use-images --ldstaticflags)
  44. endif # HAVE_NTK
  45. else # HAVE_ZYN_UI_DEPS
  46. ZYN_CXX_FLAGS += -DNO_UI
  47. endif # HAVE_ZYN_UI_DEPS
  48. endif # HAVE_ZYN_DEPS
  49. # ----------------------------------------------------------------------------------------------------------------------------
  50. # Set targets
  51. TARGETS = $(MODULEDIR)/$(MODULENAME).a
  52. # ----------------------------------------------------------------------------------------------------------------------------
  53. # Set objects
  54. OBJS = \
  55. $(OBJDIR)/_all.c.o \
  56. $(OBJDIR)/_data.cpp.o
  57. # ----------------------------------------------------------------------------------------------------------------------------
  58. # Simple plugins
  59. OBJS += \
  60. $(OBJDIR)/bypass.c.o \
  61. $(OBJDIR)/lfo.c.o \
  62. $(OBJDIR)/midi-channel-filter.c.o \
  63. $(OBJDIR)/midi-gain.c.o \
  64. $(OBJDIR)/midi-join.c.o \
  65. $(OBJDIR)/midi-split.c.o \
  66. $(OBJDIR)/midi-through.c.o \
  67. $(OBJDIR)/midi-transpose.c.o
  68. OBJS += \
  69. $(OBJDIR)/audio-file.cpp.o \
  70. $(OBJDIR)/bigmeter.cpp.o \
  71. $(OBJDIR)/midi-file.cpp.o \
  72. $(OBJDIR)/midi-sequencer.cpp.o \
  73. $(OBJDIR)/notes.cpp.o
  74. # ----------------------------------------------------------------------------------------------------------------------------
  75. # DISTRHO plugins
  76. OBJS += \
  77. $(OBJDIR)/distrho-3bandeq.cpp.o \
  78. $(OBJDIR)/distrho-3bandsplitter.cpp.o \
  79. $(OBJDIR)/distrho-mverb.cpp.o \
  80. $(OBJDIR)/distrho-nekobi.cpp.o \
  81. $(OBJDIR)/distrho-pingpongpan.cpp.o
  82. ifeq ($(HAVE_DGL),true)
  83. ifeq ($(HAVE_PROJECTM),true)
  84. OBJS += $(OBJDIR)/distrho-prom.cpp.o
  85. endif
  86. endif
  87. # ----------------------------------------------------------------------------------------------------------------------------
  88. # DISTRHO plugins (Juice)
  89. OBJS += \
  90. $(OBJDIR)/distrho-vectorjuice.cpp.o \
  91. $(OBJDIR)/distrho-wobblejuice.cpp.o
  92. # ----------------------------------------------------------------------------------------------------------------------------
  93. # ZynAddSubFX
  94. ifeq ($(LINUX),true)
  95. ifeq ($(HAVE_ZYN_DEPS),true)
  96. OBJS += \
  97. $(OBJDIR)/zynaddsubfx-fx.cpp.o \
  98. $(OBJDIR)/zynaddsubfx-synth.cpp.o \
  99. $(OBJDIR)/zynaddsubfx-src.cpp.o
  100. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  101. TARGETS += resources/zynaddsubfx-ui$(APP_EXT)
  102. ZYN_UI_FILES_CPP = \
  103. zynaddsubfx/UI/ADnoteUI.cpp \
  104. zynaddsubfx/UI/BankUI.cpp \
  105. zynaddsubfx/UI/ConfigUI.cpp \
  106. zynaddsubfx/UI/EffUI.cpp \
  107. zynaddsubfx/UI/EnvelopeUI.cpp \
  108. zynaddsubfx/UI/FilterUI.cpp \
  109. zynaddsubfx/UI/LFOUI.cpp \
  110. zynaddsubfx/UI/MasterUI.cpp \
  111. zynaddsubfx/UI/MicrotonalUI.cpp \
  112. zynaddsubfx/UI/OscilGenUI.cpp \
  113. zynaddsubfx/UI/PADnoteUI.cpp \
  114. zynaddsubfx/UI/PartUI.cpp \
  115. zynaddsubfx/UI/PresetsUI.cpp \
  116. zynaddsubfx/UI/ResonanceUI.cpp \
  117. zynaddsubfx/UI/SUBnoteUI.cpp \
  118. zynaddsubfx/UI/VirKeyboard.cpp
  119. ZYN_UI_FILES_H = \
  120. zynaddsubfx/UI/ADnoteUI.h \
  121. zynaddsubfx/UI/BankUI.h \
  122. zynaddsubfx/UI/ConfigUI.h \
  123. zynaddsubfx/UI/EffUI.h \
  124. zynaddsubfx/UI/EnvelopeUI.h \
  125. zynaddsubfx/UI/FilterUI.h \
  126. zynaddsubfx/UI/LFOUI.h \
  127. zynaddsubfx/UI/MasterUI.h \
  128. zynaddsubfx/UI/MicrotonalUI.h \
  129. zynaddsubfx/UI/OscilGenUI.h \
  130. zynaddsubfx/UI/PADnoteUI.h \
  131. zynaddsubfx/UI/PartUI.h \
  132. zynaddsubfx/UI/PresetsUI.h \
  133. zynaddsubfx/UI/ResonanceUI.h \
  134. zynaddsubfx/UI/SUBnoteUI.h \
  135. zynaddsubfx/UI/VirKeyboard.h
  136. endif
  137. endif
  138. endif
  139. # ----------------------------------------------------------------------------------------------------------------------------
  140. # Experimental plugins
  141. ifeq ($(EXPERIMENTAL_PLUGINS),true)
  142. OBJS += \
  143. $(OBJDIR)/zita-at1.cpp.o \
  144. $(OBJDIR)/zita-bls1.cpp.o \
  145. $(OBJDIR)/zita-rev1.cpp.o
  146. TARGETS += \
  147. resources/at1-ui$(APP_EXT) \
  148. resources/bls1-ui$(APP_EXT) \
  149. resources/rev1-ui$(APP_EXT)
  150. endif
  151. # ----------------------------------------------------------------------------------------------------------------------------
  152. all: $(TARGETS)
  153. # ----------------------------------------------------------------------------------------------------------------------------
  154. clean:
  155. rm -f $(OBJDIR)/*.o $(MODULEDIR)/$(MODULENAME)*.a $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP) $(TARGETS)
  156. debug:
  157. $(MAKE) DEBUG=true
  158. # ----------------------------------------------------------------------------------------------------------------------------
  159. $(MODULEDIR)/$(MODULENAME).a: $(OBJS)
  160. -@mkdir -p $(MODULEDIR)
  161. @echo "Creating $(MODULENAME).a"
  162. @rm -f $@
  163. @$(AR) crs $@ $^
  164. resources/at1-ui$(APP_EXT): $(OBJDIR)/zita-at1-ui.cpp.o
  165. -@mkdir -p $(OBJDIR)
  166. @echo "Linking at1-ui"
  167. @$(CXX) $^ $(ZITA_UI_LINK_FLAGS) -o $@
  168. resources/bls1-ui$(APP_EXT): $(OBJDIR)/zita-bls1-ui.cpp.o
  169. -@mkdir -p $(OBJDIR)
  170. @echo "Linking bls1-ui"
  171. @$(CXX) $^ $(ZITA_UI_LINK_FLAGS) -o $@
  172. resources/rev1-ui$(APP_EXT): $(OBJDIR)/zita-rev1-ui.cpp.o
  173. -@mkdir -p $(OBJDIR)
  174. @echo "Linking rev1-ui"
  175. @$(CXX) $^ $(ZITA_UI_LINK_FLAGS) -o $@
  176. resources/zynaddsubfx-ui$(APP_EXT): $(OBJDIR)/zynaddsubfx-ui.cpp.o
  177. -@mkdir -p $(OBJDIR)
  178. @echo "Linking zynaddsubfx-ui"
  179. @$(CXX) $^ $(ZYN_LD_FLAGS) -ldl -lpthread -o $@
  180. # ----------------------------------------------------------------------------------------------------------------------------
  181. zynaddsubfx/UI/%.cpp: zynaddsubfx/UI/%.fl
  182. @echo "Generating $@/h"
  183. @$(FLUID) -c -o zynaddsubfx/UI/$*.cpp -h zynaddsubfx/UI/$*.h $<
  184. zynaddsubfx/UI/%.h: zynaddsubfx/UI/%.fl
  185. @echo "Generating $@/cpp"
  186. @$(FLUID) -c -o zynaddsubfx/UI/$*.cpp -h zynaddsubfx/UI/$*.h $<
  187. # ----------------------------------------------------------------------------------------------------------------------------
  188. $(OBJDIR)/_all.c.o: _all.c
  189. -@mkdir -p $(OBJDIR)
  190. @echo "Compiling $<"
  191. @$(CC) $< $(BUILD_C_FLAGS) -c -o $@
  192. $(OBJDIR)/%.c.o: %.c
  193. -@mkdir -p $(OBJDIR)
  194. @echo "Compiling $<"
  195. @$(CC) $< $(BUILD_C_FLAGS) -c -o $@
  196. # ----------------------------------------------------------------------------------------------------------------------------
  197. $(OBJDIR)/distrho-3bandeq.cpp.o: distrho-3bandeq.cpp
  198. -@mkdir -p $(OBJDIR)
  199. @echo "Compiling $<"
  200. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_3BandEQ -Idistrho-3bandeq -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  201. $(OBJDIR)/distrho-3bandsplitter.cpp.o: distrho-3bandsplitter.cpp
  202. -@mkdir -p $(OBJDIR)
  203. @echo "Compiling $<"
  204. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_3BandSplitter -Idistrho-3bandsplitter -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  205. $(OBJDIR)/distrho-mverb.cpp.o: distrho-mverb.cpp
  206. -@mkdir -p $(OBJDIR)
  207. # FIXME - fix mverb strict warnings
  208. @echo "Compiling $<"
  209. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_MVerb -Idistrho-mverb -I$(CWD)/modules/dgl -Wno-conversion -Wno-effc++ -Wno-shadow -c -o $@
  210. $(OBJDIR)/distrho-nekobi.cpp.o: distrho-nekobi.cpp
  211. -@mkdir -p $(OBJDIR)
  212. # FIXME - fix nekobi strict warnings
  213. @echo "Compiling $<"
  214. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_Nekobi -Idistrho-nekobi -I$(CWD)/modules/dgl -w -c -o $@
  215. $(OBJDIR)/distrho-pingpongpan.cpp.o: distrho-pingpongpan.cpp
  216. -@mkdir -p $(OBJDIR)
  217. @echo "Compiling $<"
  218. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_PingPongPan -Idistrho-pingpongpan -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  219. $(OBJDIR)/distrho-prom.cpp.o: distrho-prom.cpp
  220. -@mkdir -p $(OBJDIR)
  221. @echo "Compiling $<"
  222. @$(CXX) $< $(BUILD_CXX_FLAGS) $(PROJECTM_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_ProM -Idistrho-prom -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  223. # ----------------------------------------------------------------------------------------------------------------------------
  224. $(OBJDIR)/distrho-vectorjuice.cpp.o: distrho-vectorjuice.cpp
  225. -@mkdir -p $(OBJDIR)
  226. @echo "Compiling $<"
  227. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_VectorJuice -Idistrho-vectorjuice -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  228. $(OBJDIR)/distrho-wobblejuice.cpp.o: distrho-wobblejuice.cpp
  229. -@mkdir -p $(OBJDIR)
  230. @echo "Compiling $<"
  231. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_WobbleJuice -Idistrho-wobblejuice -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  232. # ----------------------------------------------------------------------------------------------------------------------------
  233. $(OBJDIR)/zynaddsubfx-fx.cpp.o: zynaddsubfx-fx.cpp $(ZYN_UI_FILES_H)
  234. -@mkdir -p $(OBJDIR)
  235. @echo "Compiling $<"
  236. @$(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@
  237. $(OBJDIR)/zynaddsubfx-synth.cpp.o: zynaddsubfx-synth.cpp $(ZYN_UI_FILES_H)
  238. -@mkdir -p $(OBJDIR)
  239. @echo "Compiling $<"
  240. @$(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@
  241. $(OBJDIR)/zynaddsubfx-src.cpp.o: zynaddsubfx-src.cpp $(ZYN_UI_FILES_H)
  242. -@mkdir -p $(OBJDIR)
  243. @echo "Compiling $<"
  244. @$(CXX) $< $(ZYN_CXX_FLAGS) -Wno-unused-parameter -c -o $@
  245. $(OBJDIR)/zynaddsubfx-ui.cpp.o: zynaddsubfx-ui.cpp $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP)
  246. -@mkdir -p $(OBJDIR)
  247. @echo "Compiling $<"
  248. @$(CXX) $< $(ZYN_CXX_FLAGS) -Wno-unused-parameter -Wno-unused-variable -c -o $@
  249. # ----------------------------------------------------------------------------------------------------------------------------
  250. $(OBJDIR)/zita-%-ui.cpp.o: zita-%-ui.cpp
  251. -@mkdir -p $(OBJDIR)
  252. @echo "Compiling $<"
  253. @$(CXX) $< $(ZITA_UI_CXX_FLAGS) -c -o $@
  254. $(OBJDIR)/zita-%.cpp.o: zita-%.cpp
  255. -@mkdir -p $(OBJDIR)
  256. @echo "Compiling $<"
  257. @$(CXX) $< $(ZITA_DSP_CXX_FLAGS) -c -o $@
  258. # ----------------------------------------------------------------------------------------------------------------------------
  259. $(OBJDIR)/%.cpp.o: %.cpp
  260. -@mkdir -p $(OBJDIR)
  261. @echo "Compiling $<"
  262. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  263. # ----------------------------------------------------------------------------------------------------------------------------
  264. -include $(OBJS:%.o=%.d)
  265. -include $(OBJDIR)/zita-at1-ui.cpp.d
  266. -include $(OBJDIR)/zita-bls1-ui.cpp.d
  267. -include $(OBJDIR)/zita-rev1-ui.cpp.d
  268. -include $(OBJDIR)/zynaddsubfx-ui.cpp.d
  269. # ----------------------------------------------------------------------------------------------------------------------------