/asm/boot/gas/Makefile

http://github.com/dennis-gemini/tests · Makefile · 23 lines · 16 code · 6 blank · 1 comment · 0 complexity · 92594dd2cb493696c540c4afb1bd0107 MD5 · raw file

  1. CC=gcc
  2. LD=ld
  3. LDFILE=boot.ld
  4. OBJCOPY=objcopy
  5. all: boot.img
  6. boot.o: boot.S
  7. $(CC) -c boot.S -o $@
  8. boot.elf: boot.o
  9. $(LD) boot.o -o boot.elf -T$(LDFILE)
  10. # $(LD) boot.o -o boot.elf -Ttext 0x7c00
  11. boot.bin: boot.elf
  12. $(OBJCOPY) -R .pdr -R .comment -R .note -S -O binary boot.elf boot.bin
  13. boot.img: boot.bin
  14. dd if=boot.bin of=boot.img bs=512 count=1
  15. dd if=/dev/zero of=boot.img seek=1 bs=512 count=2879
  16. clean:
  17. rm -f boot.o boot.elf boot.bin boot.img bochsout.txt