]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - arch/cris/boot/rescue/Makefile
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / arch / cris / boot / rescue / Makefile
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
1da177e4 2#
63e6b9a0 3# Makefile for rescue (bootstrap) code
1da177e4 4#
3e41d652 5
66ab3a74
JN
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
328cf692
GR
12ifdef CONFIG_ETRAX_AXISFLASHMAP
13
66ab3a74
JN
14arch-$(CONFIG_ETRAX_ARCH_V10) = v10
15arch-$(CONFIG_ETRAX_ARCH_V32) = v32
16
17ldflags-y += -T $(srctree)/$(src)/rescue_$(arch-y).lds
1da177e4 18OBJCOPYFLAGS = -O binary --remove-section=.bss
66ab3a74
JN
19obj-$(CONFIG_ETRAX_ARCH_V32) = $(obj)/head_v32.o
20obj-$(CONFIG_ETRAX_ARCH_V10) = $(obj)/head_v10.o
21OBJECTS := $(obj-y)
1da177e4 22
63e6b9a0 23targets := rescue.o rescue.bin
1da177e4 24
66ab3a74 25$(obj)/rescue.o: $(OBJECTS) FORCE
63e6b9a0 26 $(call if_changed,ld)
1da177e4 27
63e6b9a0
JN
28$(obj)/rescue.bin: $(obj)/rescue.o FORCE
29 $(call if_changed,objcopy)
30 cp -p $(obj)/rescue.bin $(objtree)
31
328cf692
GR
32else
33$(obj)/rescue.bin:
34
35endif
36
63e6b9a0
JN
37$(obj)/testrescue.bin: $(obj)/testrescue.o
38 $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/testrescue.o tr.bin
1da177e4
LT
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
63e6b9a0 42 dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784
1da177e4
LT
43 rm tr.bin tmp2423 testrescue_tmp.bin
44
66ab3a74 45
63e6b9a0
JN
46$(obj)/kimagerescue.bin: $(obj)/kimagerescue.o
47 $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin
1da177e4
LT
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
63e6b9a0 51 dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784
1da177e4 52 rm ktr.bin tmp2423 kimagerescue_tmp.bin
66ab3a74 53