xref: /linux/arch/xtensa/boot/boot-elf/Makefile (revision 8824c1af3af28c7b5c16307c1b8c6d842794e4ed)
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
18*8824c1afSMasahiro Yamadatargets		+= $(boot-y) boot.lds
194bedea94SChris Zankel
204bedea94SChris ZankelOBJS		:= $(addprefix $(obj)/,$(boot-y))
214bedea94SChris Zankel
2265898b37SMax Filippov$(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS)
233f5ec298SMax Filippov	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
2465898b37SMax Filippov		--add-section image=$< \
254bedea94SChris Zankel		--set-section-flags image=contents,alloc,load,load,data \
263f5ec298SMax Filippov		$(OBJS) $@
274bedea94SChris Zankel
283f5ec298SMax Filippov$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
29d503ac53SMasahiro Yamada	$(Q)$(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_vmlinux) \
303f5ec298SMax Filippov		-T $(obj)/boot.lds \
313f5ec298SMax Filippov		--build-id=none \
323f5ec298SMax Filippov		-o $@ $(obj)/Image.o
333f5ec298SMax Filippov	$(Q)$(kecho) '  Kernel: $@ is ready'
344bedea94SChris Zankel
359a736fcbSMax Filippovall Image: $(obj)/../Image.elf
36