xref: /openbmc/linux/arch/xtensa/boot/boot-elf/Makefile (revision 05bcf503)
1#
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.
5#
6
7GZIP = gzip
8GZIP_FLAGS = -v9fc
9
10ifeq ($(BIG_ENDIAN),1)
11OBJCOPY_ARGS    := -O elf32-xtensa-be
12else
13OBJCOPY_ARGS    := -O elf32-xtensa-le
14endif
15
16export OBJCOPY_ARGS
17export CPPFLAGS_boot.lds += -P -C
18
19boot-y		:= bootstrap.o
20
21OBJS		:= $(addprefix $(obj)/,$(boot-y))
22
23vmlinux.tmp: vmlinux
24	$(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
25		$^ $@
26
27Image:	vmlinux.tmp $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds
28	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
29		--add-section image=vmlinux.tmp \
30		--set-section-flags image=contents,alloc,load,load,data \
31		$(OBJS) $@.tmp
32	$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
33		-T arch/$(ARCH)/boot/boot-elf/boot.lds \
34		-o arch/$(ARCH)/boot/$@.elf $@.tmp
35
36zImage:	Image
37
38