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.

234 lines
7.6KB

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