Makefile 663 B

1234567891011121314151617181920212223242526272829303132
  1. OBJS = boot/bootsect
  2. KOBJS = init/head.o
  3. KSRCS = init/head.S
  4. all: Makefile
  5. make -C boot/
  6. make -C init/
  7. make xnix.img
  8. kernel: $(KSRCS) boot/bootsect Makefile
  9. ld -b elf64-x86-64 -o kernel.o $(KOBJS) -T kernel.lds
  10. objcopy -I elf64-x86-64 -S -R ".comment" -R ".eh_frame" -O binary kernel.o kernel
  11. xnix.img: boot/bootsect $(KSRCS) Makefile kernel
  12. dd if=/dev/zero of=xnix.img bs=1024 count=1440
  13. dd if=boot/bootsect of=xnix.img conv=notrunc seek=0
  14. dd if=kernel of=xnix.img conv=notrunc bs=512 seek=2
  15. lines: Makefile
  16. wc -l `find ./ -name *.asm`
  17. clear: Makefile
  18. make -C boot/ clear
  19. make -C init/ clear
  20. rm boot/bootsect
  21. rm xnix.img kernel kernel.o