Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. OBJS = init/head.o init/main.o kernel/kernel.o kernel/rlib/rlib.o modules/modules.o
  2. BOOT_SRCS = boot/boot.asm boot/loader.asm
  3. BOOT_OBJS = boot/boot.bin boot/loader.bin
  4. all: Makefile
  5. make -C tools/
  6. make -C boot/
  7. make -C init/
  8. make -C modules/
  9. make -C kernel/
  10. make -C kernel/rlib
  11. make xnix.img
  12. make vmxnix
  13. kbinary: Makefile
  14. ld -b elf64-x86-64 -o kernel.o $(OBJS) -T kernel.lds
  15. objcopy -I elf64-x86-64 -S -R ".comment" -R ".eh_frame" -O binary kernel.o kbinary
  16. vmxnix: Makefile
  17. ld -b elf64-x86-64 $(OBJS) -e init -T kernel.lds -o vmxnix
  18. xnix.img: Makefile kbinary tools/initcfs tools/mkfs
  19. dd if=/dev/zero of=xnix.img bs=1048576 count=64
  20. tools/mkfs xnix.img
  21. tools/initcfs xnix.img boot/boot.bin boot/loader.bin kbinary
  22. lines:
  23. wc -l `find ./ -name *.asm -o -name *.c -o -name *.h -o -name *.S -o -name *.s`
  24. files:
  25. find ./ -name *.asm -o -name *.c -o -name *.h -o -name *.S -o -name *.s | wc -l
  26. clear:
  27. make -C boot/ clear
  28. make -C init/ clear
  29. make -C kernel/ clear
  30. make -C kernel/rlib clear
  31. make -C tools/ clear
  32. rm xnix.img kbinary kernel.o vmxnix
  33. make -C modules/ clear