@@ -16,31 +16,14 @@ CMDEXE := 1
16
16
SHELL := cmd.exe
17
17
endif
18
18
19
- # $(info top.mk: SHELL=$(SHELL))
20
- # $(info top.mk: CMDEXE=$(CMDEXE))
21
-
22
19
# Set TOP to be the path to get from the current directory (where make was
23
20
# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
24
21
# the name of this makefile relative to where make was invoked.
25
22
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST ) )
26
23
27
24
# 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 ) ) )
39
27
40
28
# 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
44
29
CURRENT_PATH = $(subst $(TOP ) /,,$(abspath .) )
45
- endif
46
- $(info top.mk : CURRENT_PATH = $(CURRENT_PATH ) )
0 commit comments