redox/mk/ci.mk

45 lines
1.7 KiB
Makefile
Raw Normal View History

2022-10-11 17:12:33 +02:00
IMG_TAG?=$(shell git describe --tags)
IMG_SEPARATOR?=_
IMG_DIR?=build/img/$(ARCH)
2022-10-11 17:12:33 +02:00
# CI image target - build desktop, server and demo images
# To leave out the build tag, set both IMG_TAG and IMG_SEPARATOR to null
2022-10-11 17:12:33 +02:00
ci-img: FORCE
rm -rf $(IMG_DIR)
mkdir -p $(IMG_DIR)
$(MAKE) demo desktop server
cd $(IMG_DIR) && sha256sum -b * > SHA256SUM
# The name of the target must match the name of the filesystem config file
desktop server demo: FORCE
rm -f "$(BUILD)/harddrive.img" "$(BUILD)/livedisk.iso"
2022-10-11 17:12:33 +02:00
$(MAKE) REPO_BINARY=1 \
FILESYSTEM_CONFIG=config/$(ARCH)/$@.toml \
$(BUILD)/harddrive.img \
$(BUILD)/livedisk.iso
cp "$(BUILD)/harddrive.img" "$(IMG_DIR)/redox_$(@)$(IMG_SEPARATOR)$(IMG_TAG)_harddrive.img"
cp "$(BUILD)/livedisk.iso" "$(IMG_DIR)/redox_$(@)$(IMG_SEPARATOR)$(IMG_TAG)_livedisk.iso"
2022-10-11 17:12:33 +02:00
# CI packaging target
ci-pkg: prefix FORCE
$(HOST_CARGO) build --manifest-path cookbook/Cargo.toml --release
$(HOST_CARGO) build --manifest-path installer/Cargo.toml --release
export PATH="$(PREFIX_PATH):$$PATH" && \
2022-11-10 23:40:32 +01:00
PACKAGES="$$($(INSTALLER) --list-packages -c config/$(ARCH)/ci.toml)" && \
2022-10-11 17:12:33 +02:00
cd cookbook && \
./fetch.sh "$${PACKAGES}" && \
./repo.sh "$${PACKAGES}"
# CI toolchain
ci-toolchain: FORCE
$(MAKE) PREFIX_BINARY=0 \
"prefix/$(TARGET)/gcc-install.tar.gz" \
"prefix/$(TARGET)/relibc-install.tar.gz" \
"prefix/$(TARGET)/rust-install.tar.gz"
rm -rf "build/toolchain/$(TARGET)"
mkdir -p "build/toolchain/$(TARGET)"
cp "prefix/$(TARGET)/gcc-install.tar.gz" "build/toolchain/$(TARGET)/gcc-install.tar.gz"
cp "prefix/$(TARGET)/relibc-install.tar.gz" "build/toolchain/$(TARGET)/relibc-install.tar.gz"
cp "prefix/$(TARGET)/rust-install.tar.gz" "build/toolchain/$(TARGET)/rust-install.tar.gz"
cd "build/toolchain/$(TARGET)" && sha256sum -b * > SHA256SUM