]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | # |
63e6b9a0 | 2 | # Makefile for rescue (bootstrap) code |
1da177e4 | 3 | # |
3e41d652 MS |
4 | |
5 | CC = gcc-cris -mlinux $(LINUXINCLUDE) | |
546cc148 JN |
6 | ccflags-y += -O2 |
7 | asflags-y += -traditional | |
1da177e4 | 8 | LD = gcc-cris -mlinux -nostdlib |
546cc148 | 9 | ldflags-y += -T $(obj)/rescue.ld |
1da177e4 LT |
10 | OBJCOPY = objcopy-cris |
11 | OBJCOPYFLAGS = -O binary --remove-section=.bss | |
63e6b9a0 JN |
12 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o |
13 | OBJECT := $(obj)/head.o | |
1da177e4 | 14 | |
63e6b9a0 | 15 | targets := rescue.o rescue.bin |
1da177e4 | 16 | |
63e6b9a0 JN |
17 | $(obj)/rescue.o: $(OBJECT) FORCE |
18 | $(call if_changed,ld) | |
1da177e4 | 19 | |
63e6b9a0 JN |
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 | |
1da177e4 LT |
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 | |
63e6b9a0 | 29 | dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784 |
1da177e4 LT |
30 | rm tr.bin tmp2423 testrescue_tmp.bin |
31 | ||
63e6b9a0 JN |
32 | $(obj)/kimagerescue.bin: $(obj)/kimagerescue.o |
33 | $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin | |
1da177e4 LT |
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 | |
63e6b9a0 | 37 | dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784 |
1da177e4 | 38 | rm ktr.bin tmp2423 kimagerescue_tmp.bin |