[coreboot-gerrit] New patch to review for coreboot: codebase: Change makefile $(shell pwd) commands to $(CURDIR)

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Tue Mar 8 21:14:07 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13967

-gerrit

commit df1816538cf4a4124c50a86227becdc66e10e0c1
Author: Martin Roth <martinroth at google.com>
Date:   Tue Mar 8 12:32:40 2016 -0700

    codebase: Change makefile $(shell pwd) commands to $(CURDIR)
    
    - Change the makefile command $(shell pwd) to $(CURDIR) to find the
    current directory without going out to the shell.
    
    Change-Id: I4890eba6129630acd2883b92de77308d39949443
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 payloads/bayou/Makefile                      |  2 +-
 payloads/bayou/util/pbuilder/lzma/Makefile   | 14 +++++++-------
 payloads/coreinfo/Makefile                   |  8 ++++----
 payloads/external/Memtest86Plus/Makefile.inc |  2 +-
 payloads/libpayload/Makefile.inc             |  8 ++++----
 util/bimgtool/Makefile                       |  2 +-
 util/viatool/Makefile                        |  2 +-
 7 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/payloads/bayou/Makefile b/payloads/bayou/Makefile
index 454e8bb..7a4b08b 100644
--- a/payloads/bayou/Makefile
+++ b/payloads/bayou/Makefile
@@ -20,7 +20,7 @@ CONFIG_BUILTIN_LAR=y
 PBUILDER_CONFIG=bayou.xml
 BUILTIN_LAR=builtin.lar
 
-export src := $(shell pwd)
+export src := $(CURDIR)
 export obj := $(src)/build
 
 LIBPAYLOAD_DIR := $(obj)/libpayload
diff --git a/payloads/bayou/util/pbuilder/lzma/Makefile b/payloads/bayou/util/pbuilder/lzma/Makefile
index 5004fd8..02c0b34 100644
--- a/payloads/bayou/util/pbuilder/lzma/Makefile
+++ b/payloads/bayou/util/pbuilder/lzma/Makefile
@@ -30,29 +30,29 @@ $(obj)/util/lzma/:
 	$(Q)mkdir -p $(obj)/util/lzma/
 
 $(obj)/util/lzma/%.o: $(src)/util/lzma/C/7zip/Compress/LZMA/%.cpp
-	$(Q)printf "  HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)printf "  HOSTCXX $(subst $(CURDIR)/,,$(@))\n"
 	$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
 
 $(obj)/util/lzma/%.o: $(src)/util/lzma/C/7zip/Compress/LZ/%.cpp
-	$(Q)printf "  HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)printf "  HOSTCXX $(subst $(CURDIR)/,,$(@))\n"
 	$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
 
 $(obj)/util/lzma/%.o: $(src)/util/lzma/C/7zip/Compress/RangeCoder/%.cpp
-	$(Q)printf "  HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)printf "  HOSTCXX $(subst $(CURDIR)/,,$(@))\n"
 	$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
 
 $(obj)/util/lzma/%.o: $(src)/util/lzma/C/7zip/Decompress/%.cpp
-	$(Q)printf "  HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)printf "  HOSTCXX $(subst $(CURDIR)/,,$(@))\n"
 	$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
 
 $(obj)/util/lzma/%.o: $(src)/util/lzma/C/7zip/Common/%.cpp
-	$(Q)printf "  HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)printf "  HOSTCXX $(subst $(CURDIR)/,,$(@))\n"
 	$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
 
 $(obj)/util/lzma/%.o: $(src)/util/lzma/C/Common/%.cpp
-	$(Q)printf "  HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)printf "  HOSTCXX $(subst $(CURDIR)/,,$(@))\n"
 	$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
 
 $(obj)/util/lzma/%.o: $(src)/util/lzma/%.cc
-	$(Q)printf "  HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)printf "  HOSTCXX $(subst $(CURDIR)/,,$(@))\n"
 	$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile
index f4a897c..ab25bf3 100644
--- a/payloads/coreinfo/Makefile
+++ b/payloads/coreinfo/Makefile
@@ -14,7 +14,7 @@
 ## GNU General Public License for more details.
 ##
 
-src := $(shell pwd)
+src := $(CURDIR)
 srctree := $(src)
 srck := $(src)/../../util/kconfig
 coreinfo_obj := $(src)/build
