Commit 43fee2b2 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: do not redirect the first prerequisite for filechk

Currently, filechk unconditionally opens the first prerequisite and
redirects it as the stdin of a filechk_* rule.  Hence, every target
using $(call filechk,...) must list something as the first prerequisite
even if it is unneeded.

'< $<' is actually unneeded in most cases.  Each rule can explicitly
adds it if necessary.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 6b0709f5
...@@ -1117,7 +1117,7 @@ define filechk_version.h ...@@ -1117,7 +1117,7 @@ define filechk_version.h
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef endef
$(version_h): $(srctree)/Makefile FORCE $(version_h): FORCE
$(call filechk,version.h) $(call filechk,version.h)
$(Q)rm -f $(old_version_h) $(Q)rm -f $(old_version_h)
......
...@@ -25,15 +25,15 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ ...@@ -25,15 +25,15 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
$(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
define filechk_syshdr define filechk_syshdr
$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
endef endef
define filechk_sysnr define filechk_sysnr
$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
endef endef
define filechk_syscalls define filechk_syscalls
$(CONFIG_SHELL) '$(systbl)' -S $(CONFIG_SHELL) '$(systbl)' -S < $<
endef endef
syshdr_abi_unistd_32 := common,32 syshdr_abi_unistd_32 := common,32
......
...@@ -169,7 +169,7 @@ define filechk_gen-asm-offsets ...@@ -169,7 +169,7 @@ define filechk_gen-asm-offsets
echo " *"; \ echo " *"; \
echo " */"; \ echo " */"; \
echo ""; \ echo ""; \
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" < $<; \
echo ""; ) echo ""; )
endef endef
......
...@@ -56,7 +56,7 @@ kecho := $($(quiet)kecho) ...@@ -56,7 +56,7 @@ kecho := $($(quiet)kecho)
define filechk define filechk
$(Q)set -e; \ $(Q)set -e; \
mkdir -p $(dir $@); \ mkdir -p $(dir $@); \
$(filechk_$(1)) < $< > $@.tmp; \ $(filechk_$(1)) > $@.tmp; \
if [ -r $@ ] && cmp -s $@ $@.tmp; then \ if [ -r $@ ] && cmp -s $@ $@.tmp; then \
rm -f $@.tmp; \ rm -f $@.tmp; \
else \ else \
......
...@@ -415,7 +415,7 @@ define filechk_offsets ...@@ -415,7 +415,7 @@ define filechk_offsets
echo " * This file was generated by Kbuild"; \ echo " * This file was generated by Kbuild"; \
echo " */"; \ echo " */"; \
echo ""; \ echo ""; \
sed -ne $(sed-offsets); \ sed -ne $(sed-offsets) < $<; \
echo ""; \ echo ""; \
echo "#endif" ) echo "#endif" )
endef endef
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment