Makefile 936 B

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