kbuild: clean up asm-offsets.h creation

- Move mkdir out of cmd_offsets
- Add input file to sed command instead of using cat

Signed-off-by: Brian Gerst <bgerst@didntduck.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
Brian Gerst 2006-01-06 18:28:45 -05:00 committed by Sam Ravnborg
parent ae215b14bd
commit ac448afbcd
1 changed files with 2 additions and 3 deletions

5
Kbuild
View File

@ -22,8 +22,6 @@ sed-$(CONFIG_MIPS) := "/^@@@/s///p"
quiet_cmd_offsets = GEN $@ quiet_cmd_offsets = GEN $@
define cmd_offsets define cmd_offsets
mkdir -p $(dir $@); \
cat $< | \
(set -e; \ (set -e; \
echo "#ifndef __ASM_OFFSETS_H__"; \ echo "#ifndef __ASM_OFFSETS_H__"; \
echo "#define __ASM_OFFSETS_H__"; \ echo "#define __ASM_OFFSETS_H__"; \
@ -34,7 +32,7 @@ define cmd_offsets
echo " *"; \ echo " *"; \
echo " */"; \ echo " */"; \
echo ""; \ echo ""; \
sed -ne $(sed-y); \ sed -ne $(sed-y) $<; \
echo ""; \ echo ""; \
echo "#endif" ) > $@ echo "#endif" ) > $@
endef endef
@ -45,5 +43,6 @@ arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
$(call if_changed_dep,cc_s_c) $(call if_changed_dep,cc_s_c)
$(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild $(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
$(Q)mkdir -p $(dir $@)
$(call cmd,offsets) $(call cmd,offsets)