From 7d24f430c106ab71c7398d28b3e4a334e5019674 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Mon, 20 Nov 2017 12:07:40 +0100 Subject: [PATCH] Use faster built-in commands to build directory names --- rules.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rules.mk b/rules.mk index 19ef6e0..b8d3373 100644 --- a/rules.mk +++ b/rules.mk @@ -38,8 +38,8 @@ ifndef DIR # the symbolic link path (as for BASEDIR), rather than the physical path # So this is necessary for the substitution to happen correctly. Ugh! -BASEDIR:= $(shell cd ./$(BUILD)/..; pwd) -FULLDIR:= $(shell cd ./; pwd) +BASEDIR:= $(realpath $(BUILD)..) +FULLDIR:= $(abspath .) DIR:= $(subst $(BASEDIR),,$(FULLDIR)) PRETTY_DIR:= $(subst $(BASEDIR),[top],$(FULLDIR)) BASENAME_DIR:= $(shell basename $(FULLDIR)) @@ -88,7 +88,7 @@ LINK_WINPUTS= $(patsubst %,"%", $(shell cygpath -aw $(LINK_INPUTS))) endif PRINT_DIR= --no-print-directory RECURSE_BUILDENV=$(BUILDENV) -RECURSE_CMD= $(MAKE) $(PRINT_DIR) TARGET=$(TARGET) BUILDENV=$(RECURSE_BUILDENV) $(RECURSE) COLORIZE= +RECURSE_CMD= $(MAKE) $(PRINT_DIR) TARGET=$(TARGET) BUILDENV=$(RECURSE_BUILDENV) BUILD="$(abspath $(BUILD))/" $(RECURSE) COLORIZE= MAKEFILE_DEPS:= $(MAKEFILE_LIST) NOT_PARALLEL?= .NOTPARALLEL BUILD_LOW?= 0 @@ -232,7 +232,7 @@ product.benchmark: product .ALWAYS # Make from the top-level directory (useful from child directories) top-%: - cd ./$(BUILD); $(MAKE) $* + cd $(BUILD); $(MAKE) $* # Verbose build (show all commands as executed) v-% verbose-%: