Skip to content

Commit

Permalink
updated Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
in4lio committed Nov 28, 2017
1 parent ce15089 commit b777062
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions project/ev3dev-c.sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"name": "Make ev3dev-c library",
"working_dir": "${project_path}/../source/ev3",
"file_regex": "(?:^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$)|(?:^[ ]*File \"(...*?)\", line ([0-9]*))",
"cmd": ["mingw32-make"],
"cmd": ["mingw32-make", "ComSpec=%COMSPEC%"],
"shell": true,
"variants": [
{
Expand All @@ -32,7 +32,7 @@
{
"name": "Make ev3dev-c library - CLEAN",
"working_dir": "${project_path}/../source/ev3",
"cmd": ["mingw32-make", "clean"],
"cmd": ["mingw32-make", "clean", "ComSpec=%COMSPEC%"],
"shell": true
},
{
Expand Down
31 changes: 21 additions & 10 deletions source/ev3/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,29 @@ O = $(O_CXX) $(O_C) $(O_ASM)
# commands
# ---------------------------------

_BASH = 1

ifeq ($(OS),Windows_NT)
ifdef ComSpec
_BASH = 0
endif
endif

ifeq ($(_BASH),0)
# -- cmd
RM = cmd /c del /f
else
# -- sh (MSYS)
RM = rm -rf
endif

# -- wrap compiler arguments
ifeq ($(OS),Windows_NT)
# -- too long command line workaround
define wrap
echo $2 > args
$1 @args
-rm args
-$(RM) args
endef
else
define wrap
Expand All @@ -214,20 +230,15 @@ ifeq ($(SKIP_PP),0)
R := $(R) $(G_H) $(G_C) $(G_CXX)
endif

ifeq ($(OS),Windows_NT)
ifdef ComSpec
ifeq ($(_BASH),0)
# -- cmd
CLEAN = cmd /c del $(subst /,\,$(R))
CLEAN = cmd /c del /f $(subst /,\,$(R))
CLEAN_BIN = cmd /c del /f $(R_BIN)
else
# -- sh (MSYS)
CLEAN = rm -rf $(R)
endif
# -- sh (Linux)
else
CLEAN = rm -rf $(R)
endif

CLEAN_BIN = rm -rf $(R_BIN)
endif

# -- install library
define install
Expand Down

0 comments on commit b777062

Please sign in to comment.