aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-06 08:32:19 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-06 08:32:19 +0200
commit76c95cff93a8c4832d6276f2f51055bc91e17535 (patch)
treebb673993086669728ef9d9ed3faebf74ca9e2800 /src/Makefile
parent3df156a9be38b2c9a1b34cbe5f7528af7edf9f09 (diff)
Improve Makefile
Diffstat (limited to 'src/Makefile')
-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