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.

150 lines
3.5KB

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