aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTianhao Wang <shrik3@mailbox.org>2024-04-16 18:23:45 +0200
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:13:40 +0200
commitf72b2b11b8603f8afdd0a2d0d16d51c64747c4ea (patch)
treee0309a11258e0809794be679a1fe432a9ef37ce0 /Makefile
parent425e3fd1fd97e50041d8272bf4bcc7c1107571a1 (diff)
re-organize code
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a7cade0..0e3f565 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,8 @@ BUILD = build
ARCH = x86_64
ASM = nasm
ASMOBJFORMAT = elf64
-LINKER_SCRIPT = ./src/arch/$(ARCH)/linker.ld
+LINKER_SCRIPT = ./compiler/$(ARCH)-linker.ld
+CARGO_XBUILD_TARGET = ./compiler/$(ARCH)-rustubs.json
CARGO_XBUILD_FLAGS =
# ---------- No need to edit below this line --------------
# ---------- If you have to, something is wrong -----------
@@ -61,13 +62,13 @@ $(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 $(ARCH)-rustubs.json $(CARGO_XBUILD_FLAG)
+ cargo xbuild --target $(CARGO_XBUILD_TARGET) $(CARGO_XBUILD_FLAG)
# need nasm
# TODO make this arch dependent
-startup.o: startup.s | $(BUILD)
+startup.o: boot/startup-$(ARCH).s | $(BUILD)
@if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
- nasm -f elf64 -o $(BUILD)/startup.o startup.s
+ nasm -f elf64 -o $(BUILD)/startup.o boot/startup-$(ARCH).s
.PHONY: $(BUILD)
$(BUILD):