@@ -4,8 +4,15 @@ | |||||
# Created by falkTX | # Created by falkTX | ||||
# | # | ||||
# -------------------------------------------------------------- | |||||
# Import base definitions | |||||
USE_NANOVG_FBO = true | |||||
include dpf/Makefile.base.mk | include dpf/Makefile.base.mk | ||||
# -------------------------------------------------------------- | |||||
# Build targets | |||||
all: cardinal carla deps dgl plugins gen resources | all: cardinal carla deps dgl plugins gen resources | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
@@ -13,7 +20,12 @@ all: cardinal carla deps dgl plugins gen resources | |||||
PREFIX ?= /usr/local | PREFIX ?= /usr/local | ||||
DESTDIR ?= | DESTDIR ?= | ||||
ifeq ($(BSD),true) | |||||
SYSDEPS ?= true | |||||
else | |||||
SYSDEPS ?= false | SYSDEPS ?= false | ||||
endif | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Carla config | # Carla config | ||||
@@ -9,12 +9,21 @@ DEP_PATH = $(abspath ../src/Rack/dep) | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Import base definitions | # Import base definitions | ||||
USE_NANOVG_FBO = true | |||||
include ../dpf/Makefile.base.mk | include ../dpf/Makefile.base.mk | ||||
# -------------------------------------------------------------- | |||||
# Build config | |||||
ifeq ($(BSD),true) | |||||
SYSDEPS ?= true | |||||
else | |||||
SYSDEPS ?= false | |||||
endif | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# custom build flags | # custom build flags | ||||
BASE_FLAGS += -DZSTDLIB_VISIBILITY= | |||||
BASE_FLAGS += -I../include | BASE_FLAGS += -I../include | ||||
BASE_FLAGS += -I../include/neon-compat | BASE_FLAGS += -I../include/neon-compat | ||||
@@ -24,6 +33,10 @@ BASE_FLAGS += -ffat-lto-objects | |||||
endif | endif | ||||
endif | endif | ||||
ifneq ($(SYSDEPS),true) | |||||
BASE_FLAGS += -DZSTDLIB_VISIBILITY= | |||||
endif | |||||
ifeq ($(WASM),true) | ifeq ($(WASM),true) | ||||
BASE_FLAGS += -msse -msse2 -msse3 -msimd128 | BASE_FLAGS += -msse -msse2 -msse3 -msimd128 | ||||
else | else | ||||
@@ -191,7 +204,7 @@ QUICKJS_MAKE_FLAGS += PROGS=libquickjs.a | |||||
ifeq ($(WITH_LTO),true) | ifeq ($(WITH_LTO),true) | ||||
QUICKJS_MAKE_FLAGS += CONFIG_LTO=y | QUICKJS_MAKE_FLAGS += CONFIG_LTO=y | ||||
else | else | ||||
QUICKJS_MAKE_FLAGS += CONFIG_LTO=n | |||||
QUICKJS_MAKE_FLAGS += CONFIG_LTO= | |||||
endif | endif | ||||
ifeq ($(WINDOWS),true) | ifeq ($(WINDOWS),true) | ||||
@@ -13,9 +13,10 @@ If you are building from a release tarball you do not need to care about git. | |||||
## Build options | ## Build options | ||||
Cardinal uses makefiles as build system. So you just got to run `make` within the Cardinal main directory. | |||||
Cardinal uses [GNU Make](https://www.gnu.org/software/make/) as build system. | |||||
So you just got to run `make` within the Cardinal main directory in order to build. | |||||
There are a few useful options you can pass as arguments when building. | |||||
There are a few useful options you can pass as arguments when building though. | |||||
Use them as `make SOMEOPTION=SOMEVALUE` syntax. You can specify as many options as you want. | Use them as `make SOMEOPTION=SOMEVALUE` syntax. You can specify as many options as you want. | ||||
Developer related options: | Developer related options: | ||||
@@ -27,6 +28,7 @@ Packaging related options: | |||||
* `DESTDIR=/path` typical extra install target path (if you are used to packaging, this does what you expect) | * `DESTDIR=/path` typical extra install target path (if you are used to packaging, this does what you expect) | ||||
* `PREFIX=/usr` prefix used for installation (note that it **must** be set during build time as well) | * `PREFIX=/usr` prefix used for installation (note that it **must** be set during build time as well) | ||||
* `NOOPT=true` do not automatically set well-known optimization flags | |||||
* `SKIP_STRIPPING=true` do not automatically strip the binaries | * `SKIP_STRIPPING=true` do not automatically strip the binaries | ||||
* `SYSDEPS=true` use jansson, libarchive, samplerate and speexdsp system libraries, instead of vendored | * `SYSDEPS=true` use jansson, libarchive, samplerate and speexdsp system libraries, instead of vendored | ||||
* `WITH_LTO=true` enable Link-Time-Optimization, which has performance benefits but significantly increases the build time | * `WITH_LTO=true` enable Link-Time-Optimization, which has performance benefits but significantly increases the build time | ||||
@@ -36,24 +38,22 @@ Advanced options: | |||||
* `HEADLESS=true` build headless version (without gui), useful for embed systems | * `HEADLESS=true` build headless version (without gui), useful for embed systems | ||||
* `STATIC_BUILD=true` skip building Cardinal core plugins that use local resources (e.g. audio file and plugin host) | * `STATIC_BUILD=true` skip building Cardinal core plugins that use local resources (e.g. audio file and plugin host) | ||||
The commonly used build environment flags such as `CC`, `CXX`, `CFLAGS`, etc are respected and used. | |||||
## FreeBSD | ## FreeBSD | ||||
Dependencies for using system libraries, that is, with `SYSDEPS=true`: | |||||
The use of vendored libraries doesn't work on FreeBSD, as such the `SYSDEPS=true` build option is automatically set. | |||||
This means some dependencies that are optional in other systems are required under FreeBSD. | |||||
``` | |||||
# common | |||||
sudo pkg install -A dbus libglvnd liblo libsndfile libX11 libXcursor libXext libXrandr | |||||
# system libraries | |||||
sudo pkg install -A libarchive libsamplerate jansson speexdsp | |||||
``` | |||||
The use of `gmake` instead of `make` is also required. | |||||
Dependencies for vendored libraries: | |||||
Dependencies for using system libraries: | |||||
``` | ``` | ||||
# common | # common | ||||
sudo pkg install -A dbus libglvnd liblo libsndfile libX11 libXcursor libXext libXrandr | sudo pkg install -A dbus libglvnd liblo libsndfile libX11 libXcursor libXext libXrandr | ||||
# nedeed by vendored libraries | |||||
sudo pkg install -A cmake | |||||
# system libraries | |||||
sudo pkg install -A libarchive libsamplerate jansson speexdsp | |||||
``` | ``` | ||||
## Linux | ## Linux | ||||
@@ -78,7 +78,7 @@ Dependencies for vendored libraries: | |||||
# common | # common | ||||
sudo pacman -S dbus libgl liblo libsndfile libx11 libxcursor libxext libxrandr | sudo pacman -S dbus libgl liblo libsndfile libx11 libxcursor libxext libxrandr | ||||
# nedeed by vendored libraries | # nedeed by vendored libraries | ||||
sudo pacman -S cmake | |||||
sudo pacman -S cmake wget | |||||
``` | ``` | ||||
### Debian | ### Debian | ||||
@@ -98,7 +98,7 @@ Dependencies for vendored libraries: | |||||
# common | # common | ||||
sudo apt install libdbus-1-dev libgl1-mesa-dev liblo-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev | sudo apt install libdbus-1-dev libgl1-mesa-dev liblo-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev | ||||
# nedeed by vendored libraries | # nedeed by vendored libraries | ||||
sudo apt install cmake | |||||
sudo apt install cmake wget | |||||
``` | ``` | ||||
## macOS | ## macOS | ||||
@@ -5,16 +5,19 @@ | |||||
# | # | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Build config | |||||
# Import base definitions | |||||
PREFIX ?= /usr/local | |||||
DESTDIR ?= | |||||
SYSDEPS ?= false | |||||
USE_NANOVG_FBO = true | |||||
include ../dpf/Makefile.base.mk | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Import base definitions | |||||
# Build config | |||||
include ../dpf/Makefile.base.mk | |||||
ifeq ($(BSD),true) | |||||
SYSDEPS ?= true | |||||
else | |||||
SYSDEPS ?= false | |||||
endif | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# List of drwav functions, used in several modules | # List of drwav functions, used in several modules | ||||
@@ -734,14 +737,15 @@ endif | |||||
ifeq ($(SYSDEPS),true) | ifeq ($(SYSDEPS),true) | ||||
BASE_FLAGS += -DCARDINAL_SYSDEPS | BASE_FLAGS += -DCARDINAL_SYSDEPS | ||||
BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp) | |||||
else | else | ||||
BASE_FLAGS += -DZSTDLIB_VISIBILITY= | BASE_FLAGS += -DZSTDLIB_VISIBILITY= | ||||
BASE_FLAGS += -I../src/Rack/dep/include | |||||
endif | endif | ||||
BASE_FLAGS += -I../src | BASE_FLAGS += -I../src | ||||
BASE_FLAGS += -I../src/Rack/include | BASE_FLAGS += -I../src/Rack/include | ||||
BASE_FLAGS += -I../src/Rack/include/dsp | BASE_FLAGS += -I../src/Rack/include/dsp | ||||
BASE_FLAGS += -I../src/Rack/dep/include | |||||
BASE_FLAGS += -I../src/Rack/dep/filesystem/include | BASE_FLAGS += -I../src/Rack/dep/filesystem/include | ||||
# # BASE_FLAGS += -I../src/Rack/dep/fuzzysearchdatabase/src | # # BASE_FLAGS += -I../src/Rack/dep/fuzzysearchdatabase/src | ||||
BASE_FLAGS += -I../src/Rack/dep/glfw/include | BASE_FLAGS += -I../src/Rack/dep/glfw/include | ||||
@@ -4,19 +4,21 @@ | |||||
# Created by falkTX | # Created by falkTX | ||||
# | # | ||||
# -------------------------------------------------------------- | |||||
# Build config | |||||
PREFIX ?= /usr/local | |||||
DESTDIR ?= | |||||
SYSDEPS ?= false | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Import base definitions | # Import base definitions | ||||
USE_NANOVG_FBO = true | USE_NANOVG_FBO = true | ||||
include ../dpf/Makefile.base.mk | include ../dpf/Makefile.base.mk | ||||
# -------------------------------------------------------------- | |||||
# Build config | |||||
ifeq ($(BSD),true) | |||||
SYSDEPS ?= true | |||||
else | |||||
SYSDEPS ?= false | |||||
endif | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Build setup | # Build setup | ||||
@@ -6,13 +6,6 @@ | |||||
# Must have NAME defined | # Must have NAME defined | ||||
# -------------------------------------------------------------- | |||||
# Build config | |||||
PREFIX ?= /usr/local | |||||
DESTDIR ?= | |||||
SYSDEPS ?= false | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Carla stuff | # Carla stuff | ||||
@@ -49,8 +42,20 @@ endif # STATIC_BUILD | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Import base definitions | # Import base definitions | ||||
USE_NANOVG_FBO = true | |||||
include ../../dpf/Makefile.base.mk | include ../../dpf/Makefile.base.mk | ||||
# -------------------------------------------------------------- | |||||
# Build config | |||||
PREFIX ?= /usr/local | |||||
ifeq ($(BSD),true) | |||||
SYSDEPS ?= true | |||||
else | |||||
SYSDEPS ?= false | |||||
endif | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Files to build (DPF stuff) | # Files to build (DPF stuff) | ||||