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.

151 lines
3.4KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-standalone #
  3. # ----------------------------- #
  4. # Created by falkTX
  5. #
  6. include ../Makefile.mk
  7. # --------------------------------------------------------------
  8. BUILD_CXX_FLAGS += -I../../modules/theme
  9. BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo)
  10. # --------------------------------------------------------------
  11. # Common
  12. LINK_FLAGS += $(shell pkg-config --libs liblo)
  13. LINK_FLAGS += -lpthread
  14. # --------------------------------------------------------------
  15. # Engine
  16. ifeq ($(HAVE_ALSA),true)
  17. LINK_FLAGS += $(shell pkg-config --libs alsa)
  18. endif
  19. ifeq ($(HAVE_PULSEAUDIO),true)
  20. LINK_FLAGS += $(shell pkg-config --libs libpulse-simple)
  21. endif
  22. # --------------------------------------------------------------
  23. # Plugin
  24. ifeq ($(HAVE_FLUIDSYNTH),true)
  25. LINK_FLAGS += $(shell pkg-config --libs fluidsynth)
  26. endif
  27. ifeq ($(HAVE_LINUXSAMPLER),true)
  28. LINK_FLAGS += $(shell pkg-config --libs linuxsampler)
  29. endif
  30. # --------------------------------------------------------------
  31. # Native
  32. ifeq ($(WIN32),true)
  33. W32_LIBS = -lcomdlg32 -ldsound -lgdi32 -limm32 -lole32 -luuid -lwinmm -lwinspool -lws2_32
  34. ifeq ($(HAVE_LINUXSAMPLER),true)
  35. W32_LIBS += -lrpcrt4
  36. endif
  37. else
  38. ifeq ($(MACOS),true)
  39. DGL_LIBS = -framework Cocoa
  40. else
  41. DGL_LIBS = -lX11
  42. endif
  43. endif
  44. ifeq ($(HAVE_AF_DEPS),true)
  45. LINK_FLAGS += $(shell pkg-config --libs sndfile)
  46. ifeq ($(HAVE_FFMPEG),true)
  47. LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat libavutil)
  48. endif
  49. endif
  50. ifeq ($(HAVE_MF_DEPS),true)
  51. LINK_FLAGS += $(shell pkg-config --libs smf)
  52. endif
  53. ifeq ($(HAVE_OPENGL),true)
  54. LINK_FLAGS += $(shell pkg-config --libs gl) $(DGL_LIBS)
  55. endif
  56. ifeq ($(HAVE_ZYN_DEPS),true)
  57. LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
  58. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  59. LINK_FLAGS += $(shell pkg-config --libs ntk ntk_images)
  60. endif
  61. endif
  62. EXTRA_LIBS = -ldl
  63. LINK_FLAGS += $(EXTRA_LIBS)
  64. ifneq ($(MACOS),true)
  65. EXTRA_LIBS += -lrt
  66. endif
  67. # --------------------------------------------------------------
  68. LIBS = ../libcarla_engine.a
  69. LIBS += ../libcarla_plugin.a
  70. LIBS += ../../modules/carla_native.a
  71. LIBS += ../../modules/juce_audio_basics.a
  72. LIBS += ../../modules/juce_core.a
  73. LIBS += ../../modules/rtmempool.a
  74. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  75. LIBS += ../../modules/lilv.a
  76. endif
  77. ifeq ($(HAVE_OPENGL),true)
  78. LIBS += ../../modules/dgl.a
  79. endif
  80. OBJS = \
  81. CarlaStandalone.cpp.o
  82. ifeq ($(WIN32),true)
  83. TARGET = ../libcarla_standalone.dll
  84. else
  85. ifeq ($(MACOS),true)
  86. TARGET = ../libcarla_standalone.dylib
  87. else
  88. TARGET = ../libcarla_standalone.so
  89. endif
  90. endif
  91. # --------------------------------------------------------------
  92. all: $(TARGET)
  93. clean:
  94. rm -f $(OBJS) $(TARGET)
  95. debug:
  96. $(MAKE) DEBUG=true
  97. # --------------------------------------------------------------
  98. %.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp ../CarlaHost.hpp
  99. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  100. ../libcarla_standalone.dll: $(OBJS) $(LIBS)
  101. $(CXX) $^ -shared $(LINK_FLAGS) $(W32_LIBS) -Wl,--output-def,$@.def -o $@
  102. ../libcarla_standalone.dylib: $(OBJS) $(LIBS)
  103. $(CXX) $^ -dynamiclib $(LINK_FLAGS) -framework CoreAudio -framework CoreMIDI -framework CoreFoundation -o $@
  104. ../libcarla_standalone.so: $(OBJS) $(LIBS)
  105. $(CXX) $^ $(LINK_FLAGS) -shared -o $@
  106. # --------------------------------------------------------------
  107. .FORCE:
  108. .PHONY: .FORCE
  109. ../libcarla_%.a: .FORCE
  110. $(MAKE) -C ../$*
  111. ../../modules/%.a: .FORCE
  112. $(MAKE) -C ../../modules $*