redox/Makefile

106 lines
2.6 KiB
Makefile
Raw Normal View History

2017-01-05 22:07:20 +01:00
# Configuration and variables
include mk/config.mk
2016-09-10 03:08:04 +02:00
2020-06-07 05:29:53 +02:00
# Dependencies
include mk/depends.mk
2022-09-07 16:28:12 +02:00
all: build/harddrive.img
2022-09-07 16:28:12 +02:00
live: build/livedisk.iso
2022-08-27 01:47:07 +02:00
rebuild:
2022-09-12 15:51:13 +02:00
-$(FUMOUNT) build/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
2022-09-12 15:51:13 +02:00
rm -rf build
2022-08-27 01:47:07 +02:00
$(MAKE) all
2016-09-10 03:08:04 +02:00
clean:
cd cookbook && ./clean.sh
2017-06-18 23:59:43 +02:00
cargo clean --manifest-path cookbook/pkgutils/Cargo.toml
cargo clean --manifest-path installer/Cargo.toml
cargo clean --manifest-path redoxfs/Cargo.toml
2022-07-27 17:43:13 +02:00
cargo clean --manifest-path relibc/Cargo.toml
-$(FUMOUNT) build/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
2016-09-10 03:08:04 +02:00
rm -rf build
2016-11-02 15:32:14 +01:00
2018-01-01 23:56:56 +01:00
distclean:
$(MAKE) clean
2018-01-01 23:56:56 +01:00
cd cookbook && ./unfetch.sh
2016-12-14 17:49:05 +01:00
pull:
git pull --recurse-submodules
git submodule sync --recursive
2016-12-14 17:49:05 +01:00
git submodule update --recursive --init
2017-06-18 23:59:43 +02:00
2022-09-12 15:51:13 +02:00
fetch: build/fetch.tag
2016-12-14 17:49:05 +01:00
2022-09-12 15:51:13 +02:00
repo: build/repo.tag
2017-07-11 05:04:40 +02:00
2018-08-17 04:30:54 +02:00
# Cross compiler recipes
2018-08-18 02:47:48 +02:00
include mk/prefix.mk
2016-11-07 01:35:56 +01:00
2022-09-12 15:51:13 +02:00
# Repository maintenance
include mk/repo.mk
2022-02-08 01:13:28 +01:00
2017-01-05 22:07:20 +01:00
# Disk images
include mk/disk.mk
2018-08-17 04:30:54 +02:00
# Emulation recipes
include mk/qemu.mk
include mk/bochs.mk
include mk/virtualbox.mk
2018-06-10 17:54:05 +02:00
# CI image target
2022-09-07 16:28:12 +02:00
IMG_TAG?=$(shell git describe --tags)
2018-06-10 17:54:05 +02:00
ci-img: FORCE
2022-09-12 15:51:13 +02:00
$(MAKE) REPO_BINARY=1 \
2022-09-15 15:25:33 +02:00
build/harddrive.img \
build/livedisk.iso
2018-06-10 17:54:05 +02:00
rm -rf build/img
mkdir -p build/img
2022-09-15 15:25:33 +02:00
cp "build/harddrive.img" "build/img/redox_$(IMG_TAG)_harddrive.img"
cp "build/livedisk.iso" "build/img/redox_$(IMG_TAG)_livedisk.iso"
2018-06-10 17:54:05 +02:00
cd build/img && sha256sum -b * > SHA256SUM
# CI packaging target
2018-08-19 19:32:54 +02:00
ci-pkg: prefix FORCE
2022-09-12 15:51:13 +02:00
$(HOST_CARGO) build --manifest-path cookbook/Cargo.toml --release
$(HOST_CARGO) build --manifest-path installer/Cargo.toml --release
2018-08-19 19:32:54 +02:00
export PATH="$(PREFIX_PATH):$$PATH" && \
2022-09-12 15:51:13 +02:00
PACKAGES="$$($(INSTALLER) --list-packages -c ci.toml)" && \
2018-08-19 19:32:54 +02:00
cd cookbook && \
./fetch.sh "$${PACKAGES}" && \
./repo.sh "$${PACKAGES}"
# CI toolchain
2019-03-17 03:01:34 +01:00
ci-toolchain: FORCE
$(MAKE) PREFIX_BINARY=0 \
"prefix/$(TARGET)/gcc-install.tar.gz" \
2019-05-15 05:15:08 +02:00
"prefix/$(TARGET)/relibc-install.tar.gz" \
"prefix/$(TARGET)/rust-install.tar.gz"
rm -rf "build/toolchain/$(TARGET)"
mkdir -p "build/toolchain/$(TARGET)"
2019-03-17 03:01:34 +01:00
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"
2019-05-15 05:15:08 +02:00
cp "prefix/$(TARGET)/rust-install.tar.gz" "build/toolchain/$(TARGET)/rust-install.tar.gz"
cd "build/toolchain/$(TARGET)" && sha256sum -b * > SHA256SUM
env: prefix FORCE
export PATH="$(PREFIX_PATH):$$PATH" && \
bash
2020-04-18 22:25:53 +02:00
gdb: FORCE
2022-07-24 17:02:48 +02:00
gdb cookbook/recipes/kernel/build/kernel.sym --eval-command="target remote localhost:1234"
2020-04-18 22:25:53 +02:00
2017-01-10 05:54:38 +01:00
# An empty target
FORCE:
# Gzip any binary
%.gz: %
gzip -k -f $<
2017-01-10 05:54:38 +01:00
# Wireshark
wireshark: FORCE
wireshark build/network.pcap