Linux 4.8-rc8
[linux/fpc-iii.git] / arch / xtensa / boot / boot-redboot / Makefile
blob8be8b943698178716093b06f40e53a13261e1cfd
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
17 OBJS := $(addprefix $(obj)/,$(boot-y))
18 LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
20 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
22 $(obj)/zImage.o: vmlinux.bin.gz $(OBJS)
23 $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
24 --add-section image=vmlinux.bin.gz \
25 --set-section-flags image=contents,alloc,load,load,data \
26 $(OBJS) $@
28 $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS)
29 $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC)
31 $(obj)/../zImage.redboot: $(obj)/zImage.elf
32 $(Q)$(OBJCOPY) -S -O binary $< $@
33 $(Q)$(kecho) ' Kernel: $@ is ready'
35 zImage: $(obj)/../zImage.redboot