2 # Makefile for rescue code
6 HPATH = $(TOPDIR)/include
9 CC = gcc-cris -mlinux -I $(TOPDIR)/include
11 LD = gcc-cris -mlinux -nostdlib
12 OBJCOPY = objcopy-cris
14 all: rescue.bin testrescue.bin kimagerescue.bin
20 $(LD) -T rescue.ld -o rescue.o head.o
21 $(OBJCOPY) -O binary --remove-section=.bss rescue.o rescue.bin
22 cp rescue.bin $(TOPDIR)
24 testrescue.bin: testrescue.o
25 $(OBJCOPY) -O binary --remove-section=.bss 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=testrescue.bin bs=1 count=784
30 rm tr.bin tmp2423 testrescue_tmp.bin
32 kimagerescue.bin: kimagerescue.o
33 $(OBJCOPY) -O binary --remove-section=.bss 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=kimagerescue.bin bs=1 count=784
38 rm ktr.bin tmp2423 kimagerescue_tmp.bin
41 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
43 testrescue.o: testrescue.S
44 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
46 kimagerescue.o: kimagerescue.S
47 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
59 $(CC) -M *.S > .depend