Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #
  2. # Makefile for rescue (bootstrap) code
  3. #
  4. CC = gcc-cris -mlinux $(LINUXINCLUDE)
  5. EXTRA_CFLAGS = -O2
  6. AFLAGS = -traditional
  7. LD = gcc-cris -mlinux -nostdlib
  8. LDFLAGS = -T $(obj)/rescue.ld
  9. OBJCOPY = objcopy-cris
  10. OBJCOPYFLAGS = -O binary --remove-section=.bss
  11. obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
  12. OBJECT := $(obj)/head.o
  13. targets := rescue.o rescue.bin
  14. $(obj)/rescue.o: $(OBJECT) FORCE
  15. $(call if_changed,ld)
  16. $(obj)/rescue.bin: $(obj)/rescue.o FORCE
  17. $(call if_changed,objcopy)
  18. cp -p $(obj)/rescue.bin $(objtree)
  19. $(obj)/testrescue.bin: $(obj)/testrescue.o
  20. $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/testrescue.o tr.bin
  21. # Pad it to 784 bytes
  22. dd if=/dev/zero of=tmp2423 bs=1 count=784
  23. cat tr.bin tmp2423 >testrescue_tmp.bin
  24. dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784
  25. rm tr.bin tmp2423 testrescue_tmp.bin
  26. $(obj)/kimagerescue.bin: $(obj)/kimagerescue.o
  27. $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin
  28. # Pad it to 784 bytes, that's what the rescue loader expects
  29. dd if=/dev/zero of=tmp2423 bs=1 count=784
  30. cat ktr.bin tmp2423 >kimagerescue_tmp.bin
  31. dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784
  32. rm ktr.bin tmp2423 kimagerescue_tmp.bin