makefile: Simpler build under MinGW. Detect attempt to build under Msys bash shell and issue error message
This commit is contained in:
parent
30d2db2abe
commit
e0b69fa275
3 changed files with 13 additions and 4 deletions
|
@ -10,11 +10,10 @@ rem Individual simulator sources are in .\simulator_name
|
||||||
rem Individual simulator executables are to .\BIN
|
rem Individual simulator executables are to .\BIN
|
||||||
rem
|
rem
|
||||||
rem If needed, define the path for the MINGW bin directory.
|
rem If needed, define the path for the MINGW bin directory.
|
||||||
rem (this should already be set if MINGW was installed correctly)
|
|
||||||
rem
|
rem
|
||||||
gcc -v 1>NUL 2>NUL
|
gcc -v 1>NUL 2>NUL
|
||||||
if ERRORLEVEL 1 path C:\MinGW\bin;%path%
|
if ERRORLEVEL 1 path C:\MinGW\bin;%path%
|
||||||
if not exist BIN mkdir BIN
|
if not exist BIN mkdir BIN
|
||||||
gcc -v 1>NUL 2>NUL
|
gcc -v 1>NUL 2>NUL
|
||||||
if ERRORLEVEL 1 echo "MinGW Environment Unavailable"
|
if ERRORLEVEL 1 echo "MinGW Environment Unavailable"
|
||||||
mingw32-make WIN32=1 -f makefile %*
|
mingw32-make -f makefile %*
|
||||||
|
|
|
@ -5,11 +5,10 @@ rem Individual simulator sources are in .\simulator_name
|
||||||
rem Individual simulator executables are to .\BIN
|
rem Individual simulator executables are to .\BIN
|
||||||
rem
|
rem
|
||||||
rem If needed, define the path for the MINGW bin directory.
|
rem If needed, define the path for the MINGW bin directory.
|
||||||
rem (this should already be set if MINGW was installed correctly)
|
|
||||||
rem
|
rem
|
||||||
gcc -v 1>NUL 2>NUL
|
gcc -v 1>NUL 2>NUL
|
||||||
if ERRORLEVEL 1 path C:\MinGW\bin;%path%
|
if ERRORLEVEL 1 path C:\MinGW\bin;%path%
|
||||||
if not exist BIN mkdir BIN
|
if not exist BIN mkdir BIN
|
||||||
gcc -v 1>NUL 2>NUL
|
gcc -v 1>NUL 2>NUL
|
||||||
if ERRORLEVEL 1 echo "MinGW Environment Unavailable"
|
if ERRORLEVEL 1 echo "MinGW Environment Unavailable"
|
||||||
mingw32-make WIN32=1 NOASYNCH=1 -f makefile %*
|
mingw32-make NOASYNCH=1 -f makefile %*
|
||||||
|
|
11
makefile
11
makefile
|
@ -87,6 +87,17 @@ else
|
||||||
endif
|
endif
|
||||||
find_lib = $(abspath $(strip $(firstword $(foreach dir,$(strip $(LIBPATH)),$(wildcard $(dir)/lib$(1).$(LIBEXT))))))
|
find_lib = $(abspath $(strip $(firstword $(foreach dir,$(strip $(LIBPATH)),$(wildcard $(dir)/lib$(1).$(LIBEXT))))))
|
||||||
find_include = $(abspath $(strip $(firstword $(foreach dir,$(strip $(INCPATH)),$(wildcard $(dir)/$(1).h)))))
|
find_include = $(abspath $(strip $(firstword $(foreach dir,$(strip $(INCPATH)),$(wildcard $(dir)/$(1).h)))))
|
||||||
|
ifneq ($(findstring Windows,$(OS)),)
|
||||||
|
ifeq ($(findstring .exe,$(SHELL))),.exe)
|
||||||
|
# MinGW
|
||||||
|
WIN32 := 1
|
||||||
|
else # Msys or cygwin
|
||||||
|
ifeq (MINGW,$(findstring MINGW,$(shell uname)))
|
||||||
|
$(info *** This makefile can not be used with the Msys bash shell)
|
||||||
|
$(error *** Use build_mingw.bat $(MAKECMDGOALS) from a Windows command prompt)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||||
ifeq ($(GCC),)
|
ifeq ($(GCC),)
|
||||||
ifeq (,$(shell which gcc 2>/dev/null))
|
ifeq (,$(shell which gcc 2>/dev/null))
|
||||||
|
|
Loading…
Add table
Reference in a new issue