2020-07-12 02:20:29 +02:00
|
|
|
-include .config
|
|
|
|
|
2017-01-05 22:07:20 +01:00
|
|
|
# Configuration
|
2022-08-24 15:39:33 +02:00
|
|
|
## Architecture to build Redox for (aarch64, i686, or x86_64)
|
2022-08-27 01:44:53 +02:00
|
|
|
ARCH?=x86_64
|
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
|
2022-08-26 19:26:05 +02:00
|
|
|
## Select filesystem config
|
2022-11-27 06:07:04 +01:00
|
|
|
FILESYSTEM_CONFIG?=config/$(ARCH)/$(CONFIG_NAME).toml
|
2022-10-17 16:02:13 +02:00
|
|
|
## Filesystem size in MB (default comes from filesystem_size in the FILESYSTEM_CONFIG)
|
|
|
|
FILESYSTEM_SIZE?=$(shell grep filesystem_size $(FILESYSTEM_CONFIG) | cut -d' ' -f3)
|
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
|
|
|
|
PODMAN_BUILD?=0
|
|
|
|
## 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
|
2022-07-26 21:01:08 +02:00
|
|
|
# TODO: get host arch automatically
|
|
|
|
HOST_ARCH=x86_64
|
2023-04-02 11:39:18 +02:00
|
|
|
HOST_CARGO=env -u RUSTUP_TOOLCHAIN cargo
|
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
|
2020-05-04 00:57:52 +02:00
|
|
|
export REDOX_MAKE=make
|
2019-03-17 02:50:08 +01:00
|
|
|
PREFIX_BINARY=0
|
2017-02-01 22:15:48 +01:00
|
|
|
VB_AUDIO=coreaudio
|
2019-03-17 02:50:08 +01:00
|
|
|
VBM=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage
|
2022-07-26 20:26:27 +02:00
|
|
|
HOST_TARGET ?= $(HOST_ARCH)-apple-darwin
|
2023-04-02 12:09:43 +02:00
|
|
|
ALLOC_FILE=truncate -s "$(FILESYSTEM_SIZE)m"
|
2020-05-03 02:45:15 +02:00
|
|
|
else ifeq ($(UNAME),FreeBSD)
|
2020-05-03 02:13:21 +02:00
|
|
|
FUMOUNT=sudo umount
|
|
|
|
export NPROC=sysctl -n hw.ncpu
|
2020-05-04 00:57:52 +02:00
|
|
|
export REDOX_MAKE=gmake
|
2020-05-03 02:13:21 +02:00
|
|
|
PREFIX_BINARY=0
|
|
|
|
VB_AUDIO=pulse # To check, will probaly be OSS on most setups
|
|
|
|
VBM=VBoxManage
|
2022-07-26 20:26:27 +02:00
|
|
|
HOST_TARGET ?= $(HOST_ARCH)-unknown-freebsd
|
2023-04-02 12:09:43 +02:00
|
|
|
ALLOC_FILE=fallocate --posix --length "$(FILESYSTEM_SIZE)MiB"
|
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
|
|
|
|
|
2017-02-01 22:15:48 +01:00
|
|
|
export NPROC=nproc
|
2020-05-04 00:57:52 +02:00
|
|
|
export REDOX_MAKE=make
|
2019-03-17 02:50:08 +01:00
|
|
|
VB_AUDIO=pulse
|
2017-02-01 22:15:48 +01:00
|
|
|
VBM=VBoxManage
|
2022-07-26 20:26:27 +02:00
|
|
|
HOST_TARGET ?= $(HOST_ARCH)-unknown-linux-gnu
|
2023-04-02 12:09:43 +02:00
|
|
|
ALLOC_FILE=fallocate --posix --length "$(FILESYSTEM_SIZE)MiB"
|
2017-02-01 22:15:48 +01:00
|
|
|
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
|
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
|
|
|
|
ifeq ($(REPO_BINARY),0)
|
|
|
|
INSTALLER+=--cookbook=cookbook
|
2022-11-10 20:06:24 +01:00
|
|
|
REPO_TAG=$(BUILD)/repo.tag
|
2023-03-10 08:30:33 +01:00
|
|
|
else
|
|
|
|
INSTALLER+=--cookbook=cookbook --cooking
|
|
|
|
REPO_TAG=$(BUILD)/repo.tag
|
2022-09-12 15:51:13 +02:00
|
|
|
endif
|
2019-03-17 02:50:08 +01:00
|
|
|
|
2023-03-06 21:41:45 +01:00
|
|
|
FSTOOLS_TAG=build/fstools.tag
|
|
|
|
|
2019-03-17 02:50:08 +01:00
|
|
|
## Cross compiler variables
|
2018-12-23 00:45:16 +01:00
|
|
|
AR=$(TARGET)-gcc-ar
|
2018-11-28 03:45:52 +01:00
|
|
|
AS=$(TARGET)-as
|
|
|
|
CC=$(TARGET)-gcc
|
|
|
|
CXX=$(TARGET)-g++
|
|
|
|
LD=$(TARGET)-ld
|
2018-12-23 00:45:16 +01:00
|
|
|
NM=$(TARGET)-gcc-nm
|
2018-11-28 03:45:52 +01:00
|
|
|
OBJCOPY=$(TARGET)-objcopy
|
|
|
|
OBJDUMP=$(TARGET)-objdump
|
2018-12-23 00:45:16 +01:00
|
|
|
RANLIB=$(TARGET)-gcc-ranlib
|
2018-11-28 03:45:52 +01:00
|
|
|
READELF=$(TARGET)-readelf
|
|
|
|
STRIP=$(TARGET)-strip
|
|
|
|
|
2019-03-17 02:50:08 +01:00
|
|
|
## Rust cross compile variables
|
2018-11-28 03:45:52 +01:00
|
|
|
export AR_$(subst -,_,$(TARGET))=$(TARGET)-ar
|
|
|
|
export CC_$(subst -,_,$(TARGET))=$(TARGET)-gcc
|
|
|
|
export CXX_$(subst -,_,$(TARGET))=$(TARGET)-g++
|
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
|