Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

make use of make variable CURDIR instead of calling pwd

make already provides the current working directory in a variable, so make
use of it instead of forking a shell. Also replace usage of PWD by
CURDIR. PWD is provided by most shells, but not all, so this makes the
build system more robust.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michal Marek <mmarek@suse.com>

authored by

Uwe Kleine-König and committed by
Michal Marek
e19b7cee 76bee234

+15 -19
+2 -2
samples/bpf/Makefile
··· 119 119 120 120 # Trick to allow make to be run from this directory 121 121 all: 122 - $(MAKE) -C ../../ $$PWD/ 122 + $(MAKE) -C ../../ $(CURDIR)/ 123 123 124 124 clean: 125 - $(MAKE) -C ../../ M=$$PWD clean 125 + $(MAKE) -C ../../ M=$(CURDIR) clean 126 126 @rm -f *~ 127 127 128 128 # Verify LLVM compiler tools are available and bpf target is supported by llc
+1 -1
samples/connector/Makefile
··· 13 13 all: modules 14 14 15 15 modules clean: 16 - $(MAKE) -C ../.. SUBDIRS=$(PWD) $@ 16 + $(MAKE) -C ../.. SUBDIRS=$(CURDIR) $@
+1 -1
tools/build/Makefile
··· 1 1 ifeq ($(srctree),) 2 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 2 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 3 3 srctree := $(patsubst %/,%,$(dir $(srctree))) 4 4 endif 5 5
+1 -1
tools/gpio/Makefile
··· 3 3 bindir ?= /usr/bin 4 4 5 5 ifeq ($(srctree),) 6 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 6 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 7 7 srctree := $(patsubst %/,%,$(dir $(srctree))) 8 8 endif 9 9
+1 -1
tools/lib/api/Makefile
··· 2 2 include ../../scripts/utilities.mak # QUIET_CLEAN 3 3 4 4 ifeq ($(srctree),) 5 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 5 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 6 6 srctree := $(patsubst %/,%,$(dir $(srctree))) 7 7 srctree := $(patsubst %/,%,$(dir $(srctree))) 8 8 #$(info Determined 'srctree' to be $(srctree))
+1 -1
tools/lib/bpf/Makefile
··· 7 7 MAKEFLAGS += --no-print-directory 8 8 9 9 ifeq ($(srctree),) 10 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 10 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 11 11 srctree := $(patsubst %/,%,$(dir $(srctree))) 12 12 srctree := $(patsubst %/,%,$(dir $(srctree))) 13 13 #$(info Determined 'srctree' to be $(srctree))
+1 -1
tools/lib/lockdep/Makefile
··· 50 50 endif 51 51 52 52 ifeq ($(srctree),) 53 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 53 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 54 54 srctree := $(patsubst %/,%,$(dir $(srctree))) 55 55 srctree := $(patsubst %/,%,$(dir $(srctree))) 56 56 #$(info Determined 'srctree' to be $(srctree))
+1 -1
tools/lib/subcmd/Makefile
··· 2 2 include ../../scripts/utilities.mak # QUIET_CLEAN 3 3 4 4 ifeq ($(srctree),) 5 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 5 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 6 6 srctree := $(patsubst %/,%,$(dir $(srctree))) 7 7 srctree := $(patsubst %/,%,$(dir $(srctree))) 8 8 #$(info Determined 'srctree' to be $(srctree))
+1 -1
tools/lib/traceevent/Makefile
··· 86 86 endif 87 87 88 88 ifeq ($(srctree),) 89 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 89 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 90 90 srctree := $(patsubst %/,%,$(dir $(srctree))) 91 91 srctree := $(patsubst %/,%,$(dir $(srctree))) 92 92 #$(info Determined 'srctree' to be $(srctree))
+2 -2
tools/objtool/Makefile
··· 11 11 AR = ar 12 12 13 13 ifeq ($(srctree),) 14 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 14 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 15 15 srctree := $(patsubst %/,%,$(dir $(srctree))) 16 16 endif 17 17 18 18 SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ 19 - LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(PWD)/) 19 + LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/) 20 20 LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a 21 21 22 22 OBJTOOL := $(OUTPUT)objtool
+1 -1
tools/perf/Makefile.perf
··· 94 94 export LC_COLLATE LC_NUMERIC 95 95 96 96 ifeq ($(srctree),) 97 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 97 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 98 98 srctree := $(patsubst %/,%,$(dir $(srctree))) 99 99 #$(info Determined 'srctree' to be $(srctree)) 100 100 endif
+1 -1
tools/perf/tests/make
··· 42 42 export LC_COLLATE LC_NUMERIC 43 43 44 44 ifeq ($(srctree),) 45 - srctree := $(patsubst %/,%,$(dir $(shell pwd))) 45 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 46 46 srctree := $(patsubst %/,%,$(dir $(srctree))) 47 47 #$(info Determined 'srctree' to be $(srctree)) 48 48 endif
-3
tools/power/cpupower/Makefile
··· 108 108 # Now we set up the build system 109 109 # 110 110 111 - # set up PWD so that older versions of make will work with our build. 112 - PWD = $(shell pwd) 113 - 114 111 GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;} 115 112 116 113 export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
+1 -2
tools/power/cpupower/debug/kernel/Makefile
··· 1 1 obj-m := 2 2 3 3 KDIR := /lib/modules/$(shell uname -r)/build 4 - PWD := $(shell pwd) 5 4 KMISC := /lib/modules/$(shell uname -r)/cpufrequtils/ 6 5 7 6 ifeq ("$(CONFIG_X86_TSC)", "y") ··· 8 9 endif 9 10 10 11 default: 11 - $(MAKE) -C $(KDIR) M=$(PWD) 12 + $(MAKE) -C $(KDIR) M=$(CURDIR) 12 13 13 14 clean: 14 15 - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c