diff options
author | Joursoir <chat@joursoir.net> | 2022-10-04 03:47:06 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2022-10-12 23:39:53 +0300 |
commit | 9571b94360e0e12b5347ccfdd0358489dd925063 (patch) | |
tree | 4eba3399fa66f8bc2dc86ce124052018fed31e77 /Makefile | |
parent | 722c11898d06f9f4050a2c80c6bfb574f01efe3f (diff) | |
download | mfsos-9571b94360e0e12b5347ccfdd0358489dd925063.tar.gz mfsos-9571b94360e0e12b5347ccfdd0358489dd925063.tar.bz2 mfsos-9571b94360e0e12b5347ccfdd0358489dd925063.zip |
makefile: use script instead of passing options to the linker
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -22,6 +22,7 @@ LD = $(TARGET_TOOLS)ld AS = $(TARGET_TOOLS)as OBJDUMP = $(TARGET_TOOLS)objdump +KERN_HEAD = $(ARCH_BOOT)/head.o C_SOURCES = \ kernel/main.c \ kernel/string.c \ @@ -39,18 +40,15 @@ $(OSBIN): $(OS_BINARIES) cat $^ > $@ dd if=/dev/zero bs=512 count=128 >> $@ # 65536 -$(BOOTBIN): +$(BOOTBIN) $(KERN_HEAD): $(MAKE) -C $(ARCH_BOOT) -$(KERNBIN): $(ARCH_BOOT)/head.o $(OBJECTS) - $(CC) -Wl,--oformat binary -Ttext 0x1000 -o $@ \ +$(KERNBIN): $(KERN_HEAD) $(OBJECTS) + $(CC) -T $(ARCH_BOOT)/linker.ld -o $@ \ -ffreestanding -nostdlib \ $^ -lgcc printf "Kernel size: 0x%x\n" `stat -c "%s" $@` -%.o: %.s - $(AS) $< -o $@ - %.o: %.c $(CC) -std=gnu89 -Wall -ffreestanding -nostdlib \ -I arch/$(ARCH)/include \ @@ -70,5 +68,4 @@ objdump-kernel: $(KERNBIN) clean: $(MAKE) -C $(ARCH_BOOT) clean - rm -rf $(ARCH_BOOT)/head.o kernel/main.o - rm -rf $(KERNBIN) $(OSBIN) $(OBJECTS) + rm -f $(KERNBIN) $(OSBIN) $(OBJECTS) |