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.

158 lines
4.7KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-backend #
  3. # -------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. include Makefile.mk
  8. # ---------------------------------------------------------------------------------------------------------------------
  9. OBJS_standalone = \
  10. $(OBJDIR)/CarlaStandalone.cpp.o \
  11. $(OBJDIR)/CarlaStandaloneNSM.cpp.o
  12. ifneq ($(STATIC_PLUGIN_TARGET),true)
  13. TARGETS = \
  14. $(BINDIR)/libcarla_standalone2$(LIB_EXT)
  15. endif
  16. # ---------------------------------------------------------------------------------------------------------------------
  17. BUILD_CXX_FLAGS += $(FLUIDSYNTH_FLAGS)
  18. ifneq ($(HAIKU),true)
  19. ifneq ($(WASM),true)
  20. BUILD_CXX_FLAGS += -pthread
  21. endif
  22. endif
  23. # ---------------------------------------------------------------------------------------------------------------------
  24. STANDALONE_LIBS = $(MODULEDIR)/carla_engine.a
  25. STANDALONE_LIBS += $(MODULEDIR)/carla_plugin.a
  26. STANDALONE_LIBS += $(MODULEDIR)/jackbridge.a
  27. STANDALONE_LIBS += $(MODULEDIR)/audio_decoder.a
  28. STANDALONE_LIBS += $(MODULEDIR)/lilv.a
  29. STANDALONE_LIBS += $(MODULEDIR)/native-plugins.a
  30. STANDALONE_LIBS += $(MODULEDIR)/rtmempool.a
  31. STANDALONE_LIBS += $(MODULEDIR)/sfzero.a
  32. STANDALONE_LIBS += $(MODULEDIR)/water.a
  33. STANDALONE_LIBS += $(MODULEDIR)/zita-resampler.a
  34. ifeq ($(HAVE_DGL),true)
  35. STANDALONE_LIBS += $(MODULEDIR)/dgl.a
  36. endif
  37. ifeq ($(HAVE_HYLIA),true)
  38. STANDALONE_LIBS += $(MODULEDIR)/hylia.a
  39. endif
  40. ifeq ($(HAVE_YSFX),true)
  41. STANDALONE_LIBS += $(MODULEDIR)/ysfx.a
  42. endif
  43. ifeq ($(USING_RTAUDIO),true)
  44. STANDALONE_LIBS += $(MODULEDIR)/rtaudio.a
  45. STANDALONE_LIBS += $(MODULEDIR)/rtmidi.a
  46. endif
  47. # ---------------------------------------------------------------------------------------------------------------------
  48. STANDALONE_LINK_FLAGS = $(HYLIA_LIBS)
  49. STANDALONE_LINK_FLAGS += $(JACKBRIDGE_LIBS)
  50. STANDALONE_LINK_FLAGS += $(LILV_LIBS)
  51. STANDALONE_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  52. STANDALONE_LINK_FLAGS += $(RTMEMPOOL_LIBS)
  53. STANDALONE_LINK_FLAGS += $(WATER_LIBS)
  54. STANDALONE_LINK_FLAGS += $(LIBLO_LIBS)
  55. STANDALONE_LINK_FLAGS += $(MAGIC_LIBS)
  56. STANDALONE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  57. STANDALONE_LINK_FLAGS += $(SDL_LIBS)
  58. STANDALONE_LINK_FLAGS += $(X11_LIBS)
  59. ifeq ($(HAVE_YSFX),true)
  60. STANDALONE_LINK_FLAGS += $(YSFX_GRAPHICS_LIBS)
  61. endif
  62. ifeq ($(USING_RTAUDIO),true)
  63. STANDALONE_LINK_FLAGS += $(RTAUDIO_LIBS)
  64. STANDALONE_LINK_FLAGS += $(RTMIDI_LIBS)
  65. endif
  66. ifeq ($(JACKBRIDGE_DIRECT),true)
  67. STANDALONE_LINK_FLAGS += $(JACK_LIBS)
  68. endif
  69. # ---------------------------------------------------------------------------------------------------------------------
  70. ifeq ($(WASM),true)
  71. STANDALONE_SHARED = -sMAIN_MODULE=1 -O3
  72. STANDALONE_SHARED += -sALLOW_MEMORY_GROWTH
  73. STANDALONE_SHARED += -sINITIAL_MEMORY=32Mb
  74. STANDALONE_SHARED += -sSTACK_SIZE=2MB
  75. STANDALONE_SHARED += -lidbfs.js
  76. STANDALONE_SHARED += -sEXPORTED_RUNTIME_METHODS=IDBFS,FS,cwrap
  77. STANDALONE_SHARED += -sMODULARIZE=1 -sEXPORT_NAME=CarlaStandalone
  78. STANDALONE_SHARED += -sENVIRONMENT=web
  79. STANDALONE_SHARED += -sEXPORTED_FUNCTIONS="['_malloc','_free']"
  80. STANDALONE_SHARED += -sEXPORTED_RUNTIME_METHODS="['lengthBytesUTF8','stringToUTF8','UTF8ToString']"
  81. # TESTING
  82. # STANDALONE_SHARED += --use-preload-cache
  83. # STANDALONE_SHARED += --use-preload-plugins
  84. # STANDALONE_SHARED += --preload-file=../frontend/web/resources@/resources
  85. else
  86. STANDALONE_SHARED = $(SHARED)
  87. endif
  88. # ---------------------------------------------------------------------------------------------------------------------
  89. all: $(TARGETS)
  90. ifneq ($(WASM),true)
  91. $(MAKE) -C utils
  92. endif
  93. static: $(OBJS_standalone)
  94. # ---------------------------------------------------------------------------------------------------------------------
  95. clean:
  96. rm -f $(OBJS_standalone) $(TARGETS)
  97. $(MAKE) clean -C engine
  98. $(MAKE) clean -C plugin
  99. $(MAKE) clean -C utils
  100. debug:
  101. $(MAKE) DEBUG=true
  102. doxygen: CarlaBackend.doxygen
  103. doxygen $^
  104. # ---------------------------------------------------------------------------------------------------------------------
  105. $(BINDIR)/libcarla_standalone2$(LIB_EXT): $(OBJS_standalone) $(STANDALONE_LIBS)
  106. -@mkdir -p $(BINDIR)
  107. @echo "Linking libcarla_standalone2$(LIB_EXT)"
  108. $(SILENT)$(CXX) $(OBJS_standalone) $(BUILD_CXX_FLAGS) $(LIBS_START) $(STANDALONE_LIBS) $(LIBS_END) $(LINK_FLAGS) $(STANDALONE_LINK_FLAGS) $(STANDALONE_SHARED) -o $@
  109. # ---------------------------------------------------------------------------------------------------------------------
  110. ifeq ($(MACOS),true)
  111. $(OBJDIR)/CarlaStandalone.cpp.o: CarlaStandalone.cpp
  112. -@mkdir -p $(OBJDIR)
  113. @echo "Compiling $<"
  114. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -ObjC++ -c -o $@
  115. endif
  116. $(OBJDIR)/%.cpp.o: %.cpp
  117. -@mkdir -p $(OBJDIR)
  118. @echo "Compiling $<"
  119. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  120. -include $(OBJS_standalone:%.o=%.d)
  121. # ---------------------------------------------------------------------------------------------------------------------