aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2016-11-22 03:30:26 -0500
committerMichal Marek <mmarek@suse.com>2016-12-11 06:12:56 -0500
commite19b7cee020441dd690613d223aed7abb0bcda81 (patch)
tree148ac04e7634c1e9234275fe82c2f9e22333c00a
parent76bee23411f8510fbf5fc5641bae2c203b726eb6 (diff)
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>
-rw-r--r--samples/bpf/Makefile4
-rw-r--r--samples/connector/Makefile2
-rw-r--r--tools/build/Makefile2
-rw-r--r--tools/gpio/Makefile2
-rw-r--r--tools/lib/api/Makefile2
-rw-r--r--tools/lib/bpf/Makefile2
-rw-r--r--tools/lib/lockdep/Makefile2
-rw-r--r--tools/lib/subcmd/Makefile2
-rw-r--r--tools/lib/traceevent/Makefile2
-rw-r--r--tools/objtool/Makefile4
-rw-r--r--tools/perf/Makefile.perf2
-rw-r--r--tools/perf/tests/make2
-rw-r--r--tools/power/cpupower/Makefile3
-rw-r--r--tools/power/cpupower/debug/kernel/Makefile3
14 files changed, 15 insertions, 19 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 12b7304d55dc..b1e322860a7f 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -119,10 +119,10 @@ CLANG ?= clang
119 119
120# Trick to allow make to be run from this directory 120# Trick to allow make to be run from this directory
121all: 121all:
122 $(MAKE) -C ../../ $$PWD/ 122 $(MAKE) -C ../../ $(CURDIR)/
123 123
124clean: 124clean:
125 $(MAKE) -C ../../ M=$$PWD clean 125 $(MAKE) -C ../../ M=$(CURDIR) clean
126 @rm -f *~ 126 @rm -f *~
127 127
128# Verify LLVM compiler tools are available and bpf target is supported by llc 128# Verify LLVM compiler tools are available and bpf target is supported by llc
diff --git a/samples/connector/Makefile b/samples/connector/Makefile
index 04b9622b6f51..91762d946a53 100644
--- a/samples/connector/Makefile
+++ b/samples/connector/Makefile
@@ -13,4 +13,4 @@ HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
13all: modules 13all: modules
14 14
15modules clean: 15modules clean:
16 $(MAKE) -C ../.. SUBDIRS=$(PWD) $@ 16 $(MAKE) -C ../.. SUBDIRS=$(CURDIR) $@
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 8332959fbca4..aaf7ed329a45 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -1,5 +1,5 @@
1ifeq ($(srctree),) 1ifeq ($(srctree),)
2srctree := $(patsubst %/,%,$(dir $(shell pwd))) 2srctree := $(patsubst %/,%,$(dir $(CURDIR)))
3srctree := $(patsubst %/,%,$(dir $(srctree))) 3srctree := $(patsubst %/,%,$(dir $(srctree)))
4endif 4endif
5 5
diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 250a891e6ef0..b4401536cfa9 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -3,7 +3,7 @@ include ../scripts/Makefile.include
3bindir ?= /usr/bin 3bindir ?= /usr/bin
4 4
5ifeq ($(srctree),) 5ifeq ($(srctree),)
6srctree := $(patsubst %/,%,$(dir $(shell pwd))) 6srctree := $(patsubst %/,%,$(dir $(CURDIR)))
7srctree := $(patsubst %/,%,$(dir $(srctree))) 7srctree := $(patsubst %/,%,$(dir $(srctree)))
8endif 8endif
9 9
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index 0a6fda9837f7..adba83b325d5 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include
2include ../../scripts/utilities.mak # QUIET_CLEAN 2include ../../scripts/utilities.mak # QUIET_CLEAN
3 3
4ifeq ($(srctree),) 4ifeq ($(srctree),)
5srctree := $(patsubst %/,%,$(dir $(shell pwd))) 5srctree := $(patsubst %/,%,$(dir $(CURDIR)))
6srctree := $(patsubst %/,%,$(dir $(srctree))) 6srctree := $(patsubst %/,%,$(dir $(srctree)))
7srctree := $(patsubst %/,%,$(dir $(srctree))) 7srctree := $(patsubst %/,%,$(dir $(srctree)))
8#$(info Determined 'srctree' to be $(srctree)) 8#$(info Determined 'srctree' to be $(srctree))
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 62d89d50fcbd..e2efddf10231 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -7,7 +7,7 @@ BPF_EXTRAVERSION = 1
7MAKEFLAGS += --no-print-directory 7MAKEFLAGS += --no-print-directory
8 8
9ifeq ($(srctree),) 9ifeq ($(srctree),)
10srctree := $(patsubst %/,%,$(dir $(shell pwd))) 10srctree := $(patsubst %/,%,$(dir $(CURDIR)))
11srctree := $(patsubst %/,%,$(dir $(srctree))) 11srctree := $(patsubst %/,%,$(dir $(srctree)))
12srctree := $(patsubst %/,%,$(dir $(srctree))) 12srctree := $(patsubst %/,%,$(dir $(srctree)))
13#$(info Determined 'srctree' to be $(srctree)) 13#$(info Determined 'srctree' to be $(srctree))
diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index 1d57af56814b..3bc0ef9f8923 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -50,7 +50,7 @@ ifndef VERBOSE
50endif 50endif
51 51
52ifeq ($(srctree),) 52ifeq ($(srctree),)
53srctree := $(patsubst %/,%,$(dir $(shell pwd))) 53srctree := $(patsubst %/,%,$(dir $(CURDIR)))
54srctree := $(patsubst %/,%,$(dir $(srctree))) 54srctree := $(patsubst %/,%,$(dir $(srctree)))
55srctree := $(patsubst %/,%,$(dir $(srctree))) 55srctree := $(patsubst %/,%,$(dir $(srctree)))
56#$(info Determined 'srctree' to be $(srctree)) 56#$(info Determined 'srctree' to be $(srctree))
diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
index ce4b7e527566..3f8cc44a0dbd 100644
--- a/tools/lib/subcmd/Makefile
+++ b/tools/lib/subcmd/Makefile
@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include
2include ../../scripts/utilities.mak # QUIET_CLEAN 2include ../../scripts/utilities.mak # QUIET_CLEAN
3 3
4ifeq ($(srctree),) 4ifeq ($(srctree),)
5srctree := $(patsubst %/,%,$(dir $(shell pwd))) 5srctree := $(patsubst %/,%,$(dir $(CURDIR)))
6srctree := $(patsubst %/,%,$(dir $(srctree))) 6srctree := $(patsubst %/,%,$(dir $(srctree)))
7srctree := $(patsubst %/,%,$(dir $(srctree))) 7srctree := $(patsubst %/,%,$(dir $(srctree)))
8#$(info Determined 'srctree' to be $(srctree)) 8#$(info Determined 'srctree' to be $(srctree))
diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 7851df1490e0..938f73cec20d 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -86,7 +86,7 @@ ifndef VERBOSE
86endif 86endif
87 87
88ifeq ($(srctree),) 88ifeq ($(srctree),)
89srctree := $(patsubst %/,%,$(dir $(shell pwd))) 89srctree := $(patsubst %/,%,$(dir $(CURDIR)))
90srctree := $(patsubst %/,%,$(dir $(srctree))) 90srctree := $(patsubst %/,%,$(dir $(srctree)))
91srctree := $(patsubst %/,%,$(dir $(srctree))) 91srctree := $(patsubst %/,%,$(dir $(srctree)))
92#$(info Determined 'srctree' to be $(srctree)) 92#$(info Determined 'srctree' to be $(srctree))
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 041b493ad3ab..27e019c09bd2 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -11,12 +11,12 @@ LD = ld
11AR = ar 11AR = ar
12 12
13ifeq ($(srctree),) 13ifeq ($(srctree),)
14srctree := $(patsubst %/,%,$(dir $(shell pwd))) 14srctree := $(patsubst %/,%,$(dir $(CURDIR)))
15srctree := $(patsubst %/,%,$(dir $(srctree))) 15srctree := $(patsubst %/,%,$(dir $(srctree)))
16endif 16endif
17 17
18SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ 18SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/
19LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(PWD)/) 19LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/)
20LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a 20LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a
21 21
22OBJTOOL := $(OUTPUT)objtool 22OBJTOOL := $(OUTPUT)objtool
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 982d6439bb07..5bdef736a662 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -94,7 +94,7 @@ LC_NUMERIC=C
94export LC_COLLATE LC_NUMERIC 94export LC_COLLATE LC_NUMERIC
95 95
96ifeq ($(srctree),) 96ifeq ($(srctree),)
97srctree := $(patsubst %/,%,$(dir $(shell pwd))) 97srctree := $(patsubst %/,%,$(dir $(CURDIR)))
98srctree := $(patsubst %/,%,$(dir $(srctree))) 98srctree := $(patsubst %/,%,$(dir $(srctree)))
99#$(info Determined 'srctree' to be $(srctree)) 99#$(info Determined 'srctree' to be $(srctree))
100endif 100endif
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 143f4d549769..3482e9f67326 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -42,7 +42,7 @@ LC_NUMERIC=C
42export LC_COLLATE LC_NUMERIC 42export LC_COLLATE LC_NUMERIC
43 43
44ifeq ($(srctree),) 44ifeq ($(srctree),)
45srctree := $(patsubst %/,%,$(dir $(shell pwd))) 45srctree := $(patsubst %/,%,$(dir $(CURDIR)))
46srctree := $(patsubst %/,%,$(dir $(srctree))) 46srctree := $(patsubst %/,%,$(dir $(srctree)))
47#$(info Determined 'srctree' to be $(srctree)) 47#$(info Determined 'srctree' to be $(srctree))
48endif 48endif
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index 8358863259c5..d6e1c02ddcfe 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -108,9 +108,6 @@ MKDIR = mkdir
108# Now we set up the build system 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.
112PWD = $(shell pwd)
113
114GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;} 111GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;}
115 112
116export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS 113export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
diff --git a/tools/power/cpupower/debug/kernel/Makefile b/tools/power/cpupower/debug/kernel/Makefile
index 96b146fe6f8d..a8a6f8eec5c2 100644
--- a/tools/power/cpupower/debug/kernel/Makefile
+++ b/tools/power/cpupower/debug/kernel/Makefile
@@ -1,7 +1,6 @@
1obj-m := 1obj-m :=
2 2
3KDIR := /lib/modules/$(shell uname -r)/build 3KDIR := /lib/modules/$(shell uname -r)/build
4PWD := $(shell pwd)
5KMISC := /lib/modules/$(shell uname -r)/cpufrequtils/ 4KMISC := /lib/modules/$(shell uname -r)/cpufrequtils/
6 5
7ifeq ("$(CONFIG_X86_TSC)", "y") 6ifeq ("$(CONFIG_X86_TSC)", "y")
@@ -9,7 +8,7 @@ ifeq ("$(CONFIG_X86_TSC)", "y")
9endif 8endif
10 9
11default: 10default:
12 $(MAKE) -C $(KDIR) M=$(PWD) 11 $(MAKE) -C $(KDIR) M=$(CURDIR)
13 12
14clean: 13clean:
15 - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c 14 - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c