1*4882a593Smuzhiyun# 2*4882a593Smuzhiyun# This file is subject to the terms and conditions of the GNU General Public 3*4882a593Smuzhiyun# License. See the file "COPYING" in the main directory of this archive 4*4882a593Smuzhiyun# for more details. 5*4882a593Smuzhiyun# 6*4882a593Smuzhiyun 7*4882a593Smuzhiyunifeq ($(BIG_ENDIAN),1) 8*4882a593SmuzhiyunOBJCOPY_ARGS := -O elf32-xtensa-be 9*4882a593Smuzhiyunelse 10*4882a593SmuzhiyunOBJCOPY_ARGS := -O elf32-xtensa-le 11*4882a593Smuzhiyunendif 12*4882a593Smuzhiyun 13*4882a593Smuzhiyunexport OBJCOPY_ARGS 14*4882a593Smuzhiyunexport CPPFLAGS_boot.lds += -P -C 15*4882a593Smuzhiyunexport KBUILD_AFLAGS += -mtext-section-literals 16*4882a593Smuzhiyun 17*4882a593Smuzhiyunboot-y := bootstrap.o 18*4882a593Smuzhiyuntargets += $(boot-y) boot.lds 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunOBJS := $(addprefix $(obj)/,$(boot-y)) 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun$(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS) 23*4882a593Smuzhiyun $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ 24*4882a593Smuzhiyun --add-section image=$< \ 25*4882a593Smuzhiyun --set-section-flags image=contents,alloc,load,load,data \ 26*4882a593Smuzhiyun $(OBJS) $@ 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds 29*4882a593Smuzhiyun $(Q)$(LD) $(KBUILD_LDFLAGS) \ 30*4882a593Smuzhiyun -T $(obj)/boot.lds \ 31*4882a593Smuzhiyun --build-id=none \ 32*4882a593Smuzhiyun -o $@ $(obj)/Image.o 33*4882a593Smuzhiyun $(Q)$(kecho) ' Kernel: $@ is ready' 34*4882a593Smuzhiyun 35*4882a593Smuzhiyunall Image: $(obj)/../Image.elf 36