xref: /linux/arch/xtensa/boot/boot-elf/Makefile (revision 9a736fcb096b43b68af8329eb12abc8256dceaba)
14bedea94SChris Zankel#
24bedea94SChris Zankel# This file is subject to the terms and conditions of the GNU General Public
34bedea94SChris Zankel# License.  See the file "COPYING" in the main directory of this archive
44bedea94SChris Zankel# for more details.
54bedea94SChris Zankel#
64bedea94SChris Zankel
74bedea94SChris Zankelifeq ($(BIG_ENDIAN),1)
84bedea94SChris ZankelOBJCOPY_ARGS    := -O elf32-xtensa-be
94bedea94SChris Zankelelse
104bedea94SChris ZankelOBJCOPY_ARGS    := -O elf32-xtensa-le
114bedea94SChris Zankelendif
124bedea94SChris Zankel
134bedea94SChris Zankelexport OBJCOPY_ARGS
1436dffadbSChris Zankelexport CPPFLAGS_boot.lds += -P -C
15e85e335fSMax Filippovexport KBUILD_AFLAGS += -mtext-section-literals
164bedea94SChris Zankel
174bedea94SChris Zankelboot-y		:= bootstrap.o
184bedea94SChris Zankel
194bedea94SChris ZankelOBJS		:= $(addprefix $(obj)/,$(boot-y))
204bedea94SChris Zankel
213f5ec298SMax Filippov$(obj)/Image.o: vmlinux.bin $(OBJS)
223f5ec298SMax Filippov	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
233f5ec298SMax Filippov		--add-section image=vmlinux.bin \
244bedea94SChris Zankel		--set-section-flags image=contents,alloc,load,load,data \
253f5ec298SMax Filippov		$(OBJS) $@
264bedea94SChris Zankel
273f5ec298SMax Filippov$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
283f5ec298SMax Filippov	$(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
293f5ec298SMax Filippov		-T $(obj)/boot.lds \
303f5ec298SMax Filippov		--build-id=none \
313f5ec298SMax Filippov		-o $@ $(obj)/Image.o
323f5ec298SMax Filippov	$(Q)$(kecho) '  Kernel: $@ is ready'
334bedea94SChris Zankel
34*9a736fcbSMax Filippovall Image: $(obj)/../Image.elf
35