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.

147 lines
3.3KB

  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 libavcodec libavformat libavutil sndfile)
  50. endif
  51. ifeq ($(HAVE_MF_DEPS),true)
  52. LINK_FLAGS += $(shell pkg-config --libs smf)
  53. endif
  54. ifeq ($(HAVE_OPENGL),true)
  55. LINK_FLAGS += $(shell pkg-config --libs gl) $(DGL_LIBS)
  56. endif
  57. ifeq ($(HAVE_ZYN_DEPS),true)
  58. LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
  59. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  60. LINK_FLAGS += $(shell pkg-config --libs ntk ntk_images)
  61. endif
  62. endif
  63. EXTRA_LIBS = -ldl -lrt
  64. LINK_FLAGS += $(EXTRA_LIBS)
  65. # --------------------------------------------------------------
  66. LIBS = ../libcarla_engine.a
  67. LIBS += ../libcarla_plugin.a
  68. LIBS += ../libcarla_native.a
  69. LIBS += ../../libs/rtmempool.a
  70. LIBS += ../../libs/widgets.a
  71. LIBS += ../../libs/theme.a
  72. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  73. LIBS += ../../libs/lilv.a
  74. endif
  75. ifeq ($(HAVE_OPENGL),true)
  76. LIBS += ../../libs/dgl.a
  77. endif
  78. OBJS = \
  79. CarlaStandalone.cpp.o
  80. ifeq ($(WIN32),true)
  81. TARGET = ../libcarla_standalone.dll
  82. else
  83. ifeq ($(MACOS),true)
  84. TARGET = ../libcarla_standalone.dylib
  85. else
  86. TARGET = ../libcarla_standalone.so
  87. endif
  88. endif
  89. # --------------------------------------------------------------
  90. all: $(TARGET)
  91. clean:
  92. rm -f $(OBJS) $(TARGET)
  93. debug:
  94. $(MAKE) DEBUG=true
  95. # --------------------------------------------------------------
  96. %.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp
  97. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  98. ../libcarla_standalone.dll: $(OBJS) $(LIBS)
  99. $(CXX) $^ -shared $(LINK_FLAGS) $(W32_LIBS) -Wl,--output-def,$@.def -o $@ && $(STRIP) $@
  100. ../libcarla_standalone.dylib: $(OBJS) $(LIBS)
  101. $(CXX) $^ -dynamiclib $(LINK_FLAGS) -o $@ && $(STRIP) $@
  102. ../libcarla_standalone.so: $(OBJS) $(LIBS)
  103. $(CXX) $^ -shared $(LINK_FLAGS) -o $@ && $(STRIP) $@
  104. # --------------------------------------------------------------
  105. ../libcarla_%.a:
  106. $(MAKE) -C ../$* $@
  107. ../../libs/%.a:
  108. $(MAKE) -C ../../libs/ $*.a