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.

185 lines
4.1KB

  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_QT4),true)
  10. BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui)
  11. else
  12. BUILD_CXX_FLAGS += $(shell pkg-config --cflags Qt5Core Qt5Widgets)
  13. endif
  14. # --------------------------------------------------------------
  15. # Common
  16. LINK_FLAGS += $(shell pkg-config --libs liblo)
  17. ifeq ($(HAVE_QT4),true)
  18. LINK_FLAGS += $(shell pkg-config --libs QtCore QtGui QtXml)
  19. else
  20. LINK_FLAGS += $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Xml Qt5Widgets)
  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. ifeq ($(MACOS),true)
  47. DGL_LIBS = -framework Cocoa
  48. else
  49. DGL_LIBS = -lX11
  50. endif
  51. endif
  52. ifeq ($(HAVE_AF_DEPS),true)
  53. LINK_FLAGS += $(shell pkg-config --libs sndfile)
  54. ifeq ($(HAVE_FFMPEG),true)
  55. LINK_FLAGS += $(shell pkg-config --libs libavcodec libavformat libavutil)
  56. endif
  57. endif
  58. ifeq ($(HAVE_MF_DEPS),true)
  59. LINK_FLAGS += $(shell pkg-config --libs smf)
  60. endif
  61. ifeq ($(HAVE_OPENGL),true)
  62. LINK_FLAGS += $(shell pkg-config --libs gl) $(DGL_LIBS)
  63. endif
  64. ifeq ($(HAVE_ZYN_DEPS),true)
  65. LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib)
  66. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  67. LINK_FLAGS += $(shell pkg-config --libs ntk ntk_images)
  68. endif
  69. endif
  70. EXTRA_LIBS = -ldl
  71. LINK_FLAGS += $(EXTRA_LIBS)
  72. ifneq ($(MACOS),true)
  73. EXTRA_LIBS += -lrt
  74. endif
  75. # --------------------------------------------------------------
  76. LIBS = ../libcarla_engine.a
  77. LIBS += ../libcarla_plugin.a
  78. LIBS += ../libcarla_native.a
  79. LIBS += ../../libs/rtmempool.a
  80. LIBS += ../../libs/theme.a
  81. LIBS += ../../libs/widgets.a
  82. ifeq ($(CARLA_PLUGIN_SUPPORT),true)
  83. LIBS += ../../libs/lilv.a
  84. endif
  85. ifeq ($(HAVE_OPENGL),true)
  86. LIBS += ../../libs/dgl.a
  87. endif
  88. OBJS = \
  89. CarlaStandalone.cpp.o
  90. ifeq ($(WIN32),true)
  91. TARGET = ../libcarla_standalone.dll
  92. else
  93. ifeq ($(MACOS),true)
  94. TARGET = ../libcarla_standalone.dylib
  95. else
  96. TARGET = ../libcarla_standalone.so
  97. endif
  98. endif
  99. # --------------------------------------------------------------
  100. all: $(TARGET)
  101. clean:
  102. rm -f $(OBJS) $(TARGET)
  103. debug:
  104. $(MAKE) DEBUG=true
  105. # --------------------------------------------------------------
  106. %.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp
  107. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  108. ../libcarla_standalone.dll: $(OBJS) $(LIBS)
  109. $(CXX) $^ -shared $(LINK_FLAGS) $(W32_LIBS) -Wl,--output-def,$@.def -o $@ && $(STRIP) $@
  110. ../libcarla_standalone.dylib: $(OBJS) $(LIBS)
  111. $(CXX) $^ -dynamiclib $(LINK_FLAGS) -framework CoreAudio -framework CoreMIDI -framework CoreFoundation -o $@
  112. ../libcarla_standalone.so: $(OBJS) $(LIBS)
  113. $(CXX) $^ -shared $(LINK_FLAGS) -o $@ && $(STRIP) $@
  114. # --------------------------------------------------------------
  115. ../libcarla_engine.a:
  116. $(MAKE) -C ../engine
  117. ../libcarla_plugin.a:
  118. $(MAKE) -C ../plugin
  119. ../libcarla_native.a:
  120. $(MAKE) -C ../native
  121. ../../libs/dgl.a:
  122. $(MAKE) -C ../../libs dgl
  123. ../../libs/lilv.a:
  124. $(MAKE) -C ../../libs lilv
  125. ../../libs/rtmempool.a:
  126. $(MAKE) -C ../../libs rtmempool
  127. ../../libs/theme.a:
  128. $(MAKE) -C ../../libs theme
  129. ../../libs/widgets.a:
  130. $(MAKE) -C ../../libs widgets
  131. .PHONY: ../libcarla_engine.a \
  132. ../libcarla_plugin.a \
  133. ../libcarla_native.a \
  134. ../../libs/dgl.a \
  135. ../../libs/lilv.a \
  136. ../../libs/rtmempool.a \
  137. ../../libs/theme.a \
  138. ../../libs/widgets.a