Merge tag 'drm-fixes-for-v4.14-rc8' of git://people.freedesktop.org/~airlied/linux
[sfrench/cifs-2.6.git] / arch / cris / boot / rescue / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # Makefile for rescue (bootstrap) code
4 #
5
6 # CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
7 # ccflags-$(CONFIG_ETRAX_ARCH_V32) += -I$(srctree)/include/asm/arch/mach/ \
8 #                                   -I$(srctree)/include/asm/arch
9 # asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch
10 # LD = gcc-cris -mlinux -march=v32 -nostdlib
11
12 ifdef CONFIG_ETRAX_AXISFLASHMAP
13
14 arch-$(CONFIG_ETRAX_ARCH_V10) = v10
15 arch-$(CONFIG_ETRAX_ARCH_V32) = v32
16
17 ldflags-y += -T $(srctree)/$(src)/rescue_$(arch-y).lds
18 OBJCOPYFLAGS = -O binary --remove-section=.bss
19 obj-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o
20 obj-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o
21 OBJECTS := $(obj-y)
22
23 targets := rescue.o rescue.bin
24
25 $(obj)/rescue.o: $(OBJECTS) FORCE
26         $(call if_changed,ld)
27
28 $(obj)/rescue.bin: $(obj)/rescue.o FORCE
29         $(call if_changed,objcopy)
30         cp -p $(obj)/rescue.bin $(objtree)
31
32 else
33 $(obj)/rescue.bin:
34
35 endif
36
37 $(obj)/testrescue.bin: $(obj)/testrescue.o
38         $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/testrescue.o tr.bin
39 # Pad it to 784 bytes
40         dd if=/dev/zero of=tmp2423 bs=1 count=784
41         cat tr.bin tmp2423 >testrescue_tmp.bin
42         dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784
43         rm tr.bin tmp2423 testrescue_tmp.bin
44
45
46 $(obj)/kimagerescue.bin: $(obj)/kimagerescue.o
47         $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin
48 # Pad it to 784 bytes, that's what the rescue loader expects
49         dd if=/dev/zero of=tmp2423 bs=1 count=784
50         cat ktr.bin tmp2423 >kimagerescue_tmp.bin
51         dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784
52         rm ktr.bin tmp2423 kimagerescue_tmp.bin
53