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.

262 lines
8.8KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-plugin #
  3. # ------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. include $(CWD)/Makefile.mk
  8. # ----------------------------------------------------------------------------------------------------------------------------
  9. BINDIR := $(CWD)/../bin
  10. ifeq ($(DEBUG),true)
  11. OBJDIR := $(CWD)/../build/plugin/Debug
  12. MODULEDIR := $(CWD)/../build/modules/Debug
  13. else
  14. OBJDIR := $(CWD)/../build/plugin/Release
  15. MODULEDIR := $(CWD)/../build/modules/Release
  16. endif
  17. # ----------------------------------------------------------------------------------------------------------------------------
  18. BUILD_CXX_FLAGS += -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  19. BUILD_CXX_FLAGS += $(NATIVE_PLUGINS_FLAGS)
  20. ifeq ($(HAVE_LIBLO),true)
  21. BUILD_CXX_FLAGS += $(LIBLO_FLAGS)
  22. endif
  23. ifeq ($(HAVE_FLUIDSYNTH),true)
  24. BUILD_CXX_FLAGS += $(FLUIDSYNTH_FLAGS)
  25. endif
  26. ifeq ($(HAVE_X11),true)
  27. BUILD_CXX_FLAGS += $(X11_FLAGS)
  28. endif
  29. # ----------------------------------------------------------------------------------------------------------------------------
  30. # Libs
  31. LIBS = $(MODULEDIR)/carla_engine_plugin.a
  32. LIBS += $(MODULEDIR)/carla_plugin.a
  33. LIBS += $(MODULEDIR)/jackbridge.a
  34. LIBS += $(MODULEDIR)/lilv.a
  35. LIBS += $(MODULEDIR)/rtmempool.a
  36. LIBS += $(MODULEDIR)/water.a
  37. LIBS += $(MODULEDIR)/audio_decoder.a
  38. LIBS += $(MODULEDIR)/native-plugins.a
  39. LIBS += $(MODULEDIR)/sfzero.a
  40. ifeq ($(HAVE_DGL),true)
  41. LIBS += $(MODULEDIR)/dgl.a
  42. endif
  43. ifeq ($(HAVE_HYLIA),true)
  44. LIBS += $(MODULEDIR)/hylia.a
  45. endif
  46. # ----------------------------------------------------------------------------------------------------------------------------
  47. # Link flags
  48. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  49. LINK_FLAGS += $(LILV_LIBS)
  50. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  51. LINK_FLAGS += $(WATER_LIBS)
  52. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  53. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  54. LINK_FLAGS += $(LIBLO_LIBS)
  55. LINK_FLAGS += $(MAGIC_LIBS)
  56. LINK_FLAGS += $(X11_LIBS)
  57. ifeq ($(MACOS),true)
  58. SYMBOLS_LV2 = -Wl,-exported_symbol,_lv2_descriptor -Wl,-exported_symbol,_lv2ui_descriptor
  59. SYMBOLS_LV2_UI = -Wl,-exported_symbol,_lv2ui_descriptor
  60. SYMBOLS_VST = # TODO
  61. endif
  62. # ----------------------------------------------------------------------------------------------------------------------------
  63. # ...
  64. LIBS_ui = $(MODULEDIR)/water.a
  65. # ----------------------------------------------------------------------------------------------------------------------------
  66. TARGETS = \
  67. $(BINDIR)/carla.lv2/carla$(LIB_EXT)
  68. ifeq ($(HAVE_PYQT),true)
  69. TARGETS += \
  70. $(BINDIR)/carla.lv2/carla-ui$(LIB_EXT)
  71. endif
  72. ifneq ($(CROSS_COMPILING),true)
  73. TARGETS += \
  74. $(BINDIR)/carla.lv2/manifest.ttl
  75. endif
  76. ifeq ($(LINUX),true)
  77. ifeq ($(HAVE_X11),true)
  78. ifeq ($(HAVE_PYQT),true)
  79. TARGETS += \
  80. $(BINDIR)/CarlaRack$(LIB_EXT) \
  81. $(BINDIR)/CarlaRackFX$(LIB_EXT) \
  82. $(BINDIR)/CarlaPatchbay$(LIB_EXT) \
  83. $(BINDIR)/CarlaPatchbay16$(LIB_EXT) \
  84. $(BINDIR)/CarlaPatchbay32$(LIB_EXT) \
  85. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT) \
  86. $(BINDIR)/CarlaVstShell$(LIB_EXT)
  87. endif
  88. endif
  89. endif
  90. # ----------------------------------------------------------------------------------------------------------------------------
  91. all: $(TARGETS)
  92. # ----------------------------------------------------------------------------------------------------------------------------
  93. clean:
  94. rm -f $(OBJDIR)/*.o $(TARGETS)
  95. rm -f $(BINDIR)/carla.lv2/*.*
  96. rm -f $(BINDIR)/carla-lv2-export$(APP_EXT)
  97. debug:
  98. $(MAKE) DEBUG=true
  99. # ----------------------------------------------------------------------------------------------------------------------------
  100. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS)
  101. -@mkdir -p $(BINDIR)/carla.lv2
  102. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  103. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(SYMBOLS_LV2) $(LINK_FLAGS) -o $@
  104. $(BINDIR)/carla.lv2/carla-ui$(LIB_EXT): $(OBJDIR)/carla-lv2-ui.cpp.o $(LIBS_ui)
  105. -@mkdir -p $(BINDIR)/carla.lv2
  106. @echo "Linking carla.lv2/carla-ui$(LIB_EXT)"
  107. @$(CXX) $< $(LIBS_START) $(LIBS_ui) $(LIBS_END) $(SHARED) $(SYMBOLS_LV2_UI) $(LINK_FLAGS) -o $@
  108. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(LIBS)
  109. -@mkdir -p $(BINDIR)
  110. @echo "Linking CarlaRack$(LIB_EXT)"
  111. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  112. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(LIBS)
  113. -@mkdir -p $(BINDIR)
  114. @echo "Linking CarlaRackFX$(LIB_EXT)"
  115. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  116. $(BINDIR)/CarlaPatchbay$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn.o $(LIBS)
  117. -@mkdir -p $(BINDIR)
  118. @echo "Linking CarlaPatchbay$(LIB_EXT)"
  119. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  120. $(BINDIR)/CarlaPatchbay16$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o $(LIBS)
  121. -@mkdir -p $(BINDIR)
  122. @echo "Linking CarlaPatchbay16$(LIB_EXT)"
  123. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  124. $(BINDIR)/CarlaPatchbay32$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o $(LIBS)
  125. -@mkdir -p $(BINDIR)
  126. @echo "Linking CarlaPatchbay32$(LIB_EXT)"
  127. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  128. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-fx.o $(LIBS)
  129. -@mkdir -p $(BINDIR)
  130. @echo "Linking CarlaPatchbayFX$(LIB_EXT)"
  131. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  132. $(BINDIR)/CarlaVstShell$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.shell.o $(LIBS)
  133. -@mkdir -p $(BINDIR)
  134. @echo "Linking CarlaRackVstShell$(LIB_EXT)"
  135. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  136. # ----------------------------------------------------------------------------------------------------------------------------
  137. $(OBJDIR)/carla-lv2.cpp.o: carla-lv2.cpp
  138. -@mkdir -p $(OBJDIR)
  139. @echo "Compiling $<"
  140. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  141. $(OBJDIR)/carla-lv2-ui.cpp.o: carla-lv2-ui.cpp
  142. -@mkdir -p $(OBJDIR)
  143. @echo "Compiling $<"
  144. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  145. $(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp
  146. -@mkdir -p $(OBJDIR)
  147. @echo "Compiling $< (RackFX)"
  148. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  149. $(OBJDIR)/carla-vst.cpp.rack-syn.o: carla-vst.cpp
  150. -@mkdir -p $(OBJDIR)
  151. @echo "Compiling $< (RackSynth)"
  152. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  153. $(OBJDIR)/carla-vst.cpp.patchbay-fx.o: carla-vst.cpp
  154. -@mkdir -p $(OBJDIR)
  155. @echo "Compiling $< (PatchbayFX)"
  156. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  157. $(OBJDIR)/carla-vst.cpp.patchbay-syn.o: carla-vst.cpp
  158. -@mkdir -p $(OBJDIR)
  159. @echo "Compiling $< (PatchbaySynth)"
  160. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  161. $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp
  162. -@mkdir -p $(OBJDIR)
  163. @echo "Compiling $< (PatchbaySynth 16ch)"
  164. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH=1 -c -o $@
  165. $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o: carla-vst.cpp
  166. -@mkdir -p $(OBJDIR)
  167. @echo "Compiling $< (PatchbaySynth 32ch)"
  168. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_32CH=1 -c -o $@
  169. $(OBJDIR)/carla-vst.cpp.shell.o: carla-vst.cpp
  170. -@mkdir -p $(OBJDIR)
  171. @echo "Compiling $< (VstShell)"
  172. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL=1 -c -o $@
  173. # ----------------------------------------------------------------------------------------------------------------------------
  174. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  175. -@mkdir -p $(BINDIR)/carla.lv2
  176. @echo "Linking carla-lv2-export$(APP_EXT)"
  177. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  178. @echo "Generating LV2 ttl data"
  179. ifeq ($(BUILDING_FOR_WINDOWS),true)
  180. @cd $(BINDIR) && wine ./carla-lv2-export$(APP_EXT)
  181. else
  182. @cd $(BINDIR) && ./carla-lv2-export$(APP_EXT)
  183. endif
  184. @cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  185. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  186. -@mkdir -p $(BINDIR)
  187. @echo "Linking carla-lv2-export$(APP_EXT)"
  188. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  189. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  190. -@mkdir -p $(OBJDIR)
  191. @echo "Compiling $<"
  192. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  193. # ----------------------------------------------------------------------------------------------------------------------------
  194. -include $(OBJDIR)/carla-lv2.cpp.d
  195. -include $(OBJDIR)/carla-lv2-export.cpp.d
  196. -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
  197. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn.d
  198. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn16.d
  199. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  200. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  201. -include $(OBJDIR)/carla-vst.cpp.shell.d
  202. # ----------------------------------------------------------------------------------------------------------------------------