Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp310767imu; Wed, 2 Jan 2019 20:49:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/WwWuefk9/f44k0/CU5oX2kd8Sokc0T/3O5mdi3P9P7mJ3IYe0lghe340nrNEVGLkG59OPK X-Received: by 2002:a62:442:: with SMTP id 63mr46153019pfe.156.1546490944756; Wed, 02 Jan 2019 20:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546490944; cv=none; d=google.com; s=arc-20160816; b=qxwc/qT0/PkX4M6YSGfOf+M/HKpO5PS3JYU5m4sP1Yn/3n+O6WAyATDLif6huexH6V Pf4oSw38NipviwGIzYZIR2CxkyYM1NojBgIom/nqJKwRwBmUd95Rz1bsfgzMmw06q+8L zus4eLp+ksc1co7rdDcZY+DO3oYevYSdRkC60Y0H+JFExMdW1+Rg7uHDKFPcNnPqCscd uxSt2EMTbneQF+C3GbeSI1EpUVCVf9wexgBssy3SAeIREdWMupP2ScfhbXxA2Vfy7OtT EJojh+tFX9HTCBro/SoNYHwcOxbDqSeS4mE5PHuSi1/nPSEiDQK4+4UTSQbm2UyUh66p j5zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=xVvKr37H6GF6qKmnraYMODxr3+soLJC30kP+XSvBu4Q=; b=b6gn4yK5jBsjUGjo9jISBJaLcLJdj4zSvsl7DIc+LgJaBesrXm71hXFelTkYSYUznD NyhTnSsvoaZZZ2NsX/zmEzbxMm7bnERU+jdvJ0ZGCBUzxI5rFlQ+rmkVqJ6dPO9VgSCt 2EGG4aXzgEE5h2Cm0wNGnzgik0noEeIv0va15YT5+Kbap+3puEUfIOb1hBdmN9MSvfIe PZeDGBql88tF1D2ogwLmO5fE5EgliKsNb3WNqdECc9cNOcY/hGJsRaP4ghk4L0NcE1VX xXx02ea/Um2+aFEFTGo6r4f0njt8j13uDTkUnZV988vgn4UxMgpPeSFV1ka5aiTXL+80 DLJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="1MGepT/8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si23967315pgw.472.2019.01.02.20.48.49; Wed, 02 Jan 2019 20:49:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="1MGepT/8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbfACBRR (ORCPT + 99 others); Wed, 2 Jan 2019 20:17:17 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:41567 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbfACBRR (ORCPT ); Wed, 2 Jan 2019 20:17:17 -0500 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-09.nifty.com with ESMTP id x031GwhQ001151; Thu, 3 Jan 2019 10:16:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x031GwhQ001151 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1546478219; bh=xVvKr37H6GF6qKmnraYMODxr3+soLJC30kP+XSvBu4Q=; h=From:To:Cc:Subject:Date:From; b=1MGepT/8KHk3KqffyGYPE2najb5nDsMpBt7isiihHrq+xnl+c/xVPMhPSAR4yX4Bn FkFoJ7PZUqTEWINgptEMTZKLnaJ/wpw7PqsvzvhQcBbO0Fn6qfHznDdkeRmYuDMdWm xxz64L0WsdM8/Ltc4agi1Ks+v/ZHQolGOHAEhv0thmzqpP8v+A9c31Wg1dX75Y5d09 bpX+P5RFGqWTgpzzhS2Nurhy2F05YPozHNWnZdrZLIqUghW6kJ5WP4ovFJQjFBtK+M 5QMeCIoRdefUWcjLKfE2FoEMcUO0H0qn03PlgI7mJQXIQWX40UmD1cmZNvKd1XymRA QZeoHtVRgwlDg== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-s390@vger.kernel.org, Heiko Carstens , linux-kernel@vger.kernel.org, Michal Marek , Martin Schwidefsky , Hendrik Brueckner Subject: [PATCH] kbuild: use assignment instead of define ... endef for filechk_* rules Date: Thu, 3 Jan 2019 10:16:54 +0900 Message-Id: <1546478214-20394-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Kbuild | 4 +--- Makefile | 3 +-- arch/s390/kernel/syscalls/Makefile | 12 +++--------- arch/s390/tools/Makefile | 7 ++----- scripts/Kbuild.include | 8 ++++---- scripts/kconfig/Makefile | 4 +--- 6 files changed, 12 insertions(+), 26 deletions(-) diff --git a/Kbuild b/Kbuild index 06b801e..65db5be 100644 --- a/Kbuild +++ b/Kbuild @@ -26,9 +26,7 @@ timeconst-file := include/generated/timeconst.h targets += $(timeconst-file) -define filechk_gentimeconst - echo $(CONFIG_HZ) | bc -q $< -endef +filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $< $(timeconst-file): kernel/time/timeconst.bc FORCE $(call filechk,gentimeconst) diff --git a/Makefile b/Makefile index 62c9890..39355d1 100644 --- a/Makefile +++ b/Makefile @@ -1041,9 +1041,8 @@ PHONY += $(vmlinux-dirs) $(vmlinux-dirs): prepare $(Q)$(MAKE) $(build)=$@ need-builtin=1 -define filechk_kernel.release +filechk_kernel.release = \ echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" -endef # Store (new) KERNELRELEASE string in include/config/kernel.release include/config/kernel.release: $(srctree)/Makefile FORCE diff --git a/arch/s390/kernel/syscalls/Makefile b/arch/s390/kernel/syscalls/Makefile index 4d929ed..b98f250 100644 --- a/arch/s390/kernel/syscalls/Makefile +++ b/arch/s390/kernel/syscalls/Makefile @@ -24,17 +24,11 @@ uapi: $(uapi-hdrs-y) _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" < $< -endef +filechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $< -define filechk_sysnr - $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< -endef +filechk_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< -define filechk_syscalls - $(CONFIG_SHELL) '$(systbl)' -S < $< -endef +filechk_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $< syshdr_abi_unistd_32 := common,32 $(uapi)/unistd_32.h: $(syscall) FORCE diff --git a/arch/s390/tools/Makefile b/arch/s390/tools/Makefile index cf4846a..2342b84 100644 --- a/arch/s390/tools/Makefile +++ b/arch/s390/tools/Makefile @@ -20,13 +20,10 @@ HOSTCFLAGS_gen_opcode_table.o += -Wall $(LINUXINCLUDE) # Ensure output directory exists _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') -define filechk_facility-defs.h - $(obj)/gen_facilities -endef +filechk_facility-defs.h = $(obj)/gen_facilities -define filechk_dis-defs.h +filechk_dis-defs.h = \ $(obj)/gen_opcode_table < $(srctree)/arch/$(ARCH)/tools/opcodes.txt -endef $(kapi)/facility-defs.h: $(obj)/gen_facilities FORCE $(call filechk,facility-defs.h) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 74a3fe7..525bff6 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -41,11 +41,11 @@ kecho := $($(quiet)kecho) ### # filechk is used to check if the content of a generated file is updated. # Sample usage: -# define filechk_sample -# echo $KERNELRELEASE -# endef -# version.h : Makefile +# +# filechk_sample = echo $(KERNELRELEASE) +# version.h: FORCE # $(call filechk,sample) +# # The rule defined shall write to stdout the content of the new file. # The existing file will be compared with the new one. # - If no file exist it is created diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index ec204fa..679e62e 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -201,9 +201,7 @@ HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) $(obj)/gconf.o: $(obj)/.gconf-cfg # check if necessary packages are available, and configure build flags -define filechk_conf_cfg - $(CONFIG_SHELL) $< -endef +filechk_conf_cfg = $(CONFIG_SHELL) $< $(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE $(call filechk,conf_cfg) -- 2.7.4