Files
XunilOS/kernel/GNUmakefile
T
csd4ni3l 56c5da0742 Improve aarch64 support by building everything for both archictectures,
remove incorrect timer frequency set, fix interrupt handler not
restoring stack ptr, handle both user and kernel aborts, remove aarch64
ps2 support, fix ELF code mapped as code making it unwritable, add
assets.rs to handle both arches automatically, make PS2 x86_64
compatible with linux keycodes, always try printing kernel panic to
serial
2026-05-22 22:18:42 +02:00

38 lines
903 B
Makefile

# Nuke built-in rules and variables.
MAKEFLAGS += -rR
.SUFFIXES:
include ../config.mk
ifeq ($(RUST_TARGET),)
override RUST_TARGET := $(KARCH)-unknown-none
ifeq ($(KARCH),riscv64)
override RUST_TARGET := riscv64gc-unknown-none-elf
endif
endif
ifeq ($(RUST_PROFILE),)
override RUST_PROFILE := release
endif
override RUST_PROFILE_SUBDIR := $(RUST_PROFILE)
ifeq ($(RUST_PROFILE),dev)
override RUST_PROFILE_SUBDIR := debug
endif
# Default target.
.PHONY: all
all:
RUSTFLAGS="-C relocation-model=static" cargo build --target $(RUST_TARGET) --profile $(RUST_PROFILE) --config profile.release.debug=true
cp target/$(RUST_TARGET)/$(RUST_PROFILE_SUBDIR)/$$(cd target/$(RUST_TARGET)/$(RUST_PROFILE_SUBDIR) && find -maxdepth 1 -perm -111 -type f) kernel
# Remove object files and the final executable.
.PHONY: clean
clean:
cargo clean
rm -rf kernel
.PHONY: distclean
distclean: clean