aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index 4fa31a1..f55cad5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,12 +1,16 @@
EXEC := bringelle
CC := gcc -c -m32 -fno-pie -fno-builtin -fno-stack-protector
-BOOT_OBJ := $(addsuffix .o,$(basename $(shell find ./boot -name "*.[c|S]")))
+# Note that BOOT_OBJ do not match boot.S
+# Indeed boot.o generated by boot.S should appear
+# first in the kernel binary (thus it must be linked first, cf the $(EXEC) rule)
+BOOT_OBJ := $(addsuffix .o,$(basename $(shell find ./boot -name "*.[c|S]" ! -name "boot.S")))
UTILS_OBJ := $(addsuffix .o,$(basename $(shell find ./utils -name "*.[c|S]")))
all: $(EXEC)
-$(EXEC): $(BOOT_OBJ) $(UTILS_OBJ) bringelle.o
+$(EXEC): boot/boot.o $(UTILS_OBJ) bringelle.o
+ echo "Boot obj:" $(BOOT_OBJ)
ld -Ttext=0x00100000 -melf_i386 -nostdlib --oformat=binary -o bringelle $^
%.o: %.S