summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/makefile b/makefile
index 088a233..229b665 100644
--- a/makefile
+++ b/makefile
@@ -9,8 +9,13 @@ floppy: bootloader fs
bootloader: obj
nasm src/bootloader.asm -o obj/bootloader.bin
-kernel: fs
- gcc src/kernel/*.c -o out/fs/kernel.sys -ffreestanding -nostdlib -m32 -T src/kernel/link.ld
+kernel: obj fs
+ gcc src/kernel/*.c -o obj/kernel.elf -ffreestanding -nostdlib -m32 -fno-asynchronous-unwind-tables
+ ld obj/kernel.elf -o obj/kernel-stripped.elf -T src/kernel/link.ld -s --orphan-handling=discard -m elf_i386
+ objcopy obj/kernel-stripped.elf out/fs/kernel.sys -O binary
+
+clean:
+ rm -r obj out
fs: out
mkdir -p out/fs