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.

183 lines
6.2KB

  1. #!/usr/bin/make -f
  2. # Makefile for Carla C++ code #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. # --------------------------------------------------------------
  7. # Modify to enable/disable specific features
  8. # Support for LADSPA, DSSI, LV2, VST and AU plugins
  9. CARLA_PLUGIN_SUPPORT = true
  10. # Support for csound files (version 6)
  11. CARLA_CSOUND_SUPPORT = true
  12. # Support for GIG, SF2 and SFZ sample banks (through fluidsynth and linuxsampler)
  13. CARLA_SAMPLERS_SUPPORT = true
  14. # Use the free vestige header instead of the official VST SDK
  15. CARLA_VESTIGE_HEADER = true
  16. # --------------------------------------------------------------
  17. # DO NOT MODIFY PAST THIS POINT!
  18. AR ?= ar
  19. CC ?= gcc
  20. CXX ?= g++
  21. MOC ?= moc
  22. RCC ?= rcc
  23. UIC ?= uic
  24. # --------------------------------------------------------------
  25. # Fallback to Linux if no other OS defined
  26. ifneq ($(HAIKU),true)
  27. ifneq ($(MACOS),true)
  28. ifneq ($(WIN32),true)
  29. LINUX=true
  30. endif
  31. endif
  32. endif
  33. # --------------------------------------------------------------
  34. # Common build and link flags
  35. BASE_FLAGS = -Wall -Wextra -fPIC -DPIC -pipe -DREAL_BUILD
  36. BASE_OPTS = -O3 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fdata-sections -ffunction-sections
  37. LINK_OPTS = -Wl,--gc-sections
  38. ifeq ($(RASPPI),true)
  39. # Raspberry-Pi optimization flags
  40. BASE_OPTS = -O3 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
  41. LINK_OPTS =
  42. endif
  43. ifeq ($(DEBUG),true)
  44. BASE_FLAGS += -DDEBUG -O0 -g
  45. LINK_OPTS =
  46. else
  47. BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden
  48. CXXFLAGS += -fvisibility-inlines-hidden
  49. LINK_OPTS += -Wl,--strip-all
  50. endif
  51. 32BIT_FLAGS = -m32
  52. 64BIT_FLAGS = -m64
  53. BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS)
  54. BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS)
  55. LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS)
  56. ifeq ($(MACOS),true)
  57. # No C++11 support; force 32bit per default
  58. BUILD_C_FLAGS = $(BASE_FLAGS) $(32BIT_FLAGS) -std=gnu99 $(CFLAGS)
  59. BUILD_CXX_FLAGS = $(BASE_FLAGS) $(32BIT_FLAGS) $(CXXFLAGS)
  60. LINK_FLAGS = $(32BIT_FLAGS) $(LDFLAGS)
  61. endif
  62. # --------------------------------------------------------------
  63. # Check for required libs
  64. ifneq ($(shell pkg-config --exists liblo && echo true),true)
  65. $(error liblo missing, cannot continue)
  66. endif
  67. ifeq ($(LINUX),true)
  68. ifneq ($(shell pkg-config --exists x11 && echo true),true)
  69. $(error X11 missing, cannot continue)
  70. endif
  71. ifneq ($(shell pkg-config --exists xinerama && echo true),true)
  72. $(error Xinerama missing, cannot continue)
  73. endif
  74. ifneq ($(shell pkg-config --exists xext && echo true),true)
  75. $(error Xext missing, cannot continue)
  76. endif
  77. ifneq ($(shell pkg-config --exists xcursor && echo true),true)
  78. $(error Xcursor missing, cannot continue)
  79. endif
  80. ifneq ($(shell pkg-config --exists freetype2 && echo true),true)
  81. $(error FreeType2 missing, cannot continue)
  82. endif
  83. endif
  84. # --------------------------------------------------------------
  85. # Check for optional libs (required by backend or bridges)
  86. HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && pkg-config --max-version=1.9 libavcodec && echo true)
  87. ifeq ($(LINUX),true)
  88. HAVE_ALSA = $(shell pkg-config --exists alsa && echo true)
  89. HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true)
  90. HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true)
  91. HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true)
  92. HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true)
  93. HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true)
  94. HAVE_OPENGL = $(shell pkg-config --exists gl && echo true)
  95. else
  96. HAVE_OPENGL = true
  97. endif
  98. ifeq ($(CARLA_SAMPLERS_SUPPORT),true)
  99. HAVE_FLUIDSYNTH = $(shell pkg-config --exists fluidsynth && echo true)
  100. HAVE_LINUXSAMPLER = $(shell pkg-config --exists linuxsampler && echo true)
  101. endif
  102. # --------------------------------------------------------------
  103. # Check for optional libs (required by internal plugins)
  104. HAVE_AF_DEPS = $(shell pkg-config --exists sndfile && echo true)
  105. HAVE_MF_DEPS = $(shell pkg-config --exists smf && echo true)
  106. HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml zlib && echo true)
  107. HAVE_ZYN_UI_DEPS = $(shell pkg-config --exists ntk ntk_images && echo true)
  108. # --------------------------------------------------------------
  109. # Set Juce flags
  110. ifeq ($(HAIKU),true)
  111. endif
  112. ifeq ($(LINUX),true)
  113. ifeq ($(HAVE_OPENGL),true)
  114. DGL_FLAGS = $(shell pkg-config --cflags gl x11)
  115. DGL_LIBS = $(shell pkg-config --libs gl x11)
  116. endif
  117. JUCE_CORE_LIBS = -lrt -ldl -lpthread
  118. JUCE_EVENTS_FLAGS = $(shell pkg-config --cflags x11)
  119. JUCE_EVENTS_LIBS = $(shell pkg-config --libs x11)
  120. JUCE_GRAPHICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext freetype2)
  121. JUCE_GRAPHICS_LIBS = $(shell pkg-config --libs x11 xinerama xext freetype2)
  122. JUCE_GUI_BASICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext xcursor)
  123. JUCE_GUI_BASICS_LIBS = $(shell pkg-config --libs x11 xinerama xext xcursor) -ldl
  124. endif
  125. ifeq ($(MACOS),true)
  126. DGL_LIBS = -framework OpenGL -framework Cocoa
  127. JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
  128. JUCE_AUDIO_DEVICES_LIBS = -framework CoreAudio -framework CoreMIDI -framework DiscRecording
  129. JUCE_AUDIO_FORMATS_LIBS = -framework CoreAudio -framework CoreMIDI -framework QuartzCore -framework AudioToolbox
  130. JUCE_CORE_LIBS = -framework Cocoa -framework IOKit
  131. JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
  132. JUCE_GUI_BASICS_LIBS = -framework Cocoa -framework Carbon -framework QuartzCore
  133. endif
  134. ifeq ($(WIN32),true)
  135. DGL_LIBS = -lopengl32 -lgdi32
  136. JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
  137. JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  138. JUCE_EVENTS_LIBS = -lole32
  139. JUCE_GRAPHICS_LIBS = -lgdi32
  140. JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
  141. endif
  142. # --------------------------------------------------------------
  143. # Set Qt4 tools
  144. ifeq ($(HAVE_QT4),true)
  145. MOC_QT4 ?= $(shell pkg-config --variable=moc_location QtCore)
  146. RCC_QT4 ?= $(shell pkg-config --variable=rcc_location QtCore)
  147. UIC_QT4 ?= $(shell pkg-config --variable=uic_location QtCore)
  148. endif
  149. # --------------------------------------------------------------