diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-01-02 20:16:54 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-01-05 20:22:35 -0500 |
commit | ba97df45581f09a987ffa38444c33ed6a0a9479e (patch) | |
tree | 82ac6f321415ebfad378c249abb1779aeeb95c59 | |
parent | d6e4b3e326d8b44675b9e19534347d97073826aa (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-- | Kbuild | 4 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls/Makefile | 12 | ||||
-rw-r--r-- | arch/s390/tools/Makefile | 7 | ||||
-rw-r--r-- | scripts/Kbuild.include | 8 | ||||
-rw-r--r-- | scripts/kconfig/Makefile | 4 |
6 files changed, 12 insertions, 26 deletions
@@ -26,9 +26,7 @@ timeconst-file := include/generated/timeconst.h | |||
26 | 26 | ||
27 | targets += $(timeconst-file) | 27 | targets += $(timeconst-file) |
28 | 28 | ||
29 | define filechk_gentimeconst | 29 | filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $< |
30 | echo $(CONFIG_HZ) | bc -q $< | ||
31 | endef | ||
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) |
@@ -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 | ||
1044 | define filechk_kernel.release | 1044 | filechk_kernel.release = \ |
1045 | echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" | 1045 | echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" |
1046 | endef | ||
1047 | 1046 | ||
1048 | # Store (new) KERNELRELEASE string in include/config/kernel.release | 1047 | # Store (new) KERNELRELEASE string in include/config/kernel.release |
1049 | include/config/kernel.release: $(srctree)/Makefile FORCE | 1048 | include/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 | ||
27 | define filechk_syshdr | 27 | filechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $< |
28 | $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $< | ||
29 | endef | ||
30 | 28 | ||
31 | define filechk_sysnr | 29 | filechk_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< |
32 | $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< | ||
33 | endef | ||
34 | 30 | ||
35 | define filechk_syscalls | 31 | filechk_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $< |
36 | $(CONFIG_SHELL) '$(systbl)' -S < $< | ||
37 | endef | ||
38 | 32 | ||
39 | syshdr_abi_unistd_32 := common,32 | 33 | syshdr_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 | ||
23 | define filechk_facility-defs.h | 23 | filechk_facility-defs.h = $(obj)/gen_facilities |
24 | $(obj)/gen_facilities | ||
25 | endef | ||
26 | 24 | ||
27 | define filechk_dis-defs.h | 25 | filechk_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 |
29 | endef | ||
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 |
204 | define filechk_conf_cfg | 204 | filechk_conf_cfg = $(CONFIG_SHELL) $< |
205 | $(CONFIG_SHELL) $< | ||
206 | endef | ||
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) |