Skip to content

Commit 43fee2b

Browse files
committed
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: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 6b0709f commit 43fee2b

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ define filechk_version.h
11171117
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
11181118
endef
11191119

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

‎arch/s390/kernel/syscalls/Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
2525
$(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
2626

2727
define filechk_syshdr
28-
$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2"
28+
$(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
2929
endef
3030

3131
define filechk_sysnr
32-
$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget))
32+
$(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
3333
endef
3434

3535
define filechk_syscalls
36-
$(CONFIG_SHELL) '$(systbl)' -S
36+
$(CONFIG_SHELL) '$(systbl)' -S < $<
3737
endef
3838

3939
syshdr_abi_unistd_32 := common,32

‎arch/um/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ define filechk_gen-asm-offsets
169169
echo " *"; \
170170
echo " */"; \
171171
echo ""; \
172-
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
172+
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" < $<; \
173173
echo ""; )
174174
endef
175175

‎scripts/Kbuild.include‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ kecho := $($(quiet)kecho)
5656
define filechk
5757
$(Q)set -e; \
5858
mkdir -p $(dir $@); \
59-
$(filechk_$(1)) < $< > $@.tmp; \
59+
$(filechk_$(1)) > $@.tmp; \
6060
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
6161
rm -f $@.tmp; \
6262
else \

‎scripts/Makefile.lib‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ define filechk_offsets
415415
echo " * This file was generated by Kbuild"; \
416416
echo " */"; \
417417
echo ""; \
418-
sed -ne $(sed-offsets); \
418+
sed -ne $(sed-offsets) < $<; \
419419
echo ""; \
420420
echo "#endif" )
421421
endef

0 commit comments

Comments
 (0)