From patchwork Wed Aug 21 07:02:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 171927 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp576733ily; Wed, 21 Aug 2019 00:02:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxa4WZbfsDzbA4Ilwt0rtabHbFN40Agsmyt8SyJd3QTO5934hOF2+6yh0OEFJxzr2L0GY7E X-Received: by 2002:aa7:8e18:: with SMTP id c24mr34390981pfr.24.1566370938083; Wed, 21 Aug 2019 00:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566370938; cv=none; d=google.com; s=arc-20160816; b=xJ8l8s7OURjznmFDai61CQ7vBMz/U9NNKUWuQcOUrVydxl2Fkxt/4lu2uU9FDNo7pt 7NAkYiMFak6PdKQ9PH/4wyV5sBtzpob3KX7jSvQKiNsI32cw3r/J4A/rGUQHrwDZZ5SH PYZ4BJU+tiJ/iTS9gYBB7KyepyaHDneyKzHcTmPCzna1SqOJM8JdFsjHEqhzOH0wFXFe k6VhyyM9z58uBU1tmT+DSZmgdMwWvKijoGYeEoMN79/NA6TEk1OqbcU6lbeHDexwrc2S CgB3QdDkX1+v7cKJaQe/rGStghAPnT/or81W3rGKGggPHc8UJcYJZb37R2FeY/daBTSp bOEQ== 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=Z7gvvNxo+7LVHLVYFSIPDzEWxjAUzSyIAekpVsmRCAg=; b=o0NlCb81AnDt1FkaKCDDzXYTKpgLkrFVTVZIiEaJR5NWZowo9TtwwKZvc0MyThUYTO QG0tzvbNfHO70J65N9qvNvReS1kuuggfQW5udxDcLhT1HdBXVt4zcrV6B6GFUu4RZ9C9 jN76EL2j4oiAqHaMXKPD9UZ2JTRjk3ejwKwEueKu5KYmNdh8/6Mbcy/XqDxwQfcKwoXl WDpfcRV7OpKUtViC5gMg5ZcXihiUnm70/1itfN8UM8pIkJrSqtOAIlxrWbqK8Z5BzHa+ 15ObjwITmohMk0EWa6dAE/oVCGuK+j57CMlWqLDUJYdPk8brzfzC+2yruQJClH2fCZ8S EzZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ky+rtDEX; 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 l184si13546555pgd.203.2019.08.21.00.02.17; Wed, 21 Aug 2019 00:02:18 -0700 (PDT) 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=ky+rtDEX; 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 S1728024AbfHUHCQ (ORCPT + 28 others); Wed, 21 Aug 2019 03:02:16 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:35706 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727266AbfHUHCQ (ORCPT ); Wed, 21 Aug 2019 03:02:16 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x7L727v9010350; Wed, 21 Aug 2019 16:02:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x7L727v9010350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566370927; bh=Z7gvvNxo+7LVHLVYFSIPDzEWxjAUzSyIAekpVsmRCAg=; h=From:To:Cc:Subject:Date:From; b=ky+rtDEX3RZk30Dv08vN0ByKpuhHdlvg+4bh3aO2dtvjc0ezCSDp+CmB1B9FoHOb8 ZH7ndb4faWzZFYx3c9csb/0oZzZcMpAfyGFKmVLCU07H20Bs+5RBxiO64sXAcmvg6r Q4smtMUPGzvSYAwdvjEQquvor7KG3Wc37LFrwyOBxIj/ZG8Tl7zeRtbwfPxpd1SxDo r5R7TNAErV7yhXaCUcizgeR3qHvri3TkkBCkNFJiFwH5mEX+QrsKq2Nkzl7afDgTMY V6RZ5C4F4txePGIUmc2HElByEa2kiT6jeYYwUdT18EfHcJDIHJ8jhv2T4BSexG1DwA ey7QblAaDu4Ig== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/4] kbuild: pkg: clean up package files/dirs from the top Makefile Date: Wed, 21 Aug 2019 16:02:02 +0900 Message-Id: <20190821070205.8297-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I am not a big fan of the $(objtree)/ hack for clean-files/clean-dirs. These are created in the top of $(objtree), so let's clean them up from the top Makefile. Signed-off-by: Masahiro Yamada --- Makefile | 6 ++++-- scripts/Makefile | 2 +- scripts/package/Makefile | 9 --------- 3 files changed, 5 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 5d202ad1481a..e88d4fcd5e87 100644 --- a/Makefile +++ b/Makefile @@ -1389,12 +1389,14 @@ CLEAN_FILES += modules.builtin.modinfo # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include/generated \ - arch/$(SRCARCH)/include/generated .tmp_objdiff + arch/$(SRCARCH)/include/generated .tmp_objdiff \ + debian/ snap/ tar-install/ MRPROPER_FILES += .config .config.old .version \ Module.symvers \ signing_key.pem signing_key.priv signing_key.x509 \ x509.genkey extra_certificates signing_key.x509.keyid \ - signing_key.x509.signer vmlinux-gdb.py + signing_key.x509.signer vmlinux-gdb.py \ + *.spec # Directories & files removed with 'make distclean' DISTCLEAN_DIRS += diff --git a/scripts/Makefile b/scripts/Makefile index 16bcb8087899..c42891e10ba3 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -36,4 +36,4 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms subdir-$(CONFIG_SECURITY_SELINUX) += selinux # Let clean descend into subdirs -subdir- += basic dtc gdb kconfig mod package +subdir- += basic dtc gdb kconfig mod diff --git a/scripts/package/Makefile b/scripts/package/Makefile index ca7f46b562a4..a2d8830f54be 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -65,8 +65,6 @@ binrpm-pkg: FORCE +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ $(UTS_MACHINE) -bb $(objtree)/binkernel.spec -clean-files += $(objtree)/*.spec - deb-pkg: FORCE $(MAKE) clean $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian @@ -82,8 +80,6 @@ bindeb-pkg: FORCE intdeb-pkg: FORCE +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb -clean-dirs += $(objtree)/debian/ - # snap-pkg # --------------------------------------------------------------------------- snap-pkg: FORCE @@ -98,17 +94,12 @@ snap-pkg: FORCE cd $(objtree)/snap && \ snapcraft --target-arch=$(UTS_MACHINE) -clean-dirs += $(objtree)/snap/ - # tarball targets # --------------------------------------------------------------------------- tar%pkg: FORCE $(MAKE) -f $(srctree)/Makefile +$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ -clean-dirs += $(objtree)/tar-install/ - - # perf-pkg - generate a source tarball with perf source # --------------------------------------------------------------------------- From patchwork Wed Aug 21 07:02:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 171929 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp576876ily; Wed, 21 Aug 2019 00:02:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWfmS282zfj3fmDDXSwp6H8bRB59l6SAsPumFkD3JE0c9fTlmkQKB1BcIKHW+DT9uH46GE X-Received: by 2002:a17:902:e30f:: with SMTP id cg15mr32744397plb.46.1566370944686; Wed, 21 Aug 2019 00:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566370944; cv=none; d=google.com; s=arc-20160816; b=BCyNRpH5syMWVqu5yYwWic97JlYEXeIdaoRjsNieeuuGxaBsKQBU+jKO/qGoO+t36l xYR6xk4H+W5HtGlfV1ZiAPP3YqMpnfwKoFSLN8IlXqwb7VpG5BMks9omR53LmSmpix0p pgfpIqkJoLz3Uy9sV0wV2yPYrjkSN6ZDWlqspgiK9lhRcaOzYbfYepFZcN6Lw6Ggdc9x GITliwx0jMJkvltBLccx0hulNqGzyZpDHYv3pZS9NFj5jJAFvEzAdNasnwkaxUUKwyKU ShujI6qaXYI4+ljE1eIfnFj+GqaOV4YBQx224jBs04sKeQ5evaGmWw1K+pSiIF/zy/DG O8QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=+clSVecoKH2g25vlDLqxPHel4AoAmLlsWAj659naMc0=; b=pjBd7XbFR0K252U5v7nGHUTAR8QUhHx5+fZtZ7Y75la6ne8xLauwsk0wpa8MH1Me/w cRt4FHBJDZxnGSHcCmorCa4g2Du3Lsp5/M6rNtxu/6OHgww7+lgf0DW9BWzNH+W7mYaY ql/Sxy7dMqUWn+sGluSchKSmtlxbAuHoJ9LFpl68XXkzdo8ZLDxLSCOLhb6CZhI8HCnt nQuJvTqLyRYuouK6EoDDo6bCa2NqQrVpFuznn/HVe2NBzA97poXRVcXJ89DdYIq5tI3M J6EP0P3sTCNL2RfUO+KHUEc6z3hpxF6K1L+ZOjgNdxMsSsPWrPx864NMZs8pKGMwlKY0 +fIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ZlF5mMCu; 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 ce18si1728692pjb.70.2019.08.21.00.02.24; Wed, 21 Aug 2019 00:02:24 -0700 (PDT) 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=ZlF5mMCu; 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 S1728097AbfHUHCX (ORCPT + 28 others); Wed, 21 Aug 2019 03:02:23 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:35875 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727283AbfHUHCU (ORCPT ); Wed, 21 Aug 2019 03:02:20 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x7L727vA010350; Wed, 21 Aug 2019 16:02:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x7L727vA010350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566370928; bh=+clSVecoKH2g25vlDLqxPHel4AoAmLlsWAj659naMc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZlF5mMCucHptFuOC2iNrbVpnU9EjmYxjDnCd1Kezt2jBAxVUpp6+bZmA1a+0mE0CZ Zf2/JKR36Ec8Ss6S7yCraGKNASZju5zFZNjXRUwDw0sbfW6njnfeYpL19SnE/Rfgs4 LHJ3Uk9uGbZX1woevT6xZoE7Mku7jM2BNWeefpY+uAz7QfDmG2xQBYR6dynYxMGbhe LpANOf9+wsXZk/Kn8pCzdwvR2eFwIu9Pd3CBaSb6xxhS+6IXfvTmOl/mpfpaZwRB3Q FuDJC6kNh9o8e+2GzT1qFs/Vw5gE3SqmNiI982PAZI0r9u6+ZUUucDKO0FDX9j7TuR 8Eaq0AHZdoRJg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] kbuild: pkg: add package targets to PHONY instead of FORCE Date: Wed, 21 Aug 2019 16:02:03 +0900 Message-Id: <20190821070205.8297-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821070205.8297-1-yamada.masahiro@socionext.com> References: <20190821070205.8297-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These are not real targets. Adding them to PHONY is preferred. Signed-off-by: Masahiro Yamada --- scripts/package/Makefile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/scripts/package/Makefile b/scripts/package/Makefile index a2d8830f54be..407189d9942a 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -50,7 +50,8 @@ rm -f $(objtree)/.scmversion # rpm-pkg # --------------------------------------------------------------------------- -rpm-pkg: FORCE +PHONY += rpm-pkg +rpm-pkg: $(MAKE) clean $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec $(call cmd,src_tar,$(KERNELPATH),kernel.spec) @@ -59,13 +60,15 @@ rpm-pkg: FORCE # binrpm-pkg # --------------------------------------------------------------------------- -binrpm-pkg: FORCE +PHONY += binrpm-pkg +binrpm-pkg: $(MAKE) -f $(srctree)/Makefile $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ $(UTS_MACHINE) -bb $(objtree)/binkernel.spec -deb-pkg: FORCE +PHONY += deb-pkg +deb-pkg: $(MAKE) clean $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian $(call cmd,src_tar,$(KDEB_SOURCENAME)) @@ -73,16 +76,19 @@ deb-pkg: FORCE mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -i.git -us -uc -bindeb-pkg: FORCE +PHONY += bindeb-pkg +bindeb-pkg: $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc -intdeb-pkg: FORCE +PHONY += intdeb-pkg +intdeb-pkg: +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb # snap-pkg # --------------------------------------------------------------------------- -snap-pkg: FORCE +PHONY += snap-pkg +snap-pkg: rm -rf $(objtree)/snap mkdir $(objtree)/snap $(MAKE) clean @@ -96,7 +102,9 @@ snap-pkg: FORCE # tarball targets # --------------------------------------------------------------------------- -tar%pkg: FORCE +tar-pkgs := tar-pkg targz-pkg tarbz2-pkg tarxz-pkg +PHONY += $(tar-pkgs) +$(tar-pkgs): $(MAKE) -f $(srctree)/Makefile +$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ @@ -124,12 +132,15 @@ $(if $(findstring xz,$@),xz, \ $(error unknown target $@)))) \ -f -9 $(perf-tar).tar) -perf-%pkg: FORCE +perf-tar-pkgs := perf-tar-src-pkg perf-targz-src-pkg perf-tarbz2-src-pkg perf-tarxz-src-pkg +PHONY += $(perf-tar-pkgs) +$(perf-tar-pkgs): $(call cmd,perf_tar) # Help text displayed when executing 'make help' # --------------------------------------------------------------------------- -help: FORCE +PHONY += help +help: @echo ' rpm-pkg - Build both source and binary RPM kernel packages' @echo ' binrpm-pkg - Build only the binary kernel RPM package' @echo ' deb-pkg - Build both source and binary deb kernel packages' From patchwork Wed Aug 21 07:02:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 171931 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp579030ily; Wed, 21 Aug 2019 00:04:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKnVyfFeLs/wMhoy8sCRlIJXUiQrKNGVtM3Xi/2lurM9M2UtgXdU+OiNkCfwoArZpwZwoy X-Received: by 2002:a17:90a:fa82:: with SMTP id cu2mr3937428pjb.85.1566371071658; Wed, 21 Aug 2019 00:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566371071; cv=none; d=google.com; s=arc-20160816; b=DJfFDlVg95I57em4J4ZzUviKpTkNqUvbr7P2lmDoQVDcV/LlLrclPQT/7qgkuWTopn 9qJoyItlUomJE6bme+MbvryvcWdC3lyF+uVlF/3xKfu9dRF+FK+zWU70oli0euWv9oWL qk5S7E6ZLfwvauixAdnnlxhHhjDNbw+HC0R9KKSh2uLqFEdh4davGBQ/vEiSoGFpVlG2 zxdZMAmXBgrILkCSorzPBea/orzX4tM0/XTQATB/QNzeZlctuUWEDmZeY4QFWxw/AsG8 1lKM5BlJbJ5dVVeDnSJgnbB9agOURV5al52SYzLWvEk0r/INpWvSEwS0JOfWzXfp4cxt i3Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=RaFKffSw+PipHQQxACqqSUGOlGcAb1Ci/wYUrlHdarU=; b=aC7fmYcGnKZRYTAtciCU2I6SZtfqbv9zN1d9AgmwSrX8pLqQr/WlAmws2WGmpm/4ow 2bFOmEZYd6ek28Yzi2eBrydsw5hfOL1NngucyHqhUDsz0LLq7TDBJI2oKQUh52gCrXZ+ 55yRfiCssLv9DeKIiqWo8tqe/vTUhegxHtiOiMDX20Ek8j9vm0wAnoPe4RttEg6tI8Fu 4ywi5vpkMqH5+659pzAOzS7TrTY4ie+Yz8LSafISxr60dRzcdXi/ZrAKpkB/fMCDKyUF sW1x0F0noXT5y0wQnfAO9Nn17WMvuYcjkUNfsPhrjIkW2wM/4SGATxJBIuoBdtqlg1i7 FWzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oMNSV3F9; 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 d8si9877199pls.0.2019.08.21.00.04.31; Wed, 21 Aug 2019 00:04:31 -0700 (PDT) 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=oMNSV3F9; 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 S1727972AbfHUHEa (ORCPT + 28 others); Wed, 21 Aug 2019 03:04:30 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:39557 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbfHUHEa (ORCPT ); Wed, 21 Aug 2019 03:04:30 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x7L727vB010350; Wed, 21 Aug 2019 16:02:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x7L727vB010350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566370932; bh=RaFKffSw+PipHQQxACqqSUGOlGcAb1Ci/wYUrlHdarU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oMNSV3F9SR5IxWOnFaL2EymiVkvsLtY4gtmfulltW89fku6upTrhdpOsjWYXOk4nA GyvFMFUYjx3vcXqvqFSnSFS2RZeRBsZsxetEskDCQZMK3MAP7Dn9vAiCrcxOBpSPjC VCgJRqPLx5J+QvD3mpeJZNvd7gcjzWfI15RUAnO5kod135kO89A3rzpIaNpFYS3ZUi 6kaigjogibAHpzqR6nb0MQeqX8N3JAKbgw8LLiLi3sjQ9R9+8oNwfIOxozO89WTC4Z mRA1Qk0htQxpNEnHrvrkRZo6B+bwmjbUqWH152F9N3wvHI8Y10fkv1xYFAxwZPdiDX yvY5bSruvZGVg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Heiko Carstens , Jonathan Corbet , Michal Marek , Sam Ravnborg , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] kbuild: pkg: rename scripts/package/Makefile to scripts/Makefile.package Date: Wed, 21 Aug 2019 16:02:04 +0900 Message-Id: <20190821070205.8297-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821070205.8297-1-yamada.masahiro@socionext.com> References: <20190821070205.8297-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org scripts/package/Makefile does not use $(obj) or $(src) at all. It actually generates files and directories in the top of $(objtree). I do not see much sense in descending into scripts/package/. Signed-off-by: Masahiro Yamada --- Documentation/kbuild/makefiles.rst | 16 ++++------------ Makefile | 8 +++----- scripts/Makefile.clean | 14 +------------- scripts/{package/Makefile => Makefile.package} | 5 ++++- scripts/kconfig/Makefile | 2 +- usr/include/Makefile | 4 +--- 6 files changed, 14 insertions(+), 35 deletions(-) rename scripts/{package/Makefile => Makefile.package} (99%) -- 2.17.1 diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst index 68ed20ef37dd..78aa51a6fcd4 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst @@ -765,7 +765,8 @@ Files matching the patterns "*.[oas]", "*.ko", plus some additional files generated by kbuild are deleted all over the kernel src tree when "make clean" is executed. -Additional files can be specified in kbuild makefiles by use of $(clean-files). +Additional files or directories can be specified in kbuild makefiles by use of +$(clean-files). Example:: @@ -776,17 +777,8 @@ When executing "make clean", the file "crc32table.h" will be deleted. Kbuild will assume files to be in the same relative directory as the Makefile, except if prefixed with $(objtree). -To delete a directory hierarchy use: - - Example:: - - #scripts/package/Makefile - clean-dirs := $(objtree)/debian/ - -This will delete the directory debian in the toplevel directory, including all -subdirectories. - -To exclude certain files from make clean, use the $(no-clean-files) variable. +To exclude certain files or directories from make clean, use the +$(no-clean-files) variable. Usually kbuild descends down in subdirectories due to "obj-* := dir/", but in the architecture makefiles where the kbuild infrastructure diff --git a/Makefile b/Makefile index e88d4fcd5e87..ec2a6b85a0fa 100644 --- a/Makefile +++ b/Makefile @@ -1448,13 +1448,11 @@ distclean: mrproper # Packaging of the kernel to various formats # --------------------------------------------------------------------------- -package-dir := scripts/package %src-pkg: FORCE - $(Q)$(MAKE) $(build)=$(package-dir) $@ + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@ %pkg: include/config/kernel.release FORCE - $(Q)$(MAKE) $(build)=$(package-dir) $@ - + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@ # Brief documentation of the typical targets used # --------------------------------------------------------------------------- @@ -1526,7 +1524,7 @@ help: @echo ' or "cd tools; make help"' @echo '' @echo 'Kernel packaging:' - @$(MAKE) $(build)=$(package-dir) help + @$(MAKE) -f $(srctree)/scripts/Makefile.package help @echo '' @echo 'Documentation targets:' @$(MAKE) -f $(srctree)/Documentation/Makefile dochelp diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 0b80e3207b20..798e8717c1d9 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -52,26 +52,14 @@ __clean-files := $(wildcard \ $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \ $(filter $(objtree)/%, $(__clean-files))) -# same as clean-files - -__clean-dirs := $(wildcard \ - $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(clean-dirs))) \ - $(filter $(objtree)/%, $(clean-dirs))) - # ========================================================================== quiet_cmd_clean = CLEAN $(obj) - cmd_clean = rm -f $(__clean-files) -quiet_cmd_cleandir = CLEAN $(__clean-dirs) - cmd_cleandir = rm -rf $(__clean-dirs) - + cmd_clean = rm -rf $(__clean-files) __clean: $(subdir-ymn) ifneq ($(strip $(__clean-files)),) +$(call cmd,clean) -endif -ifneq ($(strip $(__clean-dirs)),) - +$(call cmd,cleandir) endif @: diff --git a/scripts/package/Makefile b/scripts/Makefile.package similarity index 99% rename from scripts/package/Makefile rename to scripts/Makefile.package index 407189d9942a..56eadcc48d46 100644 --- a/scripts/package/Makefile +++ b/scripts/Makefile.package @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only # Makefile for the different targets used to generate full packages of a kernel -# It uses the generic clean infrastructure of kbuild + +include $(srctree)/scripts/Kbuild.include # RPM target # --------------------------------------------------------------------------- @@ -154,3 +155,5 @@ help: @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball' @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball' @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball' + +.PHONY: $(PHONY) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7656e1137b6b..bed7a5a2fbe9 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -114,7 +114,7 @@ testconfig: $(obj)/conf $(PYTHON3) -B -m pytest $(srctree)/$(src)/tests \ -o cache_dir=$(abspath $(obj)/tests/.cache) \ $(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no) -clean-dirs += tests/.cache +clean-files += tests/.cache # Help text used by make help help: diff --git a/usr/include/Makefile b/usr/include/Makefile index 1fb6abe29b2f..05c71ef42f51 100644 --- a/usr/include/Makefile +++ b/usr/include/Makefile @@ -115,6 +115,4 @@ header-test-y += $(filter-out $(header-test-), \ $(patsubst $(obj)/%,%, $(wildcard \ $(addprefix $(obj)/, *.h */*.h */*/*.h */*/*/*.h)))) -# For GNU Make <= 4.2.1, $(wildcard $(obj)/*/) matches to not only directories -# but also regular files. Use $(filter %/, ...) just in case. -clean-dirs += $(patsubst $(obj)/%/,%,$(filter %/, $(wildcard $(obj)/*/))) +clean-files += $(filter-out Makefile, $(notdir $(wildcard $(obj)/*))) From patchwork Wed Aug 21 07:02:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 171928 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp576804ily; Wed, 21 Aug 2019 00:02:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8IiJol7l2j+4dwEQJCx0ZVs3DZ5q73jGo+e0VtUnrE8U9a0gar2dGyWGiz2hUeskurukQ X-Received: by 2002:a63:c03:: with SMTP id b3mr28597674pgl.23.1566370941420; Wed, 21 Aug 2019 00:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566370941; cv=none; d=google.com; s=arc-20160816; b=iGaCl0RqJIkOyCftC3kj+19aIuJcRuRprKVsUlG1CkwkrZwpRpTQxk8UM1w+znzoBr MNwK1AM7nGJcleNFSUMmE3EXjwlrsC32HyrRoXb3IF8iI3gQIedkjquYlaJzLM+22nJP z1cql0Q1IMseCH9nr30R/wITdwLjAaAPk+86KeqA+riTs0YU/z4k96Cz7Igz64an9FTl 15FIqliuclmlW6I8/js3xeDjowlmZrMiRLrN13n3soTn4EHPHVB1hC9w5biZWbWtaWKT T4iiocaCXRUzJQZaZutpE3L63N8dTJzdeIzKdeXFpIhh9OSqwSPE32IMmmh7OF5tRgp/ wI/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=TA/zbA2DSALzdXaU6Ddb7Mv6d9woV6++8wrK6WyUiu8=; b=M4P9VMwidGXlnaOairYHBvdfcjR/avksbWOvGHPopLBrKdDXCCPeMXRlkJGdcZRhVA ydcAZ6+KleH1WuO8GyghtYVvm0cHqBDJQpFlpo5NwChtVD8iOtZRvvUDPWDUzJMh0ndu dgC/ZudYH/XPhJTd6R3rIZrrqEqOSWC/F2N5tMysURU6OUklzdo79el1DnOtVGe2rjyI sQShMThtJ+k4M0r5a/jSVdcGhFsCjyDSZWKRieqY4x7bxMGQ3NIEU3LGkUpM/CwLQjID A361EjhndFjbF7zYr5NVuXRxozfX2upWEZUc9wAgmVIpr86ks1iPK4TukdDPoroE67FY DIzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=O79tJqAS; 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 p22si14119677pli.255.2019.08.21.00.02.21; Wed, 21 Aug 2019 00:02:21 -0700 (PDT) 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=O79tJqAS; 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 S1728065AbfHUHCT (ORCPT + 28 others); Wed, 21 Aug 2019 03:02:19 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:35857 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727266AbfHUHCT (ORCPT ); Wed, 21 Aug 2019 03:02:19 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x7L727vC010350; Wed, 21 Aug 2019 16:02:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x7L727vC010350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566370933; bh=TA/zbA2DSALzdXaU6Ddb7Mv6d9woV6++8wrK6WyUiu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O79tJqASw472VpGe7Z+6TJ2h8ISo4UlOS4IQMB2etcEVSTgPUeoQ74NLgmTajpJCF 6Zg+S3IHflNqo+N6C/zUcbB38lIwjaM2fwTQwVBvDYiwiw5+Uok7gAXqc447zmvcBW 6BSRX4X+jO8Z0cOgjBEZ2+sRV+UOmc6jQxxSOR7rLUxBUZ9xKUa4CoguUmT2qDc4F3 zFRmd5cR21kaf7ldQku5+i2Wj6PncLxjBonlPfT1uJO0ymlqbJL5fHNKRBQ4ZNeEHs 0TKQmcYhgMoUdFn+0MXlk+iTtpeHbMcc9ybWD1SUhkirQoe7HjLkxyESKpr8CSZrwm pkCAIP0X40cUw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] kbuild: remove unneeded '+' marker from cmd_clean Date: Wed, 21 Aug 2019 16:02:05 +0900 Message-Id: <20190821070205.8297-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821070205.8297-1-yamada.masahiro@socionext.com> References: <20190821070205.8297-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This '+' was added a long time ago: |commit c23e6bf05f7802e92fd3da69a1ed35e56f9c85bb (HEAD) |Author: Kai Germaschewski |Date: Mon Oct 28 01:16:34 2002 -0600 | | kbuild: Fix a "make -j" warning | |diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean |index 2c843e0380bc..e7c392fd5788 100644 |--- a/scripts/Makefile.clean |+++ b/scripts/Makefile.clean |@@ -42,7 +42,7 @@ quiet_cmd_clean = CLEAN $(obj) | | __clean: $(subdir-ymn) | ifneq ($(strip $(__clean-files) $(clean-rule)),) |- $(call cmd,clean) |+ +$(call cmd,clean) | else | @: | endif At that time, cmd_clean contained '$(clean-rule)', which was able to invoke sub-make. That was why "make -j clean" showed: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. It is not the case any more. cmd_clean now just runs the 'rm' command. The '+' marker is pointless. Signed-off-by: Masahiro Yamada --- scripts/Makefile.clean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 798e8717c1d9..29281a20cf8e 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -59,7 +59,7 @@ quiet_cmd_clean = CLEAN $(obj) __clean: $(subdir-ymn) ifneq ($(strip $(__clean-files)),) - +$(call cmd,clean) + $(call cmd,clean) endif @: