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.

163 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../../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 += ../libcarla_native.a
  81. LIBS += ../../libs/rtmempool.a
  82. LIBS += ../../libs/theme.a
  83. LIBS += ../../libs/widgets.a
  84. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  85. LIBS += ../../libs/lilv.a
  86. endif
  87. ifeq ($(HAVE_OPENGL),true)
  88. LIBS += ../../libs/dgl.a
  89. endif
  90. OBJS = \
  91. CarlaStandalone.cpp.o
  92. ifeq ($(WIN32),true)
  93. TARGET = ../libcarla_standalone.dll
  94. else
  95. ifeq ($(MACOS),true)
  96. TARGET = ../libcarla_standalone.dylib
  97. else
  98. TARGET = ../libcarla_standalone.so
  99. endif
  100. endif
  101. # --------------------------------------------------------------
  102. all: $(TARGET)
  103. clean:
  104. rm -f $(OBJS) $(TARGET)
  105. debug:
  106. $(MAKE) DEBUG=true
  107. # --------------------------------------------------------------
  108. %.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp ../CarlaStandalone.hpp
  109. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  110. ../libcarla_standalone.dll: $(OBJS) $(LIBS)
  111. $(CXX) $^ -shared $(LINK_FLAGS) $(W32_LIBS) -Wl,--output-def,$@.def -o $@ $(CMD_STRIP) $@
  112. ../libcarla_standalone.dylib: $(OBJS) $(LIBS)
  113. $(CXX) $^ -dynamiclib $(LINK_FLAGS) -framework CoreAudio -framework CoreMIDI -framework CoreFoundation -o $@ $(CMD_STRIP) $@
  114. ../libcarla_standalone.so: $(OBJS) $(LIBS)
  115. $(CXX) $^ -shared $(LINK_FLAGS) -o $@ $(CMD_STRIP) $@
  116. # --------------------------------------------------------------
  117. .FORCE:
  118. .PHONY: .FORCE
  119. ../libcarla_%.a: .FORCE
  120. $(MAKE) -C ../$*
  121. ../../libs/%.a: .FORCE
  122. $(MAKE) -C ../../libs $*