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.

360 lines
12KB

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