summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-03-03 15:55:34 +0700
committerhathach <[email protected]>2023-03-03 15:55:34 +0700
commit9a8a9359e40c93c187743a469f3d984dbf2f6413 (patch)
tree9243bc859ce46188e6175159b14ff68cdfa26fa4 /tools
parente92583ffd73d5307b918be2e4c7e39b978a804ed (diff)
use make abspath intead of shell realpath
Diffstat (limited to 'tools')
-rw-r--r--tools/top.mk11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/top.mk b/tools/top.mk
index af8d698f5..2800f9571 100644
--- a/tools/top.mk
+++ b/tools/top.mk
@@ -26,20 +26,21 @@ THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
# strip off /tools/top.mk to get for example ../../..
TOP := $(patsubst %/tools/top.mk,%,$(THIS_MAKEFILE))
-#$(info top.mk: Initial TOP=$(TOP))
+$(info top.mk: Initial TOP=$(TOP))
# Set TOP to an absolute path, for example /tinyUSB (from ../../..)
ifeq ($(CMDEXE),1)
TOP := $(subst \,/,$(shell for %%i in ( $(TOP) ) do echo %%~fi))
else
-TOP := $(shell realpath $(TOP))
+TOP := $(abspath $(TOP))
endif
-#$(info top.mk: Top directory is $(TOP))
+
+$(info top.mk: Top directory is $(TOP))
# Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos
ifeq ($(CMDEXE),1)
CURRENT_PATH := $(subst $(TOP)/,,$(subst \,/,$(shell echo %CD%)))
else
-CURRENT_PATH := $(shell realpath --relative-to=$(TOP) `pwd`)
+CURRENT_PATH = $(subst $(TOP)/,,$(abspath .))
endif
-#$(info top.mk: Path from top is $(CURRENT_PATH))
+$(info top.mk: CURRENT_PATH = $(CURRENT_PATH))