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.

164 lines
3.7KB

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