Files
XunilOS/kernel/GNUmakefile
T
csd4ni3l 2a73c3aeb4 Add a config.mk file where global variables can be modified, add aarch64
interrupts with IRQ and syscalls, make phys_to_virt checked, recreate
stack on aarch64, make serial console finally line wrap and have max
height correctly, add U64Buf for when i need number debug, rename mouse
and keyboard files to kmi and merge them, add non-working pl050 support
2026-05-16 23:43:13 +02:00

37 lines
862 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 := dev
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)
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