Linux-2.6.12-rc2
[safe/jmp/linux-2.6] / arch / cris / arch-v10 / boot / rescue / Makefile
1 #
2 # Makefile for rescue code
3 #
4 ifndef TOPDIR
5 TOPDIR = ../../../..
6 endif
7 CC = gcc-cris -mlinux -I $(TOPDIR)/include
8 CFLAGS = -O2
9 LD = gcc-cris -mlinux -nostdlib
10 OBJCOPY = objcopy-cris
11 OBJCOPYFLAGS = -O binary --remove-section=.bss
12
13 all: rescue.bin testrescue.bin kimagerescue.bin
14
15 rescue: rescue.bin
16         # do nothing
17
18 rescue.bin: head.o
19         $(LD) -T rescue.ld -o rescue.o head.o
20         $(OBJCOPY) $(OBJCOPYFLAGS) rescue.o rescue.bin
21         cp rescue.bin $(TOPDIR)
22
23 testrescue.bin: testrescue.o
24         $(OBJCOPY) $(OBJCOPYFLAGS) testrescue.o tr.bin
25 # Pad it to 784 bytes
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
30
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
38
39 head.o: head.S
40         $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
41
42 testrescue.o: testrescue.S
43         $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
44
45 kimagerescue.o: kimagerescue.S
46         $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
47
48 clean:
49         rm -f *.o *.bin
50
51 fastdep:
52
53 modules:
54
55 modules-install: