Advertisement
MichaelPetch

Makefile so71730846-a

Apr 3rd, 2022
3,943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.43 KB | None | 0 0
  1. all: os-image
  2.  
  3. os-image: boot_sect.bin kernel.bin
  4.     cat $^ > os-image
  5.  
  6. kernel.bin: kernel.elf
  7.     objcopy -O binary $< $@
  8.  
  9. kernel.elf: kernel_entry.o kernel.o
  10.     ld -melf_i386 -o $@ -Ttext 0x1000 $^
  11.  
  12. kernel.o : kernel.c
  13.     gcc -fno-pie -ffreestanding -m32 -c $< -o $@
  14.  
  15. kernel_entry.o : kernel_entry.asm
  16.     nasm $< -f elf -o $@
  17.  
  18. boot_sect.bin : boot_sect.asm
  19.     nasm $< -f bin -o $@
  20.  
  21. clean:
  22.     rm -fr *.bin *.o os-image *.map *.elf
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement