mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
minor clean up
This commit is contained in:
parent
9b6ef4fcbc
commit
39eb1ce70e
16
tools/top.mk
16
tools/top.mk
@ -6,22 +6,26 @@ endif
|
|||||||
# https://stackoverflow.com/questions/714100/os-detecting-makefile/52062069#52062069
|
# https://stackoverflow.com/questions/714100/os-detecting-makefile/52062069#52062069
|
||||||
ifeq '$(findstring ;,$(PATH))' ';'
|
ifeq '$(findstring ;,$(PATH))' ';'
|
||||||
# PATH contains semicolon - so we're definitely on Windows.
|
# PATH contains semicolon - so we're definitely on Windows.
|
||||||
CMDEXE := 1# makefile shell commands should use syntax for DOS CMD, not unix sh
|
CMDEXE := 1
|
||||||
|
|
||||||
|
# makefile shell commands should use syntax for DOS CMD, not unix sh
|
||||||
# Unfortunately, SHELL may point to sh or bash, which can't accept DOS syntax.
|
# Unfortunately, SHELL may point to sh or bash, which can't accept DOS syntax.
|
||||||
# $(info top.mk: SHELL=$(SHELL))
|
|
||||||
# We can't just use sh, because while sh and/or bash shell may be available,
|
# We can't just use sh, because while sh and/or bash shell may be available,
|
||||||
# many Windows environments won't have utilities like realpath used below, so...
|
# many Windows environments won't have utilities like realpath used below, so...
|
||||||
SHELL := cmd.exe# Force DOS command shell on Windows.
|
# Force DOS command shell on Windows.
|
||||||
|
SHELL := cmd.exe
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#$(info top.mk: SHELL=$(SHELL))
|
#$(info top.mk: SHELL=$(SHELL))
|
||||||
#$(info top.mk: CMDEXE=$(CMDEXE)...)
|
#$(info top.mk: CMDEXE=$(CMDEXE))
|
||||||
|
|
||||||
# Set TOP to be the path to get from the current directory (where make was
|
# 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
|
# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
|
||||||
# the name of this makefile relative to where make was invoked.
|
# the name of this makefile relative to where make was invoked.
|
||||||
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))# this makefile is the one most recently appended to the list of makefiles
|
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
|
||||||
TOP := $(patsubst %/tools/top.mk,%,$(THIS_MAKEFILE))# strip off /tools/top.mk to get for example ../../..
|
|
||||||
|
# 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 ../../..)
|
# Set TOP to an absolute path, for example /tinyUSB (from ../../..)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user