summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-02 20:16:54 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-05 20:22:35 -0500
commitba97df45581f09a987ffa38444c33ed6a0a9479e (patch)
tree82ac6f321415ebfad378c249abb1779aeeb95c59
parentd6e4b3e326d8b44675b9e19534347d97073826aa (diff)
kbuild: use assignment instead of define ... endef for filechk_* rules
You do not have to use define ... endef for filechk_* rules. For simple cases, the use of assignment looks cleaner, IMHO. I updated the usage for scripts/Kbuild.include in case somebody misunderstands the 'define ... endif' is the requirement. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
-rw-r--r--Kbuild4
-rw-r--r--Makefile3
-rw-r--r--arch/s390/kernel/syscalls/Makefile12
-rw-r--r--arch/s390/tools/Makefile7
-rw-r--r--scripts/Kbuild.include8
-rw-r--r--scripts/kconfig/Makefile4
6 files changed, 12 insertions, 26 deletions
diff --git a/Kbuild b/Kbuild
index 06b801e12fb4..65db5bef2e36 100644
--- a/Kbuild
+++ b/Kbuild
@@ -26,9 +26,7 @@ timeconst-file := include/generated/timeconst.h
26 26
27targets += $(timeconst-file) 27targets += $(timeconst-file)
28 28
29define filechk_gentimeconst 29filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
30 echo $(CONFIG_HZ) | bc -q $<
31endef
32 30
33$(timeconst-file): kernel/time/timeconst.bc FORCE 31$(timeconst-file): kernel/time/timeconst.bc FORCE
34 $(call filechk,gentimeconst) 32 $(call filechk,gentimeconst)
diff --git a/Makefile b/Makefile
index 437d6033598c..adf1bd212cf2 100644
--- a/Makefile
+++ b/Makefile
@@ -1041,9 +1041,8 @@ PHONY += $(vmlinux-dirs)
1041$(vmlinux-dirs): prepare 1041$(vmlinux-dirs): prepare
1042 $(Q)$(MAKE) $(build)=$@ need-builtin=1 1042 $(Q)$(MAKE) $(build)=$@ need-builtin=1
1043 1043
1044define filechk_kernel.release 1044filechk_kernel.release = \
1045 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" 1045 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
1046endef
1047 1046
1048# Store (new) KERNELRELEASE string in include/config/kernel.release 1047# Store (new) KERNELRELEASE string in include/config/kernel.release
1049include/config/kernel.release: $(srctree)/Makefile FORCE 1048include/config/kernel.release: $(srctree)/Makefile FORCE
diff --git a/arch/s390/kernel/syscalls/Makefile b/arch/s390/kernel/syscalls/Makefile
index 4d929edc80a6..b98f25029b8e 100644
--- a/arch/s390/kernel/syscalls/Makefile
+++ b/arch/s390/kernel/syscalls/Makefile
@@ -24,17 +24,11 @@ uapi: $(uapi-hdrs-y)
24_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 24_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
25 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 25 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
26 26
27define filechk_syshdr 27filechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
28 $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
29endef
30 28
31define filechk_sysnr 29filechk_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
32 $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
33endef
34 30
35define filechk_syscalls 31filechk_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $<
36 $(CONFIG_SHELL) '$(systbl)' -S < $<
37endef
38 32
39syshdr_abi_unistd_32 := common,32 33syshdr_abi_unistd_32 := common,32
40$(uapi)/unistd_32.h: $(syscall) FORCE 34$(uapi)/unistd_32.h: $(syscall) FORCE
diff --git a/arch/s390/tools/Makefile b/arch/s390/tools/Makefile
index cf4846a7ee8d..2342b84b3386 100644
--- a/arch/s390/tools/Makefile
+++ b/arch/s390/tools/Makefile
@@ -20,13 +20,10 @@ HOSTCFLAGS_gen_opcode_table.o += -Wall $(LINUXINCLUDE)
20# Ensure output directory exists 20# Ensure output directory exists
21_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 21_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
22 22
23define filechk_facility-defs.h 23filechk_facility-defs.h = $(obj)/gen_facilities
24 $(obj)/gen_facilities
25endef
26 24
27define filechk_dis-defs.h 25filechk_dis-defs.h = \
28 $(obj)/gen_opcode_table < $(srctree)/arch/$(ARCH)/tools/opcodes.txt 26 $(obj)/gen_opcode_table < $(srctree)/arch/$(ARCH)/tools/opcodes.txt
29endef
30 27
31$(kapi)/facility-defs.h: $(obj)/gen_facilities FORCE 28$(kapi)/facility-defs.h: $(obj)/gen_facilities FORCE
32 $(call filechk,facility-defs.h) 29 $(call filechk,facility-defs.h)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 74a3fe7ddc01..525bff667a52 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -41,11 +41,11 @@ kecho := $($(quiet)kecho)
41### 41###
42# filechk is used to check if the content of a generated file is updated. 42# filechk is used to check if the content of a generated file is updated.
43# Sample usage: 43# Sample usage:
44# define filechk_sample 44#
45# echo $KERNELRELEASE 45# filechk_sample = echo $(KERNELRELEASE)
46# endef 46# version.h: FORCE
47# version.h : Makefile
48# $(call filechk,sample) 47# $(call filechk,sample)
48#
49# The rule defined shall write to stdout the content of the new file. 49# The rule defined shall write to stdout the content of the new file.
50# The existing file will be compared with the new one. 50# The existing file will be compared with the new one.
51# - If no file exist it is created 51# - If no file exist it is created
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index ec204fa54c9a..679e62e5a15c 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -201,9 +201,7 @@ HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
201$(obj)/gconf.o: $(obj)/.gconf-cfg 201$(obj)/gconf.o: $(obj)/.gconf-cfg
202 202
203# check if necessary packages are available, and configure build flags 203# check if necessary packages are available, and configure build flags
204define filechk_conf_cfg 204filechk_conf_cfg = $(CONFIG_SHELL) $<
205 $(CONFIG_SHELL) $<
206endef
207 205
208$(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE 206$(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE
209 $(call filechk,conf_cfg) 207 $(call filechk,conf_cfg)