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