xtensa: move vmlinux.bin[.gz] to boot subdirectory
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 22 Jul 2020 05:20:19 +0000 (22:20 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 28 Jul 2020 07:57:06 +0000 (00:57 -0700)
vmlinux.bin and vmlinux.bin.gz are always rebuilt in the kernel build
process. Add them to 'targets' and move them to the boot subdirectory
where their rules are. Update make rules that refer to them.

Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/boot/Makefile
arch/xtensa/boot/boot-elf/Makefile
arch/xtensa/boot/boot-redboot/Makefile

index 1a14d38d9b3392b1aec015399c5c0d26b7e72f3e..801fe30b4dfebadab673e2d5c32abbc31f0d1043 100644 (file)
@@ -17,6 +17,7 @@ BIG_ENDIAN    := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
 export BIG_ENDIAN
 
 subdir-y       := lib
+targets                += vmlinux.bin vmlinux.bin.gz
 
 # Subdirs for the boot loader(s)
 
@@ -35,19 +36,19 @@ boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
 
 OBJCOPYFLAGS = --strip-all -R .comment -R .notes -O binary
 
-vmlinux.bin: vmlinux FORCE
+$(obj)/vmlinux.bin: vmlinux FORCE
        $(call if_changed,objcopy)
 
-vmlinux.bin.gz: vmlinux.bin FORCE
+$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
        $(call if_changed,gzip)
 
-boot-elf: vmlinux.bin
-boot-redboot: vmlinux.bin.gz
+boot-elf: $(obj)/vmlinux.bin
+boot-redboot: $(obj)/vmlinux.bin.gz
 
 UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
 UIMAGE_COMPRESSION = gzip
 
-$(obj)/uImage: vmlinux.bin.gz FORCE
+$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
        $(call if_changed,uimage)
        $(Q)$(kecho) '  Kernel: $@ is ready'
 
index 12ae1e91cb75fbcb729491fef73ec0a4736a7fee..ceae02cd5b3ba8cb606bb8406f9f4ca889ca6ddc 100644 (file)
@@ -18,9 +18,9 @@ boot-y                := bootstrap.o
 
 OBJS           := $(addprefix $(obj)/,$(boot-y))
 
-$(obj)/Image.o: vmlinux.bin $(OBJS)
+$(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS)
        $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
-               --add-section image=vmlinux.bin \
+               --add-section image=$< \
                --set-section-flags image=contents,alloc,load,load,data \
                $(OBJS) $@
 
index 8632473ad319ea3bd2972e706e510213ecbb07b0..064c4f23581f69f4b1ef44e951da6e78ee9b5f1a 100644 (file)
@@ -19,9 +19,9 @@ LIBS  := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
 
 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
 
-$(obj)/zImage.o: vmlinux.bin.gz $(OBJS)
+$(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
        $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
-               --add-section image=vmlinux.bin.gz \
+               --add-section image=$< \
                --set-section-flags image=contents,alloc,load,load,data \
                $(OBJS) $@