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.

192 lines
5.7KB

  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. ifeq ($(CARLA_ZYN_COMPAT),true)
  33. BUILD_CXX_FLAGS += -DCARLA_ZYN_LV2_EXPORTED
  34. endif
  35. # ----------------------------------------------------------------------------------------------------------------------------
  36. # Libs
  37. LIBS = $(MODULEDIR)/carla_engine_plugin.a
  38. LIBS += $(MODULEDIR)/carla_plugin.a
  39. LIBS += $(MODULEDIR)/jackbridge.a
  40. LIBS += $(MODULEDIR)/juce_core.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. # ----------------------------------------------------------------------------------------------------------------------------
  51. # Link flags
  52. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  53. LINK_FLAGS += $(JUCE_CORE_LIBS)
  54. LINK_FLAGS += $(LILV_LIBS)
  55. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  56. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  57. ifeq ($(HAVE_LIBLO),true)
  58. LINK_FLAGS += $(LIBLO_LIBS)
  59. endif
  60. ifeq ($(HAVE_LIBMAGIC),true)
  61. LINK_FLAGS += $(MAGIC_LIBS)
  62. endif
  63. ifeq ($(HAVE_FLUIDSYNTH),true)
  64. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  65. endif
  66. ifeq ($(HAVE_LINUXSAMPLER),true)
  67. LINK_FLAGS += $(LINUXSAMPLER_LIBS)
  68. endif
  69. ifeq ($(HAVE_X11),true)
  70. LINK_FLAGS += $(X11_LIBS)
  71. endif
  72. # ----------------------------------------------------------------------------------------------------------------------------
  73. TARGETS = \
  74. $(BINDIR)/carla.lv2/carla$(LIB_EXT) \
  75. $(BINDIR)/carla.lv2/manifest.ttl
  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. endif
  83. endif
  84. endif
  85. # ----------------------------------------------------------------------------------------------------------------------------
  86. all: $(TARGETS)
  87. # ----------------------------------------------------------------------------------------------------------------------------
  88. clean:
  89. rm -f $(OBJDIR)/*.o $(TARGETS)
  90. rm -f $(BINDIR)/carla.lv2/*.*
  91. rm -f $(BINDIR)/carla-lv2-export$(APP_EXT)
  92. debug:
  93. $(MAKE) DEBUG=true
  94. # ----------------------------------------------------------------------------------------------------------------------------
  95. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS)
  96. -@mkdir -p $(BINDIR)/carla.lv2
  97. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  98. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  99. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(LIBS)
  100. -@mkdir -p $(BINDIR)
  101. @echo "Linking CarlaRack$(LIB_EXT)"
  102. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  103. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(LIBS)
  104. -@mkdir -p $(BINDIR)
  105. @echo "Linking CarlaRackFX$(LIB_EXT)"
  106. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  107. # ----------------------------------------------------------------------------------------------------------------------------
  108. $(OBJDIR)/carla-lv2.cpp.o: carla-lv2.cpp
  109. -@mkdir -p $(OBJDIR)
  110. @echo "Compiling $<"
  111. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  112. $(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp
  113. -@mkdir -p $(OBJDIR)
  114. @echo "Compiling $< (RackFX)"
  115. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  116. $(OBJDIR)/carla-vst.cpp.rack-syn.o: carla-vst.cpp
  117. -@mkdir -p $(OBJDIR)
  118. @echo "Compiling $< (RackSynth)"
  119. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  120. # ----------------------------------------------------------------------------------------------------------------------------
  121. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  122. -@mkdir -p $(BINDIR)/carla.lv2
  123. @echo "Linking carla-lv2-export$(APP_EXT)"
  124. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  125. @echo "Generating LV2 ttl data"
  126. ifeq ($(BUILDING_FOR_WINDOWS),true)
  127. @cd $(BINDIR) && wine ./carla-lv2-export$(APP_EXT)
  128. else
  129. @cd $(BINDIR) && ./carla-lv2-export$(APP_EXT)
  130. endif
  131. @cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  132. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  133. -@mkdir -p $(BINDIR)
  134. @echo "Linking carla-lv2-export$(APP_EXT)"
  135. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  136. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  137. -@mkdir -p $(OBJDIR)
  138. @echo "Compiling $<"
  139. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  140. # ----------------------------------------------------------------------------------------------------------------------------
  141. -include $(OBJDIR)/carla-lv2.cpp.d
  142. -include $(OBJDIR)/carla-lv2-export.cpp.d
  143. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  144. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  145. # ----------------------------------------------------------------------------------------------------------------------------