Commit e19b7cee authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Michal Marek

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
parent 76bee234
...@@ -119,10 +119,10 @@ CLANG ?= clang ...@@ -119,10 +119,10 @@ CLANG ?= clang
# Trick to allow make to be run from this directory # Trick to allow make to be run from this directory
all: all:
$(MAKE) -C ../../ $$PWD/ $(MAKE) -C ../../ $(CURDIR)/
clean: clean:
$(MAKE) -C ../../ M=$$PWD clean $(MAKE) -C ../../ M=$(CURDIR) clean
@rm -f *~ @rm -f *~
# Verify LLVM compiler tools are available and bpf target is supported by llc # Verify LLVM compiler tools are available and bpf target is supported by llc
......
...@@ -13,4 +13,4 @@ HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include ...@@ -13,4 +13,4 @@ HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
all: modules all: modules
modules clean: modules clean:
$(MAKE) -C ../.. SUBDIRS=$(PWD) $@ $(MAKE) -C ../.. SUBDIRS=$(CURDIR) $@
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
endif endif
......
...@@ -3,7 +3,7 @@ include ../scripts/Makefile.include ...@@ -3,7 +3,7 @@ include ../scripts/Makefile.include
bindir ?= /usr/bin bindir ?= /usr/bin
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
endif endif
......
...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include ...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include
include ../../scripts/utilities.mak # QUIET_CLEAN include ../../scripts/utilities.mak # QUIET_CLEAN
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -7,7 +7,7 @@ BPF_EXTRAVERSION = 1 ...@@ -7,7 +7,7 @@ BPF_EXTRAVERSION = 1
MAKEFLAGS += --no-print-directory MAKEFLAGS += --no-print-directory
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -50,7 +50,7 @@ ifndef VERBOSE ...@@ -50,7 +50,7 @@ ifndef VERBOSE
endif endif
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include ...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include
include ../../scripts/utilities.mak # QUIET_CLEAN include ../../scripts/utilities.mak # QUIET_CLEAN
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -86,7 +86,7 @@ ifndef VERBOSE ...@@ -86,7 +86,7 @@ ifndef VERBOSE
endif endif
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -11,12 +11,12 @@ LD = ld ...@@ -11,12 +11,12 @@ LD = ld
AR = ar AR = ar
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
endif endif
SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/
LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(PWD)/) LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/)
LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a
OBJTOOL := $(OUTPUT)objtool OBJTOOL := $(OUTPUT)objtool
......
...@@ -94,7 +94,7 @@ LC_NUMERIC=C ...@@ -94,7 +94,7 @@ LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC export LC_COLLATE LC_NUMERIC
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
endif endif
......
...@@ -42,7 +42,7 @@ LC_NUMERIC=C ...@@ -42,7 +42,7 @@ LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC export LC_COLLATE LC_NUMERIC
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
endif endif
......
...@@ -108,9 +108,6 @@ MKDIR = mkdir ...@@ -108,9 +108,6 @@ MKDIR = mkdir
# Now we set up the build system # Now we set up the build system
# #
# set up PWD so that older versions of make will work with our build.
PWD = $(shell pwd)
GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;} GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;}
export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
......
obj-m := obj-m :=
KDIR := /lib/modules/$(shell uname -r)/build KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
KMISC := /lib/modules/$(shell uname -r)/cpufrequtils/ KMISC := /lib/modules/$(shell uname -r)/cpufrequtils/
ifeq ("$(CONFIG_X86_TSC)", "y") ifeq ("$(CONFIG_X86_TSC)", "y")
...@@ -9,7 +8,7 @@ ifeq ("$(CONFIG_X86_TSC)", "y") ...@@ -9,7 +8,7 @@ ifeq ("$(CONFIG_X86_TSC)", "y")
endif endif
default: default:
$(MAKE) -C $(KDIR) M=$(PWD) $(MAKE) -C $(KDIR) M=$(CURDIR)
clean: clean:
- rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment