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.

146 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. LINK_FLAGS += $(EXTRA_LIBS)
  64. # --------------------------------------------------------------
  65. LIBS = ../libcarla_engine.a
  66. LIBS += ../libcarla_plugin.a
  67. LIBS += ../libcarla_native.a
  68. LIBS += ../../libs/rtmempool.a
  69. LIBS += ../../libs/widgets.a
  70. LIBS += ../../libs/theme.a
  71. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  72. LIBS += ../../libs/lilv.a
  73. endif
  74. ifeq ($(HAVE_OPENGL),true)
  75. LIBS += ../../libs/dgl.a
  76. endif
  77. OBJS = \
  78. CarlaStandalone.cpp.o
  79. ifeq ($(WIN32),true)
  80. TARGET = ../libcarla_standalone.dll
  81. else
  82. ifeq ($(MACOS),true)
  83. TARGET = ../libcarla_standalone.dylib
  84. else
  85. TARGET = ../libcarla_standalone.so
  86. endif
  87. endif
  88. # --------------------------------------------------------------
  89. all: $(TARGET)
  90. clean:
  91. rm -f $(OBJS) $(TARGET)
  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. ../libcarla_standalone.dll: $(OBJS) $(LIBS)
  98. $(CXX) $^ -shared $(LINK_FLAGS) $(W32_LIBS) -Wl,--output-def,$@.def -o $@ && $(STRIP) $@
  99. ../libcarla_standalone.dylib: $(OBJS) $(LIBS)
  100. $(CXX) $^ -dynamiclib $(LINK_FLAGS) -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