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 7c425c546SMasahiro YamadaOBJCOPY_ARGS := -O $(if $(CONFIG_CPU_BIG_ENDIAN),elf32-xtensa-be,elf32-xtensa-le) 84bedea94SChris Zankel 9*7b665784SMasahiro YamadaCPPFLAGS_boot.lds += -P -C 10*7b665784SMasahiro YamadaKBUILD_AFLAGS += -mtext-section-literals 114bedea94SChris Zankel 124bedea94SChris Zankelboot-y := bootstrap.o 138824c1afSMasahiro Yamadatargets += $(boot-y) boot.lds 144bedea94SChris Zankel 154bedea94SChris ZankelOBJS := $(addprefix $(obj)/,$(boot-y)) 164bedea94SChris Zankel 1765898b37SMax Filippov$(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS) 183f5ec298SMax Filippov $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ 1965898b37SMax Filippov --add-section image=$< \ 204bedea94SChris Zankel --set-section-flags image=contents,alloc,load,load,data \ 213f5ec298SMax Filippov $(OBJS) $@ 224bedea94SChris Zankel 233f5ec298SMax Filippov$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds 243ec8a5b3SMasahiro Yamada $(Q)$(LD) $(KBUILD_LDFLAGS) \ 253f5ec298SMax Filippov -T $(obj)/boot.lds \ 263f5ec298SMax Filippov --build-id=none \ 273f5ec298SMax Filippov -o $@ $(obj)/Image.o 283f5ec298SMax Filippov $(Q)$(kecho) ' Kernel: $@ is ready' 294bedea94SChris Zankel 309a736fcbSMax Filippovall Image: $(obj)/../Image.elf 31