Advertisement
MichaelPetch

makefile so73482770

Aug 29th, 2022
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. all: bin/UmbrellaOS.img
  2.  
  3. clear:
  4. rm -rfv bin/*
  5. rm -rfv tmp/*
  6.  
  7. rebuild: clear bin/UmbrellaOS.img
  8.  
  9. bin/UmbrellaOS.img: bin/boot.bin bin/kernel.bin bin/zeros.bin
  10. cat $^ > $@
  11.  
  12. bin/boot.bin: src/boot/boot.asm
  13. nasm $< -f bin -o $@
  14.  
  15. bin/zeros.bin: src/boot/zeros.asm
  16. nasm $< -f bin -o $@
  17.  
  18. tmp/kernel_entry.o: src/kernel/kernel_entry.asm
  19. nasm $< -f elf64 -o $@
  20.  
  21. bin/kernel.bin: bin/kernel.elf
  22. x86_64-elf-objcopy -O binary $^ $@
  23.  
  24. bin/kernel.elf: tmp/kernel_entry.o tmp/kernel.o tmp/Terminal.o tmp/String.o tmp/Utils.o tmp/Memory.o
  25. x86_64-elf-ld -o $@ -T link.ld $^
  26. x86_64-elf-objdump -Dx $@ >kernel.dump
  27.  
  28. tmp/kernel.o: src/kernel/main.c
  29. x86_64-elf-gcc -ffreestanding -m64 -g -c $^ -o $@
  30.  
  31. tmp/Memory.o: src/kernel/Memory.c
  32. x86_64-elf-gcc -ffreestanding -m64 -g -c $^ -o $@
  33.  
  34. tmp/Terminal.o: src/kernel/Terminal.c
  35. x86_64-elf-gcc -ffreestanding -m64 -g -c $^ -o $@
  36.  
  37. tmp/String.o: src/kernel/String.c
  38. x86_64-elf-gcc -ffreestanding -m64 -g -c $^ -o $@
  39.  
  40. tmp/Utils.o: src/kernel/Utils.c
  41. x86_64-elf-gcc -ffreestanding -m64 -g -c $^ -o $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement