Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / arch / xtensa / boot / boot-redboot / Makefile
blob872029b84435eb561ec97fd125ddb8ad51fbab07
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 GZIP = gzip
8 GZIP_FLAGS = -v9fc
9 ifeq ($(BIG_ENDIAN),1)
10 OBJCOPY_ARGS := -O elf32-xtensa-be
11 else
12 OBJCOPY_ARGS := -O elf32-xtensa-le
13 endif
15 LD_ARGS = -T $(srctree)/$(obj)/boot.ld
17 boot-y := bootstrap.o
19 OBJS := $(addprefix $(obj)/,$(boot-y))
20 LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
22 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
24 zImage: vmlinux $(OBJS) $(LIBS)
25 $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
26 vmlinux vmlinux.tmp
27 gzip -vf9 vmlinux.tmp
28 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
29 --add-section image=vmlinux.tmp.gz \
30 --set-section-flags image=contents,alloc,load,load,data \
31 $(OBJS) $@.tmp
32 $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC)
33 $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot
34 rm -f $@.tmp $@.elf vmlinux.tmp.gz