Patchwork use CURDIR instead of PWD in Makefile

login
register
about
Submitter Jonathan A. Kollasch
Date 2010-09-28 16:15:06
Message ID <20100928161506.GF19896@tarantulon.kollasch.net>
Download mbox | patch
Permalink /patch/2002/
State Accepted
Commit r5878
Headers show

Comments

Jonathan A. Kollasch - 2010-09-28 16:15:06
As $PWD is not exported by all shells, use make-builtin $(CURDIR)
instead of $(PWD).

Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>
---
Peter Stuge - 2010-09-28 17:13:31
Jonathan A. Kollasch wrote:
> As $PWD is not exported by all shells, use make-builtin $(CURDIR)
> instead of $(PWD).
> 
> Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>

Works fine with my GNU make.

Acked-by: Peter Stuge <peter@stuge.se>
Uwe Hermann - 2010-09-28 21:28:37
On Tue, Sep 28, 2010 at 07:13:31PM +0200, Peter Stuge wrote:
> Jonathan A. Kollasch wrote:
> > As $PWD is not exported by all shells, use make-builtin $(CURDIR)
> > instead of $(PWD).
> > 
> > Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>
> 
> Works fine with my GNU make.
> 
> Acked-by: Peter Stuge <peter@stuge.se>

r5878.


Uwe.

Patch

Index: Makefile
===================================================================
--- Makefile	(revision 5874)
+++ Makefile	(working copy)
@@ -32,7 +32,7 @@ 
 HOSTCXX:=$(CC_real) --hostcxx
 endif
 
-export top := $(PWD)
+export top := $(CURDIR)
 export src := src
 export srck := $(top)/util/kconfig
 export obj ?= build
@@ -196,7 +196,7 @@ 
 			$$(abspath $$(patsubst src/%, \
 					$(obj)/%, \
 					$$(addprefix $(dir $(1)),$$($(type)-y))))))) \
-	$(eval subdirs+=$$(subst $(PWD)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))
+	$(eval subdirs+=$$(subst $(CURDIR)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))
 
 # For each path in $(subdirs) call includemakefiles, passing $(1) as $(3)
 # Repeat until subdirs is empty