Makefile 956 B

123456789101112131415161718192021222324252627282930313233343536
  1. # this is calling from the /evx/arch/x86/Makefile and we need to
  2. # compile these assembly codes those there isn't a rule to compile
  3. # it.
  4. # 's' is the asm object
  5. BITS = 32
  6. obj-s = boot$(BITS).S.o.bin setup$(BITS).S.o.bin
  7. all: Image
  8. %.S.o: %.S
  9. @$(CPP) $*.S | $(AS) --32 -o $*.S.o.l
  10. @echo "AS $*.S.o.l"
  11. @$(LD) $*.S.o.l -o $*.S.o -T boot.lds
  12. @rm $*.S.o.l
  13. @echo "LD $*.S.o"
  14. %.S.o.bin: %.S.o
  15. @objcopy -S -j .text -O binary $*.S.o $*.S.o.bin
  16. @rm $*.S.o
  17. @echo "OBJCOPY $*.S.o.bin"
  18. Image: $(obj-s)
  19. @dd if=/dev/zero of=Image bs=1048576 count=64 >& /dev/zero
  20. @dd if=boot$(BITS).S.o.bin of=Image conv=notrunc >& /dev/zero
  21. @dd if=setup$(BITS).S.o.bin of=Image conv=notrunc bs=512 seek=1 >& /dev/zero
  22. @dd if=$(PWD)/arch/x86/vmevx.bin of=Image conv=notrunc bs=512 seek=2 >& /dev/zero
  23. @rm *.bin
  24. @echo "MKIMG Image"
  25. .PHONY clean:
  26. @rm Image -f
  27. @echo "CLEAN Image"