2 # Makefile for rescue (bootstrap) code
5 CC
= gcc-cris
-mlinux
$(LINUXINCLUDE
)
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
15 targets
:= rescue.o rescue.bin
17 $(obj
)/rescue.o
: $(OBJECT
) FORCE
20 $(obj
)/rescue.bin
: $(obj
)/rescue.o FORCE
21 $(call if_changed
,objcopy
)
22 cp
-p
$(obj
)/rescue.bin
$(objtree
)
24 $(obj
)/testrescue.bin
: $(obj
)/testrescue.o
25 $(OBJCOPY
) $(OBJCOPYFLAGS
) $(obj
)/testrescue.o tr.bin
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
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