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