|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- #!/usr/bin/make -f
- # Makefile for Carla C++ code #
- # --------------------------- #
- # Created by falkTX
- #
-
- # --------------------------------------------------------------
- # Modify to enable/disable specific features
-
- # Support for LADSPA, DSSI, LV2, VST and AU plugins
- CARLA_PLUGIN_SUPPORT = true
-
- # Support for csound files (version 6)
- CARLA_CSOUND_SUPPORT = true
-
- # Support for GIG, SF2 and SFZ sample banks (through fluidsynth and linuxsampler)
- CARLA_SAMPLERS_SUPPORT = true
-
- # Use the free vestige header instead of the official VST SDK
- CARLA_VESTIGE_HEADER = true
-
- # --------------------------------------------------------------
- # DO NOT MODIFY PAST THIS POINT!
-
- AR ?= ar
- RM ?= rm -f
- CC ?= gcc
- CXX ?= g++
- MOC ?= moc
- RCC ?= rcc
- UIC ?= uic
-
- # --------------------------------------------------------------
- # Fallback to Linux if no other OS defined
-
- ifneq ($(HAIKU),true)
- ifneq ($(MACOS),true)
- ifneq ($(WIN32),true)
- LINUX=true
- endif
- endif
- endif
-
- # --------------------------------------------------------------
- # Common build and link flags
-
- BASE_FLAGS = -Wall -Wextra -fPIC -DPIC -pipe -DREAL_BUILD
- BASE_OPTS = -O3 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fdata-sections -ffunction-sections
- LINK_OPTS = -Wl,--gc-sections
-
- ifeq ($(RASPPI),true)
- # Raspberry-Pi optimization flags
- BASE_OPTS = -O3 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
- LINK_OPTS =
- endif
-
- ifeq ($(DEBUG),true)
- BASE_FLAGS += -DDEBUG -O0 -g
- LINK_OPTS =
- else
- BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden
- CXXFLAGS += -fvisibility-inlines-hidden
- LINK_OPTS += -Wl,--strip-all
- endif
-
- 32BIT_FLAGS = -m32
- 64BIT_FLAGS = -m64
-
- BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS)
- BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS)
- LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS)
-
- ifeq ($(MACOS),true)
- # No C++11 support; force 32bit per default
- BUILD_C_FLAGS = $(BASE_FLAGS) $(32BIT_FLAGS) -std=gnu99 $(CFLAGS)
- BUILD_CXX_FLAGS = $(BASE_FLAGS) $(32BIT_FLAGS) $(CXXFLAGS)
- LINK_FLAGS = $(32BIT_FLAGS) $(LDFLAGS)
- endif
-
- # --------------------------------------------------------------
- # Check for required libs
-
- # liblo always required
- ifneq ($(shell pkg-config --exists liblo && echo true),true)
- $(error liblo missing, cannot continue)
- endif
-
- # Qt always required
- # ifneq ($(shell pkg-config --exists QtCore QtGui QtXml && echo true),true)
- # $(error Qt4 missing, cannot continue)
- # endif
-
- # --------------------------------------------------------------
- # Check for optional libs (required by backend or bridges)
-
- HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && pkg-config --max-version=1.9 libavcodec && echo true)
-
- ifeq ($(LINUX),true)
- HAVE_ALSA = $(shell pkg-config --exists alsa && echo true)
- HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true)
- HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true)
- HAVE_OPENGL = $(shell pkg-config --exists gl && echo true)
- HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true)
- HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui QtXml && echo true)
- HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets Qt5Xml && echo true)
- else
- HAVE_OPENGL = true
- endif
-
- ifeq ($(CARLA_CSOUND_SUPPORT),true)
- # FIXME ?
- HAVE_CSOUND = $(shell pkg-config --exists sndfile && echo true)
- endif
-
- ifeq ($(CARLA_SAMPLERS_SUPPORT),true)
- HAVE_FLUIDSYNTH = $(shell pkg-config --exists fluidsynth && echo true)
- HAVE_LINUXSAMPLER = $(shell pkg-config --exists linuxsampler && echo true)
- endif
-
- # --------------------------------------------------------------
- # Check for optional libs (needed by internal plugins)
-
- HAVE_AF_DEPS = $(shell pkg-config --exists sndfile && echo true)
- HAVE_MF_DEPS = $(shell pkg-config --exists smf && echo true)
- HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml zlib && echo true)
- HAVE_ZYN_UI_DEPS = $(shell pkg-config --exists ntk_images ntk && echo true)
-
- # --------------------------------------------------------------
- # Check for juce support
-
- ifeq ($(HAIKU),true)
- HAVE_JUCE = false
- endif
-
- ifeq ($(LINUX),true)
- HAVE_JUCE = $(shell pkg-config --exists x11 xinerama xext xcursor freetype2 && echo true)
- endif
-
- ifeq ($(MACOS),true)
- HAVE_JUCE = true
- endif
-
- ifeq ($(WIN32),true)
- HAVE_JUCE = true
- endif
-
- # --------------------------------------------------------------
- # Set libs stuff
-
- RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY -D__UNIX_JACK__
-
- ifeq ($(DEBUG),true)
- RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
- RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
- endif
-
- RTMEMPOOL_LIBS = -lpthread
-
- ifeq ($(HAIKU),true)
- endif
-
- ifeq ($(LINUX),true)
- ifeq ($(HAVE_OPENGL),true)
- DGL_FLAGS = $(shell pkg-config --cflags gl x11)
- DGL_LIBS = $(shell pkg-config --libs gl x11)
- endif
- JACKBRIDGE_LIBS = -ldl -lpthread -lrt
- ifeq ($(HAVE_JUCE),true)
- JUCE_CORE_LIBS = -ldl -lpthread -lrt
- JUCE_EVENTS_FLAGS = $(shell pkg-config --cflags x11)
- JUCE_EVENTS_LIBS = $(shell pkg-config --libs x11)
- JUCE_GRAPHICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext freetype2)
- JUCE_GRAPHICS_LIBS = $(shell pkg-config --libs x11 xinerama xext freetype2)
- JUCE_GUI_BASICS_FLAGS = $(shell pkg-config --cflags x11 xinerama xext xcursor)
- JUCE_GUI_BASICS_LIBS = $(shell pkg-config --libs x11 xinerama xext xcursor) -ldl
- endif
- LILV_LIBS = -ldl -lm -lrt
- QTCORE_FLAGS = $(shell pkg-config --cflags QtCore)
- QTCORE_LIBS = $(shell pkg-config --libs QtCore)
- QTXML_FLAGS = $(shell pkg-config --cflags QtXml)
- QTXML_LIBS = $(shell pkg-config --libs QtXml)
- ifeq ($(HAVE_ALSA),true)
- RTAUDIO_FLAGS += $(shell pkg-config --cflags alsa) -D__LINUX_ALSA__
- RTAUDIO_LIBS += $(shell pkg-config --libs alsa) -lpthread
- RTMIDI_FLAGS += $(shell pkg-config --cflags alsa) -D__LINUX_ALSASEQ__
- RTMIDI_LIBS += $(shell pkg-config --libs alsa)
- endif
- ifeq ($(HAVE_PULSEAUDIO),true)
- RTAUDIO_FLAGS += $(shell pkg-config --cflags libpulse-simple) -D__LINUX_PULSE__
- RTAUDIO_LIBS += $(shell pkg-config --libs libpulse-simple)
- endif
- endif
-
- ifeq ($(MACOS),true)
- DGL_LIBS = -framework OpenGL -framework Cocoa
- JACKBRIDGE_LIBS = -ldl -lpthread
- JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
- JUCE_AUDIO_DEVICES_LIBS = -framework CoreAudio -framework CoreMIDI -framework DiscRecording
- JUCE_AUDIO_FORMATS_LIBS = -framework CoreAudio -framework CoreMIDI -framework QuartzCore -framework AudioToolbox
- JUCE_CORE_LIBS = -framework Cocoa -framework IOKit
- JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
- JUCE_GUI_BASICS_LIBS = -framework Cocoa -framework Carbon -framework QuartzCore
- LILV_LIBS = -ldl -lm
- QTCORE_LIBS = -framework QtCore
- QTXML_LIBS = -framework QtXml
- RTAUDIO_FLAGS += -D__MACOSX_CORE__
- RTAUDIO_LIBS += -lpthread
- RTMIDI_FLAGS += -D__MACOSX_CORE__
- endif
-
- ifeq ($(WIN32),true)
- DGL_LIBS = -lopengl32 -lgdi32
- JACKBRIDGE_LIBS = -lpthread
- JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
- JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
- JUCE_EVENTS_LIBS = -lole32
- JUCE_GRAPHICS_LIBS = -lgdi32
- JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
- LILV_LIBS = -lm
- QTCORE_FLAGS = $(shell pkg-config --cflags QtCore)
- QTCORE_LIBS = $(shell pkg-config --libs QtCore)
- QTXML_FLAGS = $(shell pkg-config --cflags QtXml)
- QTXML_LIBS = $(shell pkg-config --libs QtXml)
- RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__
- RTAUDIO_LIBS += -lpthread
- RTMIDI_FLAGS += -D__WINDOWS_MM__
- endif
-
- # --------------------------------------------------------------
- # Set Qt4 tools
-
- ifeq ($(HAVE_QT4),true)
- MOC_QT4 ?= $(shell pkg-config --variable=moc_location QtCore)
- RCC_QT4 ?= $(shell pkg-config --variable=rcc_location QtCore)
- UIC_QT4 ?= $(shell pkg-config --variable=uic_location QtCore)
- endif
-
- # --------------------------------------------------------------
|