aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2007-11-30 10:11:38 -0500
committerJesper Nilsson <jesper.nilsson@axis.com>2008-02-08 05:06:25 -0500
commit63e6b9a0b876a287782a706351e0868789673f90 (patch)
tree1f48eeb1c379dc035c77c4f216a798bd6c92bf8a
parent1333a694836cb7e561b1b70d60ccceb8fabeead2 (diff)
CRIS v10: Update rescue Kbuild makefile.
- Remove old specific targets, use more generic ones instead. - Use if_changed to avoid creating new images when no change. Removes a lot of cruft. - Use EXTRA_CFLAGS instead of CFLAGS.
-rw-r--r--arch/cris/arch-v10/boot/rescue/Makefile56
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..911c89456f8d 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#
4target = $(target_rescue_dir)
5src = $(src_rescue_dir)
6 4
7CC = gcc-cris -mlinux $(LINUXINCLUDE) 5CC = gcc-cris -mlinux $(LINUXINCLUDE)
8CFLAGS = -O2 6EXTRA_CFLAGS = -O2
7AFLAGS = -traditional
9LD = gcc-cris -mlinux -nostdlib 8LD = gcc-cris -mlinux -nostdlib
9LDFLAGS = -T $(obj)/rescue.ld
10OBJCOPY = objcopy-cris 10OBJCOPY = objcopy-cris
11OBJCOPYFLAGS = -O binary --remove-section=.bss 11OBJCOPYFLAGS = -O binary --remove-section=.bss
12obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
13OBJECT := $(obj)/head.o
12 14
13all: $(target)/rescue.bin $(target)/testrescue.bin $(target)/kimagerescue.bin 15targets := 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
49clean:
50 rm -f $(target)/*.o $(target)/*.bin
51
52fastdep:
53
54modules:
55
56modules-install: