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 <sfr@canb.auug.org.au> for the report.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 1) Generate asm-offsets.h
#####
-# 1) Generate asm-offsets.h
+# 1) Generate asm-offsets.h
#
offsets-file := include/asm-$(ARCH)/asm-offsets.h
quiet_cmd_offsets = GEN $@
define cmd_offsets
+ mkdir -p $(dir $@); \
cat $< | \
(set -e; \
echo "#ifndef __ASM_OFFSETS_H__"; \
$(Q)mkdir -p $(dir $@)
$(call if_changed_dep,cc_s_c)
-$(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
+$(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
$(call cmd,offsets)
endif
prepare0: prepare prepare1 FORCE
- $(Q)$(MAKE) $(build)=$(srctree)
+ $(Q)$(MAKE) $(build)=.
# All the preparing..
prepare-all: prepare0