-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (58 loc) · 1.79 KB
/
Copy pathMakefile
File metadata and controls
69 lines (58 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
TARGET := x86_64-annwyn-user
TARGET_JSON := ./x86_64-annwyn-user.json
BUILD_DIR:= target/$(TARGET)/release
ABO_BUILDER := ../ABO-builder/target/release/ABO-builder
ELF_OUT := $(BUILD_DIR)/init
ABO_OUT := $(BUILD_DIR)/init.abo
MANIFEST := init.manifest
CARGO_FLAGS := \
--target $(TARGET_JSON) \
-Z build-std=core \
-Z build-std-features=compiler-builtins-mem \
-Z json-target-spec
.PHONY: all build abo check clean install-deps help
all: abo
build:
@echo "==> Compiling init..."
cargo build --release $(CARGO_FLAGS)
@echo "==> ELF: $$(wc -c < $(ELF_OUT)) bytes"
abo: build
@echo "==> Converting ELF to ABO..."
@$(ABO_BUILDER) \
$(ELF_OUT) \
$(ABO_OUT) \
--manifest $(MANIFEST)
@echo "==> ABO ready: $(ABO_OUT) ($$(wc -c < $(ABO_OUT)) bytes)"
check: abo
@echo "==> Checking ABO..."
@$(ABO_BUILDER) --check $(ABO_OUT)
@$(ABO_BUILDER) --dump $(ABO_OUT)
install: abo
@KERNEL_DIR=$${ANNWYN_KERNEL_DIR:-../muKernel}; \
DEST=$$KERNEL_DIR/src/assets; \
mkdir -p $$DEST; \
cp $(ABO_OUT) $$DEST/init.abo; \
echo "==> Installed to $$DEST/init.abo"
build-tools:
@echo "==> Building abo-builder..."
cargo build --release \
--manifest-path ../ABO-builder/Cargo.toml
@echo "==> abo-builder OK"
install-deps:
rustup component add rust-src llvm-tools-preview rustfmt
clean:
cargo clean
help:
@echo "aster-init build system"
@echo ""
@echo "Targets:"
@echo " all Build ELF + ABO (default)"
@echo " build Build ELF only"
@echo " abo Build ELF + convert to ABO"
@echo " check Build + validate ABO structure"
@echo " install Copy init.abo to kernel assets/"
@echo " build-tools Compile abo-builder"
@echo " clean Remove build artifacts"
@echo ""
@echo "Environment:"
@echo " ANNWYN_KERNEL_DIR Path to annwyn-kernel repo (default: ../muKernel)"