Makefile 1.1 KB

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