Skip to content

Commit

Permalink
kbuild: do not redirect the first prerequisite for filechk
Browse files Browse the repository at this point in the history
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: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed Jul 28, 2018
1 parent 6b0709f commit 43fee2b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ define filechk_version.h
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef

$(version_h): $(srctree)/Makefile FORCE
$(version_h): FORCE
$(call filechk,version.h)
$(Q)rm -f $(old_version_h)

Expand Down
6 changes: 3 additions & 3 deletions arch/s390/kernel/syscalls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
$(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')

define filechk_syshdr
$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2"
$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
endef

define filechk_sysnr
$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget))
$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
endef

define filechk_syscalls
$(CONFIG_SHELL) '$(systbl)' -S
$(CONFIG_SHELL) '$(systbl)' -S < $<
endef

syshdr_abi_unistd_32 := common,32
Expand Down
2 changes: 1 addition & 1 deletion arch/um/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ define filechk_gen-asm-offsets
echo " *"; \
echo " */"; \
echo ""; \
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" < $<; \
echo ""; )
endef

Expand Down
2 changes: 1 addition & 1 deletion scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ kecho := $($(quiet)kecho)
define filechk
$(Q)set -e; \
mkdir -p $(dir $@); \
$(filechk_$(1)) < $< > [email protected]; \
$(filechk_$(1)) > [email protected]; \
if [ -r $@ ] && cmp -s $@ [email protected]; then \
rm -f [email protected]; \
else \
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ define filechk_offsets
echo " * This file was generated by Kbuild"; \
echo " */"; \
echo ""; \
sed -ne $(sed-offsets); \
sed -ne $(sed-offsets) < $<; \
echo ""; \
echo "#endif" )
endef

0 comments on commit 43fee2b

Please sign in to comment.