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.

148 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)
  11. else
  12. BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore)
  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 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_JACK),true)
  28. LINK_FLAGS += $(shell pkg-config --libs jack)
  29. endif
  30. ifeq ($(HAVE_PULSEAUDIO),true)
  31. LINK_FLAGS += $(shell pkg-config --libs libpulse-simple)
  32. endif
  33. # --------------------------------------------------------------
  34. # Plugin
  35. ifeq ($(HAVE_FLUIDSYNTH),true)
  36. LINK_FLAGS += $(shell pkg-config --libs fluidsynth)
  37. endif
  38. ifeq ($(HAVE_LINUXSAMPLER),true)
  39. LINK_FLAGS += $(shell pkg-config --libs linuxsampler)
  40. endif
  41. # --------------------------------------------------------------
  42. # Native
  43. ifeq ($(WIN32),true)
  44. W32_LIBS = -lcomdlg32 -ldsound -lgdi32 -limm32 -lole32 -luuid -lwinmm -lwinspool -lws2_32
  45. ifeq ($(HAVE_LINUXSAMPLER),true)
  46. W32_LIBS += -lrpcrt4
  47. endif
  48. else
  49. DGL_LIBS = -lX11
  50. endif
  51. ifeq ($(HAVE_AF_DEPS),true)
  52. LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat libavutil sndfile)
  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. LINK_FLAGS += $(EXTRA_LIBS)
  67. # --------------------------------------------------------------
  68. LIBS = ../libcarla_engine.a
  69. LIBS += ../libcarla_plugin.a
  70. LIBS += ../libcarla_native.a
  71. LIBS += ../../libs/rtmempool.a
  72. LIBS += ../../libs/widgets.a
  73. LIBS += ../../libs/theme.a
  74. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  75. LIBS += ../../libs/lilv.a
  76. endif
  77. ifeq ($(HAVE_OPENGL),true)
  78. LIBS += ../../libs/dgl.a
  79. endif
  80. OBJS = \
  81. CarlaStandalone.cpp.o
  82. STATIC = ../libcarla_standalone.a
  83. ifeq ($(WIN32),true)
  84. SHARED = ../libcarla_standalone.dll
  85. else
  86. SHARED = ../libcarla_standalone.so
  87. endif
  88. # --------------------------------------------------------------
  89. all: $(SHARED)
  90. clean:
  91. rm -f $(OBJS) $(SHARED) $(STATIC)
  92. debug:
  93. $(MAKE) DEBUG=true
  94. # --------------------------------------------------------------
  95. %.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp
  96. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  97. $(STATIC): $(OBJS) $(LIBS)
  98. $(AR) rs $@ $^
  99. ../libcarla_standalone.dll: $(OBJS) $(LIBS)
  100. $(CXX) $^ -shared $(LINK_FLAGS) $(W32_LIBS) -Wl,--output-def,$@.def -o $@ && $(STRIP) $@
  101. ../libcarla_standalone.so: $(OBJS) $(LIBS)
  102. $(CXX) $^ -shared $(LINK_FLAGS) -o $@ && $(STRIP) $@
  103. # --------------------------------------------------------------
  104. ../libcarla_%.a:
  105. $(MAKE) -C ../$* $@
  106. ../../libs/%.a:
  107. $(MAKE) -C ../../libs/ $*.a