From bb8ef9aca2bc862f697a9f4a83418103dd14136d Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Wed, 17 Apr 2024 11:14:46 +0200 Subject: makefile: fix cargo release build --- Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0e3f565..292a1a5 100644 --- a/Makefile +++ b/Makefile @@ -31,10 +31,8 @@ ASMOBJ_PREFIXED = $(addprefix $(BUILD)/,$(ASM_OBJECTS)) VPATH = $(sort $(dir $(ASM_SOURCES))) - -# the logic here is so cursed -ifeq (--release, $(findstring NT-5.1,$(CARGO_XBUILD_FLAGS))) - RUST_BUILD = release +ifneq ($(filter --release,$(CARGO_XBUILD_FLAGS)),) + RUST_BUILD = release else RUST_BUILD = debug endif @@ -62,7 +60,7 @@ $(BUILD)/_%.o : %.s | $(BUILD) # Compile the rust part: note that the the cargo crate is of type [staticlib], if you don't # define this, the linker will have troubles, especially when we use a "no_std" build rust_kernel: - cargo xbuild --target $(CARGO_XBUILD_TARGET) $(CARGO_XBUILD_FLAG) + cargo xbuild --target $(CARGO_XBUILD_TARGET) $(CARGO_XBUILD_FLAGS) # need nasm # TODO make this arch dependent -- cgit v1.2.3-70-g09d2