Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / xtensa / boot / boot-redboot / Makefile
blob07cb24afedc27d564bbd36358d481e256768ea67
2 # This file is subject to the terms and conditions of the GNU General Public
3 # License. See the file "COPYING" in the main directory of this archive
4 # for more details.
7 ifeq ($(BIG_ENDIAN),1)
8 OBJCOPY_ARGS := -O elf32-xtensa-be
9 else
10 OBJCOPY_ARGS := -O elf32-xtensa-le
11 endif
13 LD_ARGS = -T $(srctree)/$(obj)/boot.ld
15 boot-y := bootstrap.o
16 targets += $(boot-y)
18 OBJS := $(addprefix $(obj)/,$(boot-y))
19 LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
21 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
23 $(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
24 $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
25 --add-section image=$< \
26 --set-section-flags image=contents,alloc,load,load,data \
27 $(OBJS) $@
29 $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS)
30 $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC)
32 $(obj)/../zImage.redboot: $(obj)/zImage.elf
33 $(Q)$(OBJCOPY) -S -O binary $< $@
34 $(Q)$(kecho) ' Kernel: $@ is ready'
36 all zImage: $(obj)/../zImage.redboot