xref: /linux/arch/xtensa/boot/boot-elf/Makefile (revision 3f5ec298e56587462d91320c9e49f3e38f2beb17)
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
154bedea94SChris Zankel
164bedea94SChris Zankelboot-y		:= bootstrap.o
174bedea94SChris Zankel
184bedea94SChris ZankelOBJS		:= $(addprefix $(obj)/,$(boot-y))
194bedea94SChris Zankel
20*3f5ec298SMax Filippov$(obj)/Image.o: vmlinux.bin $(OBJS)
21*3f5ec298SMax Filippov	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
22*3f5ec298SMax Filippov		--add-section image=vmlinux.bin \
234bedea94SChris Zankel		--set-section-flags image=contents,alloc,load,load,data \
24*3f5ec298SMax Filippov		$(OBJS) $@
254bedea94SChris Zankel
26*3f5ec298SMax Filippov$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
27*3f5ec298SMax Filippov	$(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
28*3f5ec298SMax Filippov		-T $(obj)/boot.lds \
29*3f5ec298SMax Filippov		--build-id=none \
30*3f5ec298SMax Filippov		-o $@ $(obj)/Image.o
31*3f5ec298SMax Filippov	$(Q)$(kecho) '  Kernel: $@ is ready'
324bedea94SChris Zankel
33*3f5ec298SMax FilippovzImage:	$(obj)/../Image.elf
34