Skip to content

Commit 55838d2

Browse files
committed
Adapt to work with rtools.
1 parent 3e1ed18 commit 55838d2

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

src/tbb/build/windows.inc

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,40 @@
1616
#
1717
#
1818

19-
export SHELL = cmd
20-
2119
ifdef tbb_build_dir
2220
test_dir:=$(tbb_build_dir)
2321
else
2422
test_dir:=.
2523
endif
2624

25+
ifndef rtools
26+
export SHELL = cmd
27+
CMD:=cmd /C
28+
SLASH=\\
29+
RM=cmd /C del /Q /F
30+
RD=cmd /C rmdir
31+
MD=cmd /c mkdir
32+
NUL= nul
33+
else
34+
ifneq ($(COMSPEC), )
35+
# Use comspec env var if present
36+
# Since it represents a full path, quote in case there are some spaces.
37+
CMD:="$(subst \,/,$(COMSPEC))" /C
38+
else
39+
# otherwise rely on cmd being in the path
40+
CMD:=cmd /C
41+
endif
42+
export SHELL = sh.exe
43+
SLASH=/
44+
RD=rmdir
45+
MD=mkdir
46+
RM=rm
47+
NUL= /dev/null
48+
endif
49+
2750
# A convenience wrapper for calls to detect.js.
2851
# $(1) is the full command line for the script, e.g. /minversion icl 12
29-
detect_js = $(shell cmd /C "cscript /nologo /E:jscript $(tbb_root)/build/detect.js $(1)")
52+
detect_js = $(shell $(CMD) "cscript /nologo /E:jscript $(tbb_root)/build/detect.js $(1)")
3053

3154
# TODO give an error if archs doesn't match
3255
ifndef arch
@@ -41,13 +64,7 @@ native_compiler := cl
4164
export compiler ?= cl
4265
debugger ?= devenv /debugexe
4366

44-
CMD=cmd /C
45-
CWD=$(shell cmd /C echo %CD%)
46-
RM=cmd /C del /Q /F
47-
RD=cmd /C rmdir
48-
MD=cmd /c mkdir
49-
SLASH=\\
50-
NUL = nul
67+
CWD=$(shell $(CMD) echo %CD%)
5168

5269
AR=lib
5370
AR_OUTPUT_KEY=/out:
@@ -103,8 +120,8 @@ ifneq ($(filter vc8 vc9,$(runtime)),)
103120
RML.MANIFEST = tbbmanifest.exe.manifest
104121
endif
105122

106-
MAKE_VERSIONS = cmd /C cscript /nologo /E:jscript $(subst \,/,$(tbb_root))/build/version_info_windows.js $(compiler) $(arch) $(subst \,/,"$(VERSION_FLAGS)") > version_string.ver
107-
MAKE_TBBVARS = cmd /C "$(subst /,\,$(tbb_root))\build\generate_tbbvars.bat"
123+
MAKE_VERSIONS = $(CMD) cscript /nologo /E:jscript $(subst \,/,$(tbb_root))/build/version_info_windows.js $(compiler) $(arch) $(subst \,/,"$(VERSION_FLAGS)") > version_string.ver
124+
MAKE_TBBVARS = $(CMD) "$(subst /,\,$(tbb_root))\build\generate_tbbvars.bat"
108125

109126
TEST_LAUNCHER = $(subst /,\,$(tbb_root))\build\test_launcher.bat $(largs)
110127

0 commit comments

Comments
 (0)