diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-06 08:32:19 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-06 08:32:19 +0200 |
| commit | 76c95cff93a8c4832d6276f2f51055bc91e17535 (patch) | |
| tree | bb673993086669728ef9d9ed3faebf74ca9e2800 | |
| parent | 3df156a9be38b2c9a1b34cbe5f7528af7edf9f09 (diff) | |
Improve Makefile
| -rw-r--r-- | src/Makefile | 8 |
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 |
