vap/Makefile

39 lines
817 B
Makefile

arch ?= ppc32
target ?= powerpc-unknown-linux-gnu
build_type ?= release
kernel ?= target/$(target)/$(build_type)/vap
linker_script := assembly/$(arch)/linker.ld
KERNEL_FLAGS ?= -Zbuild-std=core,alloc
final = build/$(target)/$(build_type)/vap
ifeq "$(arch)" "ppc32"
target := powerpc-unknown-linux-gnu
kernel := target/$(target)/$(build_type)/vap
linker_script := assembly/$(arch)/linker.ld
KERNEL_FLAGS :=
endif
ifeq "$(build_type)" "release"
KERNEL_FLAGS += --release
endif
.PHONY: all clean quick_invalidate
all: $(final)
clean:
@cargo clean
@rm -rf build
quick_invalidate:
@rm -rf build
@rm -rf $(kernel)
$(final): $(kernel)
@mkdir -p $(shell dirname $@)
@cp $(kernel) $(final)
$(kernel):
@RUST_TARGET_PATH="$(shell pwd)" VAP_ARCH="$(arch)" cross +nightly build --target $(target) $(KERNEL_FLAGS)