From patchwork Mon Jul 24 14:20:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Forsman?= X-Patchwork-Id: 9859591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AAE8601A1 for ; Mon, 24 Jul 2017 14:21:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C7B528178 for ; Mon, 24 Jul 2017 14:21:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 013D1283D1; Mon, 24 Jul 2017 14:21:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8998A28558 for ; Mon, 24 Jul 2017 14:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932129AbdGXOVS (ORCPT ); Mon, 24 Jul 2017 10:21:18 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38178 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932079AbdGXOVR (ORCPT ); Mon, 24 Jul 2017 10:21:17 -0400 Received: by mail-wm0-f68.google.com with SMTP id r123so3520469wmb.5 for ; Mon, 24 Jul 2017 07:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZOuTFSR5wxzmnxATHPiUXFrbNvrwfEuKORGqb2/l72I=; b=a/DVjm1FsNgcunnQlksflVEGWsNkCB0QWNJ+pUiSWGc6vOhtTNN/8oH5qhpjbhZuWY 7GnXt0+FE7vqb+KF/DqbkOSxgqpp3jCes1SPsARbkOQZlnMoLRWGl6n61eMnU11qJRPj 7gFp1CIR2EYgEPwU5k1lXcMabNB/NXP/PoJOy3hhddy4dgXRCKSESpAFp9H7Xwm27rMw f7e7G1rNL29A3NzzoU0ryPePgWqng84FhA7phCrEbIOTdIpJhDq43XoReXw6rEeM/45m ySNhCgVXAfLeU47fiU8ib8F+YYupw1BT/o64sts/ST3uF5LHxuTE4TcrtG4B4YNelv08 LCcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZOuTFSR5wxzmnxATHPiUXFrbNvrwfEuKORGqb2/l72I=; b=B+AMoOFgTmHcxzDnuaBJdEpm6bmVJ8uZhzmIrJiaLZufCNMv//mpXzYr63sVAbBSHk Dd9mcmlSiDXhJLh/swokCXLps7Gh6Bx5x5NeSgTAXGP/fnT78tTvsiwr795M8vnemqhq lsXpaxhrl4uBLRkE4MY9wNZlj6Ze2ERw/qt9e8DgKcy3IqM/EvzSJNUyUKxx8Lga9G0w VN7NlN1w6yWSGB9uDKaF4h6WPcCnl9lUZBLni12u6VYKX8wz8alxL3nS6nwxn5cCm+aE urDKsf9WXMBeKIS74Yx3yG4f+SrJ06RB/fZoHxotr1T7yjIkLlOD5trjDb8GkbQTIbmR 3rAw== X-Gm-Message-State: AIVw111+8VAtanv5uGDsn9WB0ks9gtSAhMbTid/P9l66csxYHS3Wgatz S/UzPshDNkeqTIFx X-Received: by 10.80.221.200 with SMTP id x8mr5939165edk.251.1500906076247; Mon, 24 Jul 2017 07:21:16 -0700 (PDT) Received: from localhost (cm-84.208.208.100.getinternet.no. [84.208.208.100]) by smtp.gmail.com with ESMTPSA id n59sm3431593edc.31.2017.07.24.07.21.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jul 2017 07:21:15 -0700 (PDT) From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= To: linux-kbuild@vger.kernel.org Cc: yamada.masahiro@socionext.com, mmarek@suse.com, jan.kiszka@siemens.com, kieran@ksquared.org.uk, =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Subject: [PATCH] kbuild: /bin/pwd -> pwd Date: Mon, 24 Jul 2017 16:20:47 +0200 Message-Id: <20170724142047.3679-1-bjorn.forsman@gmail.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Several places already use pwd and rely on $PATH lookup. Moving the remaining /bin/pwd users over for consistency. Also, a reason for doing /bin/pwd -> pwd instead of the other way around is because I believe build systems should make little assumptions on host filesystem layout. Case in point, we do this kind of patching already in NixOS. Signed-off-by: Bjørn Forsman --- Documentation/ia64/xen.txt | 2 +- Makefile | 10 +++++----- scripts/gdb/linux/Makefile | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/ia64/xen.txt b/Documentation/ia64/xen.txt index c61a99f7c8bb..a12c74ce2773 100644 --- a/Documentation/ia64/xen.txt +++ b/Documentation/ia64/xen.txt @@ -41,7 +41,7 @@ Getting and Building Xen and Dom0 5. make initrd for Dom0/DomU # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \ - O=$(/bin/pwd)/build-linux-2.6.18-xen_ia64 + O=$(pwd)/build-linux-2.6.18-xen_ia64 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \ 2.6.18.8-xen --builtin mptspi --builtin mptbase \ --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \ diff --git a/Makefile b/Makefile index b4fb9a1d1594..64e72eba5701 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ ifneq ($(KBUILD_OUTPUT),) # check that the output directory actually exists saved-output := $(KBUILD_OUTPUT) KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ - && /bin/pwd) + && pwd) $(if $(KBUILD_OUTPUT),, \ $(error failed to create output directory "$(saved-output)")) @@ -978,7 +978,7 @@ ifdef CONFIG_HEADERS_CHECK $(Q)$(MAKE) -f $(srctree)/Makefile headers_check endif ifdef CONFIG_GDB_SCRIPTS - $(Q)ln -fsn `cd $(srctree) && /bin/pwd`/scripts/gdb/vmlinux-gdb.py + $(Q)ln -fsn `cd $(srctree) && pwd`/scripts/gdb/vmlinux-gdb.py endif ifdef CONFIG_TRIM_UNUSED_KSYMS $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ @@ -1237,7 +1237,7 @@ _modinst_: @rm -rf $(MODLIB)/kernel @rm -f $(MODLIB)/source @mkdir -p $(MODLIB)/kernel - @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source + @ln -s `cd $(srctree) && pwd` $(MODLIB)/source @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ @@ -1629,11 +1629,11 @@ image_name: # Clear a bunch of variables before executing the submake tools/: FORCE $(Q)mkdir -p $(objtree)/tools - $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ + $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && pwd) subdir=tools -C $(src)/tools/ tools/%: FORCE $(Q)mkdir -p $(objtree)/tools - $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $* + $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && pwd) subdir=tools -C $(src)/tools/ $* # Single targets # --------------------------------------------------------------------------- diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile index 8b00031f5349..f1ac5db46932 100644 --- a/scripts/gdb/linux/Makefile +++ b/scripts/gdb/linux/Makefile @@ -1,6 +1,6 @@ always := gdb-scripts -SRCTREE := $(shell cd $(srctree) && /bin/pwd) +SRCTREE := $(shell cd $(srctree) && pwd) $(obj)/gdb-scripts: ifneq ($(KBUILD_SRC),)