Makefile 946 B

1234567891011121314151617181920212223242526272829303132333435
  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. obj-s = boot$(BITS).S.o.bin setup$(BITS).S.o.bin
  6. all: Image
  7. %.S.o: %.S
  8. @$(CPP) $*.S | $(AS) --32 -o $*.S.o.l
  9. @echo "AS $*.S.o.l"
  10. @$(LD) $*.S.o.l -o $*.S.o -T boot.lds
  11. @rm $*.S.o.l
  12. @echo "LD $*.S.o"
  13. %.S.o.bin: %.S.o
  14. @objcopy -S -j .text -O binary $*.S.o $*.S.o.bin
  15. @rm $*.S.o
  16. @echo "OBJCOPY $*.S.o.bin"
  17. Image: $(obj-s)
  18. @dd if=/dev/zero of=Image bs=1048576 count=64 >& /dev/zero
  19. @dd if=boot$(BITS).S.o.bin of=Image conv=notrunc >& /dev/zero
  20. @dd if=setup$(BITS).S.o.bin of=Image conv=notrunc bs=512 seek=1 >& /dev/zero
  21. @dd if=$(PWD)/arch/x86/vmevx.bin of=Image conv=notrunc bs=512 seek=2 >& /dev/zero
  22. @rm *.bin
  23. @echo "MKIMG Image"
  24. .PHONY clean:
  25. @rm Image -f
  26. @echo "CLEAN Image"