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.

252 lines
7.9KB

  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)/utils -isystem $(CWD)/modules
  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_LINUXSAMPLER),true)
  27. BUILD_CXX_FLAGS += $(LINUXSAMPLER_FLAGS)
  28. endif
  29. ifeq ($(HAVE_X11),true)
  30. BUILD_CXX_FLAGS += $(X11_FLAGS)
  31. endif
  32. # ----------------------------------------------------------------------------------------------------------------------------
  33. # Libs
  34. LIBS = $(MODULEDIR)/carla_engine_plugin.a
  35. LIBS += $(MODULEDIR)/carla_plugin.a
  36. LIBS += $(MODULEDIR)/jackbridge.a
  37. LIBS += $(MODULEDIR)/juce_audio_basics.a
  38. LIBS += $(MODULEDIR)/juce_audio_formats.a
  39. LIBS += $(MODULEDIR)/juce_core.a
  40. LIBS += $(MODULEDIR)/juce_events.a
  41. LIBS += $(MODULEDIR)/lilv.a
  42. LIBS += $(MODULEDIR)/native-plugins.a
  43. LIBS += $(MODULEDIR)/rtmempool.a
  44. ifeq ($(HAVE_DGL),true)
  45. LIBS += $(MODULEDIR)/dgl.a
  46. endif
  47. ifeq ($(HAVE_HYLIA),true)
  48. LIBS += $(MODULEDIR)/hylia.a
  49. endif
  50. ifeq ($(MACOS_OR_WIN32),true)
  51. LIBS += $(MODULEDIR)/juce_audio_processors.a
  52. LIBS += $(MODULEDIR)/juce_data_structures.a
  53. LIBS += $(MODULEDIR)/juce_graphics.a
  54. LIBS += $(MODULEDIR)/juce_gui_basics.a
  55. endif
  56. ifeq ($(MACOS),true)
  57. LIBS += $(MODULEDIR)/juce_gui_extra.a
  58. endif
  59. # ----------------------------------------------------------------------------------------------------------------------------
  60. # Link flags
  61. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  62. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  63. LINK_FLAGS += $(JUCE_AUDIO_FORMATS_LIBS)
  64. LINK_FLAGS += $(JUCE_CORE_LIBS)
  65. LINK_FLAGS += $(LILV_LIBS)
  66. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  67. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  68. ifeq ($(MACOS_OR_WIN32),true)
  69. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  70. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  71. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  72. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  73. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  74. endif
  75. ifeq ($(MACOS),true)
  76. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  77. endif
  78. ifeq ($(HAVE_LIBLO),true)
  79. LINK_FLAGS += $(LIBLO_LIBS)
  80. endif
  81. ifeq ($(HAVE_LIBMAGIC),true)
  82. LINK_FLAGS += $(MAGIC_LIBS)
  83. endif
  84. ifeq ($(HAVE_FLUIDSYNTH),true)
  85. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  86. endif
  87. ifeq ($(HAVE_LINUXSAMPLER),true)
  88. LINK_FLAGS += $(LINUXSAMPLER_LIBS)
  89. endif
  90. ifeq ($(HAVE_X11),true)
  91. LINK_FLAGS += $(X11_LIBS)
  92. endif
  93. # ----------------------------------------------------------------------------------------------------------------------------
  94. TARGETS = \
  95. $(BINDIR)/carla.lv2/carla$(LIB_EXT) \
  96. $(BINDIR)/carla.lv2/manifest.ttl
  97. ifeq ($(LINUX),true)
  98. ifeq ($(HAVE_X11),true)
  99. ifeq ($(HAVE_PYQT),true)
  100. TARGETS += \
  101. $(BINDIR)/CarlaRack$(LIB_EXT) \
  102. $(BINDIR)/CarlaRackFX$(LIB_EXT) \
  103. $(BINDIR)/CarlaPatchbay$(LIB_EXT) \
  104. $(BINDIR)/CarlaPatchbay16$(LIB_EXT) \
  105. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT)
  106. endif
  107. endif
  108. endif
  109. # ----------------------------------------------------------------------------------------------------------------------------
  110. all: $(TARGETS)
  111. # ----------------------------------------------------------------------------------------------------------------------------
  112. clean:
  113. rm -f $(OBJDIR)/*.o $(TARGETS)
  114. rm -f $(BINDIR)/carla.lv2/*.*
  115. rm -f $(BINDIR)/carla-lv2-export$(APP_EXT)
  116. debug:
  117. $(MAKE) DEBUG=true
  118. # ----------------------------------------------------------------------------------------------------------------------------
  119. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS)
  120. -@mkdir -p $(BINDIR)/carla.lv2
  121. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  122. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  123. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(LIBS)
  124. -@mkdir -p $(BINDIR)
  125. @echo "Linking CarlaRack$(LIB_EXT)"
  126. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  127. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(LIBS)
  128. -@mkdir -p $(BINDIR)
  129. @echo "Linking CarlaRackFX$(LIB_EXT)"
  130. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  131. $(BINDIR)/CarlaPatchbay$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn.o $(LIBS)
  132. -@mkdir -p $(BINDIR)
  133. @echo "Linking CarlaPatchbay$(LIB_EXT)"
  134. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  135. $(BINDIR)/CarlaPatchbay16$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o $(LIBS)
  136. -@mkdir -p $(BINDIR)
  137. @echo "Linking CarlaPatchbay16$(LIB_EXT)"
  138. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  139. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-fx.o $(LIBS)
  140. -@mkdir -p $(BINDIR)
  141. @echo "Linking CarlaPatchbayFX$(LIB_EXT)"
  142. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  143. # ----------------------------------------------------------------------------------------------------------------------------
  144. $(OBJDIR)/carla-lv2.cpp.o: carla-lv2.cpp
  145. -@mkdir -p $(OBJDIR)
  146. @echo "Compiling $<"
  147. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  148. $(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp
  149. -@mkdir -p $(OBJDIR)
  150. @echo "Compiling $< (RackFX)"
  151. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  152. $(OBJDIR)/carla-vst.cpp.rack-syn.o: carla-vst.cpp
  153. -@mkdir -p $(OBJDIR)
  154. @echo "Compiling $< (RackSynth)"
  155. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  156. $(OBJDIR)/carla-vst.cpp.patchbay-fx.o: carla-vst.cpp
  157. -@mkdir -p $(OBJDIR)
  158. @echo "Compiling $< (PatchbayFX)"
  159. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  160. $(OBJDIR)/carla-vst.cpp.patchbay-syn.o: carla-vst.cpp
  161. -@mkdir -p $(OBJDIR)
  162. @echo "Compiling $< (PatchbaySynth)"
  163. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  164. $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp
  165. -@mkdir -p $(OBJDIR)
  166. @echo "Compiling $< (PatchbaySynth 16ch)"
  167. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH -c -o $@
  168. # ----------------------------------------------------------------------------------------------------------------------------
  169. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  170. -@mkdir -p $(BINDIR)/carla.lv2
  171. @echo "Linking carla-lv2-export$(APP_EXT)"
  172. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  173. @echo "Generating LV2 ttl data"
  174. ifeq ($(BUILDING_FOR_WINDOWS),true)
  175. @cd $(BINDIR) && wine ./carla-lv2-export$(APP_EXT)
  176. else
  177. @cd $(BINDIR) && ./carla-lv2-export$(APP_EXT)
  178. endif
  179. @cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  180. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  181. -@mkdir -p $(BINDIR)
  182. @echo "Linking carla-lv2-export$(APP_EXT)"
  183. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  184. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  185. -@mkdir -p $(OBJDIR)
  186. @echo "Compiling $<"
  187. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  188. # ----------------------------------------------------------------------------------------------------------------------------
  189. -include $(OBJDIR)/carla-lv2.cpp.d
  190. -include $(OBJDIR)/carla-lv2-export.cpp.d
  191. -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
  192. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn.d
  193. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn16.d
  194. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  195. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  196. # ----------------------------------------------------------------------------------------------------------------------------