2 # Makefile for rescue code
7 CC
= gcc-cris
-mlinux
-I
$(TOPDIR
)/include
9 LD
= gcc-cris
-mlinux
-nostdlib
10 OBJCOPY
= objcopy-cris
11 OBJCOPYFLAGS
= -O binary
--remove-section
=.bss
13 all: rescue.bin testrescue.bin kimagerescue.bin
19 $(LD
) -T rescue.
ld -o rescue.o head.o
20 $(OBJCOPY
) $(OBJCOPYFLAGS
) rescue.o rescue.bin
21 cp rescue.bin
$(TOPDIR
)
23 testrescue.bin
: testrescue.o
24 $(OBJCOPY
) $(OBJCOPYFLAGS
) testrescue.o tr.bin
26 dd if
=/dev
/zero of
=tmp2423 bs
=1 count
=784
27 cat tr.bin tmp2423
>testrescue_tmp.bin
28 dd if
=testrescue_tmp.bin of
=testrescue.bin bs
=1 count
=784
29 rm tr.bin tmp2423 testrescue_tmp.bin
31 kimagerescue.bin
: kimagerescue.o
32 $(OBJCOPY
) $(OBJCOPYFLAGS
) kimagerescue.o ktr.bin
33 # Pad it to 784 bytes, that's what the rescue loader expects
34 dd if
=/dev
/zero of
=tmp2423 bs
=1 count
=784
35 cat ktr.bin tmp2423
>kimagerescue_tmp.bin
36 dd if
=kimagerescue_tmp.bin of
=kimagerescue.bin bs
=1 count
=784
37 rm ktr.bin tmp2423 kimagerescue_tmp.bin
40 $(CC
) -D__ASSEMBLY__
-traditional
-c
$< -o
$*.o
42 testrescue.o
: testrescue.S
43 $(CC
) -D__ASSEMBLY__
-traditional
-c
$< -o
$*.o
45 kimagerescue.o
: kimagerescue.S
46 $(CC
) -D__ASSEMBLY__
-traditional
-c
$< -o
$*.o