2024-07-09 14:58:07 +02:00
|
|
|
# Configuration file of the build system environment variables
|
|
|
|
|
2020-07-12 02:20:29 +02:00
|
|
|
-include .config
|
|
|
|
|
2023-06-06 16:20:02 +02:00
|
|
|
HOST_ARCH?=$(shell uname -m)
|
|
|
|
|
2017-01-05 22:07:20 +01:00
|
|
|
# Configuration
|
2023-06-06 16:20:02 +02:00
|
|
|
## Architecture to build Redox for (aarch64, i686, or x86_64). Defaults to a host one
|
|
|
|
ARCH?=$(HOST_ARCH)
|
2023-12-17 03:16:42 +01:00
|
|
|
## Sub-device type for aarch64 if needed
|
|
|
|
BOARD?=
|
2022-09-12 15:51:13 +02:00
|
|
|
## Enable to use binary prefix (much faster)
|
2019-06-19 04:10:30 +02:00
|
|
|
PREFIX_BINARY?=1
|
2022-09-12 15:51:13 +02:00
|
|
|
## Enable to use binary packages (much faster)
|
|
|
|
REPO_BINARY?=0
|
2022-11-27 06:07:04 +01:00
|
|
|
## Name of the configuration to include in the image name e.g. desktop or server
|
|
|
|
CONFIG_NAME?=desktop
|
2024-01-03 20:15:30 +01:00
|
|
|
## Ignore errors when building the repo, attempt to build every package
|
|
|
|
## REPO_NONSTOP?=--nonstop
|
|
|
|
REPO_NONSTOP?=
|
2022-08-26 19:26:05 +02:00
|
|
|
## Select filesystem config
|
2023-12-17 03:16:42 +01:00
|
|
|
ifeq ($(BOARD),)
|
2022-11-27 06:07:04 +01:00
|
|
|
FILESYSTEM_CONFIG?=config/$(ARCH)/$(CONFIG_NAME).toml
|
2023-12-17 03:16:42 +01:00
|
|
|
else
|
|
|
|
FILESYSTEM_CONFIG?=config/$(ARCH)/$(BOARD)/$(CONFIG_NAME).toml
|
|
|
|
endif
|
2024-03-17 18:54:24 +01:00
|
|
|
HOST_CARGO=env -u RUSTUP_TOOLCHAIN -u CC -u TARGET cargo
|
2022-10-17 16:02:13 +02:00
|
|
|
## Filesystem size in MB (default comes from filesystem_size in the FILESYSTEM_CONFIG)
|
2024-08-18 01:59:37 +02:00
|
|
|
## FILESYSTEM_SIZE?=$(shell $(HOST_CARGO) run --release --manifest-path installer/Cargo.toml -- --filesystem-size -c $(FILESYSTEM_CONFIG))
|
2022-03-09 18:33:12 +01:00
|
|
|
## Flags to pass to redoxfs-mkfs. Add --encrypt to set up disk encryption
|
|
|
|
REDOXFS_MKFS_FLAGS?=
|
2022-11-12 00:23:08 +01:00
|
|
|
## Set to 1 to enable Podman build, any other value will disable it
|
2024-09-20 23:00:16 +02:00
|
|
|
PODMAN_BUILD?=1
|
2022-11-12 00:23:08 +01:00
|
|
|
## The containerfile to use for the Podman base image
|
|
|
|
CONTAINERFILE?=podman/redox-base-containerfile
|
2017-01-05 22:07:20 +01:00
|
|
|
|
2017-02-01 22:15:48 +01:00
|
|
|
# Per host variables
|
2024-01-08 19:24:14 +01:00
|
|
|
export NPROC=nproc
|
|
|
|
export REDOX_MAKE=make
|
2024-01-10 19:08:31 +01:00
|
|
|
HOST_TARGET := $(shell env -u RUSTUP_TOOLCHAIN rustc -vV | grep host | cut -d: -f2 | tr -d " ")
|
2024-05-06 19:35:23 +02:00
|
|
|
ifneq ($(HOST_TARGET),x86_64-unknown-linux-gnu)
|
|
|
|
# The binary prefix is only built for x86_64 Linux hosts
|
|
|
|
PREFIX_BINARY=0
|
|
|
|
endif
|
2017-02-01 22:15:48 +01:00
|
|
|
UNAME := $(shell uname)
|
|
|
|
ifeq ($(UNAME),Darwin)
|
2023-04-02 11:42:31 +02:00
|
|
|
FUMOUNT=umount
|
2017-02-01 22:15:48 +01:00
|
|
|
export NPROC=sysctl -n hw.ncpu
|
|
|
|
VB_AUDIO=coreaudio
|
2019-03-17 02:50:08 +01:00
|
|
|
VBM=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage
|
2020-05-03 02:45:15 +02:00
|
|
|
else ifeq ($(UNAME),FreeBSD)
|
2020-05-03 02:13:21 +02:00
|
|
|
FUMOUNT=sudo umount
|
2020-05-04 00:57:52 +02:00
|
|
|
export REDOX_MAKE=gmake
|
2024-01-08 19:24:14 +01:00
|
|
|
VB_AUDIO=pulse # To check, will probably be OSS on most setups
|
2020-05-03 02:13:21 +02:00
|
|
|
VBM=VBoxManage
|
2017-02-01 22:15:48 +01:00
|
|
|
else
|
2023-03-21 04:00:19 +01:00
|
|
|
# Detect which version of the fusermount binary is available.
|
|
|
|
ifneq (, $(shell which fusermount3))
|
|
|
|
FUMOUNT=fusermount3 -u
|
|
|
|
else
|
|
|
|
FUMOUNT=fusermount -u
|
|
|
|
endif
|
|
|
|
|
2019-03-17 02:50:08 +01:00
|
|
|
VB_AUDIO=pulse
|
2017-02-01 22:15:48 +01:00
|
|
|
VBM=VBoxManage
|
|
|
|
endif
|
|
|
|
|
2023-06-06 16:20:02 +02:00
|
|
|
ifneq ($(UNAME),Linux)
|
|
|
|
PREFIX_BINARY=0
|
|
|
|
endif
|
|
|
|
ifneq ($(HOST_ARCH),x86_64)
|
|
|
|
PREFIX_BINARY=0
|
|
|
|
endif
|
|
|
|
|
2017-01-05 22:07:20 +01:00
|
|
|
# Automatic variables
|
2019-03-17 02:50:08 +01:00
|
|
|
ROOT=$(CURDIR)
|
2019-06-07 23:59:45 +02:00
|
|
|
export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt
|
2017-01-05 22:07:20 +01:00
|
|
|
|
2019-03-17 02:50:08 +01:00
|
|
|
## Userspace variables
|
|
|
|
export TARGET=$(ARCH)-unknown-redox
|
2024-06-17 08:53:19 +02:00
|
|
|
ifeq ($(ARCH),riscv64gc)
|
|
|
|
export GNU_TARGET=riscv64-unknown-redox
|
|
|
|
else
|
|
|
|
export GNU_TARGET=$(TARGET)
|
|
|
|
endif
|
2022-11-12 09:18:14 +01:00
|
|
|
BUILD=build/$(ARCH)/$(CONFIG_NAME)
|
2022-09-12 15:51:13 +02:00
|
|
|
INSTALLER=installer/target/release/redox_installer
|
2024-08-18 01:59:37 +02:00
|
|
|
INSTALLER_OPTS=
|
|
|
|
LIST_PACKAGES=installer/target/release/list_packages
|
|
|
|
LIST_PACKAGES_OPTS=
|
2022-09-12 15:51:13 +02:00
|
|
|
ifeq ($(REPO_BINARY),0)
|
2024-08-18 01:59:37 +02:00
|
|
|
INSTALLER_OPTS+=--cookbook=cookbook
|
2023-03-10 08:30:33 +01:00
|
|
|
else
|
2024-08-18 01:59:37 +02:00
|
|
|
INSTALLER_OPTS+=--cookbook=cookbook --repo-binary
|
|
|
|
LIST_PACKAGES_OPTS+=--repo-binary
|
2022-09-12 15:51:13 +02:00
|
|
|
endif
|
2019-03-17 02:50:08 +01:00
|
|
|
|
2024-08-18 01:59:37 +02:00
|
|
|
REPO_TAG=$(BUILD)/repo.tag
|
2023-03-06 21:41:45 +01:00
|
|
|
FSTOOLS_TAG=build/fstools.tag
|
2023-12-14 13:06:52 +01:00
|
|
|
export BOARD
|
2023-03-06 21:41:45 +01:00
|
|
|
|
2019-03-17 02:50:08 +01:00
|
|
|
## Cross compiler variables
|
2024-06-17 08:53:19 +02:00
|
|
|
AR=$(GNU_TARGET)-gcc-ar
|
|
|
|
AS=$(GNU_TARGET)-as
|
|
|
|
CC=$(GNU_TARGET)-gcc
|
|
|
|
CXX=$(GNU_TARGET)-g++
|
|
|
|
LD=$(GNU_TARGET)-ld
|
|
|
|
NM=$(GNU_TARGET)-gcc-nm
|
|
|
|
OBJCOPY=$(GNU_TARGET)-objcopy
|
|
|
|
OBJDUMP=$(GNU_TARGET)-objdump
|
|
|
|
RANLIB=$(GNU_TARGET)-gcc-ranlib
|
|
|
|
READELF=$(GNU_TARGET)-readelf
|
|
|
|
STRIP=$(GNU_TARGET)-strip
|
2018-11-28 03:45:52 +01:00
|
|
|
|
2019-03-17 02:50:08 +01:00
|
|
|
## Rust cross compile variables
|
2024-06-17 08:53:19 +02:00
|
|
|
export AR_$(subst -,_,$(TARGET)):=$(AR)
|
|
|
|
export CC_$(subst -,_,$(TARGET)):=$(CC)
|
|
|
|
export CXX_$(subst -,_,$(TARGET)):=$(CXX)
|
2022-11-12 00:23:08 +01:00
|
|
|
|
|
|
|
## If Podman is being used, a container is required
|
|
|
|
ifeq ($(PODMAN_BUILD),1)
|
|
|
|
CONTAINER_TAG=build/container.tag
|
|
|
|
else
|
|
|
|
CONTAINER_TAG=
|
|
|
|
endif
|