Merge remote-tracking branch 'remotes/powerpc/topic/xive' into kvm-ppc-next
[linux/fpc-iii.git] / arch / cris / boot / rescue / Makefile
bloba82025940006acd8a297f26c80f878c40ed9b02a
2 # Makefile for rescue (bootstrap) code
5 # CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
6 # ccflags-$(CONFIG_ETRAX_ARCH_V32) += -I$(srctree)/include/asm/arch/mach/ \
7 # -I$(srctree)/include/asm/arch
8 # asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch
9 # LD = gcc-cris -mlinux -march=v32 -nostdlib
11 ifdef CONFIG_ETRAX_AXISFLASHMAP
13 arch-$(CONFIG_ETRAX_ARCH_V10) = v10
14 arch-$(CONFIG_ETRAX_ARCH_V32) = v32
16 ldflags-y += -T $(srctree)/$(src)/rescue_$(arch-y).lds
17 OBJCOPYFLAGS = -O binary --remove-section=.bss
18 obj-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o
19 obj-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o
20 OBJECTS := $(obj-y)
22 targets := rescue.o rescue.bin
24 $(obj)/rescue.o: $(OBJECTS) FORCE
25 $(call if_changed,ld)
27 $(obj)/rescue.bin: $(obj)/rescue.o FORCE
28 $(call if_changed,objcopy)
29 cp -p $(obj)/rescue.bin $(objtree)
31 else
32 $(obj)/rescue.bin:
34 endif
36 $(obj)/testrescue.bin: $(obj)/testrescue.o
37 $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/testrescue.o tr.bin
38 # Pad it to 784 bytes
39 dd if=/dev/zero of=tmp2423 bs=1 count=784
40 cat tr.bin tmp2423 >testrescue_tmp.bin
41 dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784
42 rm tr.bin tmp2423 testrescue_tmp.bin
45 $(obj)/kimagerescue.bin: $(obj)/kimagerescue.o
46 $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin
47 # Pad it to 784 bytes, that's what the rescue loader expects
48 dd if=/dev/zero of=tmp2423 bs=1 count=784
49 cat ktr.bin tmp2423 >kimagerescue_tmp.bin
50 dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784
51 rm ktr.bin tmp2423 kimagerescue_tmp.bin