Commit e19b7cee020441dd690613d223aed7abb0bcda81

Authored by Uwe Kleine-König
Committed by Michal Marek
1 parent 76bee23411

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>

Showing 14 changed files with 15 additions and 19 deletions Side-by-side Diff

samples/bpf/Makefile
... ... @@ -119,10 +119,10 @@
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
samples/connector/Makefile
... ... @@ -13,5 +13,5 @@
13 13 all: modules
14 14  
15 15 modules clean:
16   - $(MAKE) -C ../.. SUBDIRS=$(PWD) $@
  16 + $(MAKE) -C ../.. SUBDIRS=$(CURDIR) $@
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  
... ... @@ -3,7 +3,7 @@
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  
tools/lib/api/Makefile
... ... @@ -2,7 +2,7 @@
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))
tools/lib/bpf/Makefile
... ... @@ -7,7 +7,7 @@
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))
tools/lib/lockdep/Makefile
... ... @@ -50,7 +50,7 @@
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))
tools/lib/subcmd/Makefile
... ... @@ -2,7 +2,7 @@
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))
tools/lib/traceevent/Makefile
... ... @@ -86,7 +86,7 @@
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))
tools/objtool/Makefile
... ... @@ -11,12 +11,12 @@
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
tools/perf/Makefile.perf
... ... @@ -94,7 +94,7 @@
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
tools/perf/tests/make
... ... @@ -42,7 +42,7 @@
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
tools/power/cpupower/Makefile
... ... @@ -108,9 +108,6 @@
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
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")
... ... @@ -9,7 +8,7 @@
9 8 endif
10 9  
11 10 default:
12   - $(MAKE) -C $(KDIR) M=$(PWD)
  11 + $(MAKE) -C $(KDIR) M=$(CURDIR)
13 12  
14 13 clean:
15 14 - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c