diff options
Diffstat (limited to 'arch/cris/arch-v10/boot/rescue/Makefile')
-rw-r--r-- | arch/cris/arch-v10/boot/rescue/Makefile | 56 |
1 files changed, 19 insertions, 37 deletions
diff --git a/arch/cris/arch-v10/boot/rescue/Makefile b/arch/cris/arch-v10/boot/rescue/Makefile index 8be9b3130312..2e5045b9e19c 100644 --- a/arch/cris/arch-v10/boot/rescue/Makefile +++ b/arch/cris/arch-v10/boot/rescue/Makefile | |||
@@ -1,56 +1,38 @@ | |||
1 | # | 1 | # |
2 | # Makefile for rescue code | 2 | # Makefile for rescue (bootstrap) code |
3 | # | 3 | # |
4 | target = $(target_rescue_dir) | ||
5 | src = $(src_rescue_dir) | ||
6 | 4 | ||
7 | CC = gcc-cris -mlinux $(LINUXINCLUDE) | 5 | CC = gcc-cris -mlinux $(LINUXINCLUDE) |
8 | CFLAGS = -O2 | 6 | ccflags-y += -O2 |
7 | asflags-y += -traditional | ||
9 | LD = gcc-cris -mlinux -nostdlib | 8 | LD = gcc-cris -mlinux -nostdlib |
9 | ldflags-y += -T $(obj)/rescue.ld | ||
10 | OBJCOPY = objcopy-cris | 10 | OBJCOPY = objcopy-cris |
11 | OBJCOPYFLAGS = -O binary --remove-section=.bss | 11 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
12 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o | ||
13 | OBJECT := $(obj)/head.o | ||
12 | 14 | ||
13 | all: $(target)/rescue.bin $(target)/testrescue.bin $(target)/kimagerescue.bin | 15 | targets := rescue.o rescue.bin |
14 | 16 | ||
15 | $(target)/rescue.bin: $(target) $(target)/head.o | 17 | $(obj)/rescue.o: $(OBJECT) FORCE |
16 | $(LD) -T $(src)/rescue.ld -o $(target)/rescue.o $(target)/head.o | 18 | $(call if_changed,ld) |
17 | $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/rescue.o $(target)/rescue.bin | ||
18 | # Place a copy in top-level build directory | ||
19 | cp -p $(target)/rescue.bin $(objtree) | ||
20 | 19 | ||
21 | $(target)/testrescue.bin: $(target) $(target)/testrescue.o | 20 | $(obj)/rescue.bin: $(obj)/rescue.o FORCE |
22 | $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/testrescue.o tr.bin | 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 | ||
23 | # Pad it to 784 bytes | 26 | # Pad it to 784 bytes |
24 | dd if=/dev/zero of=tmp2423 bs=1 count=784 | 27 | dd if=/dev/zero of=tmp2423 bs=1 count=784 |
25 | cat tr.bin tmp2423 >testrescue_tmp.bin | 28 | cat tr.bin tmp2423 >testrescue_tmp.bin |
26 | dd if=testrescue_tmp.bin of=$(target)/testrescue.bin bs=1 count=784 | 29 | dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784 |
27 | rm tr.bin tmp2423 testrescue_tmp.bin | 30 | rm tr.bin tmp2423 testrescue_tmp.bin |
28 | 31 | ||
29 | $(target)/kimagerescue.bin: $(target) $(target)/kimagerescue.o | 32 | $(obj)/kimagerescue.bin: $(obj)/kimagerescue.o |
30 | $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/kimagerescue.o ktr.bin | 33 | $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin |
31 | # Pad it to 784 bytes, that's what the rescue loader expects | 34 | # Pad it to 784 bytes, that's what the rescue loader expects |
32 | dd if=/dev/zero of=tmp2423 bs=1 count=784 | 35 | dd if=/dev/zero of=tmp2423 bs=1 count=784 |
33 | cat ktr.bin tmp2423 >kimagerescue_tmp.bin | 36 | cat ktr.bin tmp2423 >kimagerescue_tmp.bin |
34 | dd if=kimagerescue_tmp.bin of=$(target)/kimagerescue.bin bs=1 count=784 | 37 | dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784 |
35 | rm ktr.bin tmp2423 kimagerescue_tmp.bin | 38 | rm ktr.bin tmp2423 kimagerescue_tmp.bin |
36 | |||
37 | $(target): | ||
38 | mkdir -p $(target) | ||
39 | |||
40 | $(target)/head.o: $(src)/head.S | ||
41 | $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o | ||
42 | |||
43 | $(target)/testrescue.o: $(src)/testrescue.S | ||
44 | $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o | ||
45 | |||
46 | $(target)/kimagerescue.o: $(src)/kimagerescue.S | ||
47 | $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o | ||
48 | |||
49 | clean: | ||
50 | rm -f $(target)/*.o $(target)/*.bin | ||
51 | |||
52 | fastdep: | ||
53 | |||
54 | modules: | ||
55 | |||
56 | modules-install: | ||