Skip to content

Commit 65898b3

Browse files
committed
xtensa: move vmlinux.bin[.gz] to boot subdirectory
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 <[email protected]> Signed-off-by: Max Filippov <[email protected]>
1 parent 10b6059 commit 65898b3

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

arch/xtensa/boot/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ BIG_ENDIAN := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
1717
export BIG_ENDIAN
1818

1919
subdir-y := lib
20+
targets += vmlinux.bin vmlinux.bin.gz
2021

2122
# Subdirs for the boot loader(s)
2223

@@ -35,19 +36,19 @@ boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
3536

3637
OBJCOPYFLAGS = --strip-all -R .comment -R .notes -O binary
3738

38-
vmlinux.bin: vmlinux FORCE
39+
$(obj)/vmlinux.bin: vmlinux FORCE
3940
$(call if_changed,objcopy)
4041

41-
vmlinux.bin.gz: vmlinux.bin FORCE
42+
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
4243
$(call if_changed,gzip)
4344

44-
boot-elf: vmlinux.bin
45-
boot-redboot: vmlinux.bin.gz
45+
boot-elf: $(obj)/vmlinux.bin
46+
boot-redboot: $(obj)/vmlinux.bin.gz
4647

4748
UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
4849
UIMAGE_COMPRESSION = gzip
4950

50-
$(obj)/uImage: vmlinux.bin.gz FORCE
51+
$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
5152
$(call if_changed,uimage)
5253
$(Q)$(kecho) ' Kernel: $@ is ready'
5354

arch/xtensa/boot/boot-elf/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ boot-y := bootstrap.o
1818

1919
OBJS := $(addprefix $(obj)/,$(boot-y))
2020

21-
$(obj)/Image.o: vmlinux.bin $(OBJS)
21+
$(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS)
2222
$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
23-
--add-section image=vmlinux.bin \
23+
--add-section image=$< \
2424
--set-section-flags image=contents,alloc,load,load,data \
2525
$(OBJS) $@
2626

arch/xtensa/boot/boot-redboot/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
1919

2020
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
2121

22-
$(obj)/zImage.o: vmlinux.bin.gz $(OBJS)
22+
$(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
2323
$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
24-
--add-section image=vmlinux.bin.gz \
24+
--add-section image=$< \
2525
--set-section-flags image=contents,alloc,load,load,data \
2626
$(OBJS) $@
2727

0 commit comments

Comments
 (0)