Skip to content

Commit 8d36a62

Browse files
author
Sam Ravnborg
committed
kbuild: fix generic asm-offsets.h support
iThis fixes a bug where the generated asm-offsets.h file was saved in the source tree even with make O=. Thanks to Stephen Rothwell <[email protected]> for the report. Signed-off-by: Sam Ravnborg <[email protected]>
1 parent 0a504f2 commit 8d36a62

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Kbuild

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# 1) Generate asm-offsets.h
55

66
#####
7-
# 1) Generate asm-offsets.h
7+
# 1) Generate asm-offsets.h
88
#
99

1010
offsets-file := include/asm-$(ARCH)/asm-offsets.h
@@ -22,6 +22,7 @@ sed-$(CONFIG_MIPS) := "/^@@@/s///p"
2222

2323
quiet_cmd_offsets = GEN $@
2424
define cmd_offsets
25+
mkdir -p $(dir $@); \
2526
cat $< | \
2627
(set -e; \
2728
echo "#ifndef __ASM_OFFSETS_H__"; \
@@ -43,6 +44,6 @@ arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
4344
$(Q)mkdir -p $(dir $@)
4445
$(call if_changed_dep,cc_s_c)
4546

46-
$(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
47+
$(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
4748
$(call cmd,offsets)
4849

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ ifneq ($(KBUILD_MODULES),)
814814
endif
815815

816816
prepare0: prepare prepare1 FORCE
817-
$(Q)$(MAKE) $(build)=$(srctree)
817+
$(Q)$(MAKE) $(build)=.
818818

819819
# All the preparing..
820820
prepare-all: prepare0

0 commit comments

Comments
 (0)