xref: /openbmc/linux/arch/xtensa/boot/boot-elf/Makefile (revision 9d749629)
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
7ifeq ($(BIG_ENDIAN),1)
8OBJCOPY_ARGS    := -O elf32-xtensa-be
9else
10OBJCOPY_ARGS    := -O elf32-xtensa-le
11endif
12
13export OBJCOPY_ARGS
14export CPPFLAGS_boot.lds += -P -C
15
16boot-y		:= bootstrap.o
17
18OBJS		:= $(addprefix $(obj)/,$(boot-y))
19
20$(obj)/Image.o: vmlinux.bin $(OBJS)
21	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
22		--add-section image=vmlinux.bin \
23		--set-section-flags image=contents,alloc,load,load,data \
24		$(OBJS) $@
25
26$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
27	$(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
28		-T $(obj)/boot.lds \
29		--build-id=none \
30		-o $@ $(obj)/Image.o
31	$(Q)$(kecho) '  Kernel: $@ is ready'
32
33zImage:	$(obj)/../Image.elf
34