Skip to content

Commit b6404d1

Browse files
committed
clean up top
1 parent 9930863 commit b6404d1

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

tools/top.mk

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,14 @@ CMDEXE := 1
1616
SHELL := cmd.exe
1717
endif
1818

19-
#$(info top.mk: SHELL=$(SHELL))
20-
#$(info top.mk: CMDEXE=$(CMDEXE))
21-
2219
# Set TOP to be the path to get from the current directory (where make was
2320
# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
2421
# the name of this makefile relative to where make was invoked.
2522
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
2623

2724
# strip off /tools/top.mk to get for example ../../..
28-
TOP := $(subst /tools/top.mk,,$(THIS_MAKEFILE))
29-
$(info top.mk: Initial TOP=$(TOP))
30-
31-
# Set TOP to an absolute path, for example /tinyUSB (from ../../..)
32-
ifeq ($(CMDEXE),1)
33-
TOP := $(subst \,/,$(shell for %%i in ( $(TOP) ) do echo %%~fi))
34-
else
35-
TOP := $(abspath $(TOP))
36-
endif
37-
38-
$(info top.mk: Top directory is $(TOP))
25+
# and Set TOP to an absolute path
26+
TOP = $(abspath $(subst /tools/top.mk,,$(THIS_MAKEFILE)))
3927

4028
# Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos
41-
ifeq ($(CMDEXE),1)
42-
CURRENT_PATH := $(subst $(TOP)/,,$(subst \,/,$(shell echo %CD%)))
43-
else
4429
CURRENT_PATH = $(subst $(TOP)/,,$(abspath .))
45-
endif
46-
$(info top.mk: CURRENT_PATH = $(CURRENT_PATH))

0 commit comments

Comments
 (0)