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.

Makefile.mk 6.1KB

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