@@ -88,18 +88,18 @@ include $(src)/.config
 real-all: $(TARGET)
 
 $(TARGET): $(src)/.config $(coreinfo_obj)/config.h $(OBJS) libpayload
-	printf "    LPCC       $(subst $(shell pwd)/,,$(@)) (LINK)\n"
+	printf "    LPCC       $(subst $(CURDIR)/,,$(@)) (LINK)\n"
 	$(LPCC) -o $@ $(OBJS)
 	$(OBJCOPY) --only-keep-debug $@ $(TARGET).debug
 	$(OBJCOPY) --strip-debug $@
 	$(OBJCOPY) --add-gnu-debuglink=$(TARGET).debug $@
 
 $(coreinfo_obj)/%.S.o: $(src)/%.S libpayload
-	printf "    LPAS       $(subst $(shell pwd)/,,$(@))\n"
+	printf "    LPAS       $(subst $(CURDIR)/,,$(@))\n"
 	$(LPAS) -o $@ $<
 
 $(coreinfo_obj)/%.o: $(src)/%.c libpayload
-	printf "    LPCC       $(subst $(shell pwd)/,,$(@))\n"
+	printf "    LPCC       $(subst $(CURDIR)/,,$(@))\n"
 	$(LPCC) $(CFLAGS) -c -o $@ $<
 
 else
diff --git a/payloads/external/Memtest86Plus/Makefile.inc b/payloads/external/Memtest86Plus/Makefile.inc
index ceb1f5c..ee79032 100644
--- a/payloads/external/Memtest86Plus/Makefile.inc
+++ b/payloads/external/Memtest86Plus/Makefile.inc
@@ -14,7 +14,7 @@
 ##
 
 project_name=Memtest86+
-project_dir=$(shell pwd)/memtest86plus
+project_dir=$(CURDIR)/memtest86plus
 project_git_repo=https://review.coreboot.org/memtest86plus
 
 all: build
diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc
index c10718f..a449f7a 100644
--- a/payloads/libpayload/Makefile.inc
+++ b/payloads/libpayload/Makefile.inc
@@ -75,22 +75,22 @@ lib: $$(library-targets) $(obj)/head.o
 extract_nth=$(word $(1), $(subst |, ,$(2)))
 
 #######################################################################
-# Add handler for special include files 
+# Add handler for special include files
 $(call add-special-class,includes)
 includes-handler= \
 		$(if $(wildcard $(1)$(call extract_nth,1,$(2))), \
 			$(eval includes += $(1)$(2)))
 
 $(obj)/libpayload.a: $(foreach class,$(libraries),$$($(class)-objs))
-	printf "    AR         $(subst $(shell pwd)/,,$(@))\n"
+	printf "    AR         $(subst $(CURDIR)/,,$(@))\n"
 	$(AR) rc $@ $^
 
 $(obj)/%.a: $$(%-objs)
-	printf "    AR         $(subst $(shell pwd)/,,$(@))\n"
+	printf "    AR         $(subst $(CURDIR)/,,$(@))\n"
 	$(AR) rc $@ $^
 
 $(obj)/head.o: $(obj)/arch/$(ARCHDIR-y)/head.head.o.o
-	printf "    CP         $(subst $(shell pwd)/,,$(@))\n"
+	printf "    CP         $(subst $(CURDIR)/,,$(@))\n"
 	cp $^ $@
 
 install: real-target
diff --git a/util/bimgtool/Makefile b/util/bimgtool/Makefile
index ca4a9d9..05ddf7d 100644
--- a/util/bimgtool/Makefile
+++ b/util/bimgtool/Makefile
@@ -1,4 +1,4 @@
-obj ?= $(shell pwd)
+obj ?= $(CURDIR)
 
 HOSTCC ?= gcc
 CFLAGS ?= -g
diff --git a/util/viatool/Makefile b/util/viatool/Makefile
index 4d9d0d0..365497a 100644
--- a/util/viatool/Makefile
+++ b/util/viatool/Makefile
@@ -21,7 +21,7 @@ PROGRAM = viatool
 CC      ?= gcc
 INSTALL ?= /usr/bin/install
 PREFIX  ?= /usr/local
-CFLAGS  ?= -O2 -g -Wall -W -I$(shell pwd)
+CFLAGS  ?= -O2 -g -Wall -W -I$(CURDIR)
 LDFLAGS += -lpci -lz
 
 SRCS =  viatool.c \



More information about the coreboot-gerrit mailing list