summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-03-06 13:03:55 +0700
committerhathach <[email protected]>2023-03-06 13:03:55 +0700
commitb6404d143ed218ad13dce62bd16b9a21de3bba79 (patch)
tree044b031f6d2e0a73df29b5651715a844f01c7e86
parent9930863b412cc4e6b762a1a5aa300d94f2ea0518 (diff)
clean up top
-rw-r--r--tools/top.mk21
1 files changed, 2 insertions, 19 deletions
diff --git a/tools/top.mk b/tools/top.mk
index d2388201a..fdae6337c 100644
--- a/tools/top.mk
+++ b/tools/top.mk
@@ -16,31 +16,14 @@ CMDEXE := 1
SHELL := cmd.exe
endif
-#$(info top.mk: SHELL=$(SHELL))
-#$(info top.mk: CMDEXE=$(CMDEXE))
-
# Set TOP to be the path to get from the current directory (where make was
# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
# the name of this makefile relative to where make was invoked.
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
# strip off /tools/top.mk to get for example ../../..
-TOP := $(subst /tools/top.mk,,$(THIS_MAKEFILE))
-$(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 := $(abspath $(TOP))
-endif
-
-$(info top.mk: Top directory is $(TOP))
+# and Set TOP to an absolute path
+TOP = $(abspath $(subst /tools/top.mk,,$(THIS_MAKEFILE)))
# 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 = $(subst $(TOP)/,,$(abspath .))
-endif
-$(info top.mk: CURRENT_PATH = $(CURRENT_PATH))