kohi
kohi copied to clipboard
Automatically locate Make for Windows (build script)
Intended to simplify the updated build documentation for Windows (PR https://github.com/travisvroman/kohi/pull/241), I've added a feature to the Windows build script.
This feature automatically locates make.exe
from either:
- The Path Environment Variable
- The default install location for Make for Windows (
C:\Program Files (x86)\GnuWin32\bin
)
This works by running make -v
(a version check command for make) then checking whether the %errorlevel%
variable is equal to 9009
(which is the error code for MSG_DIR_BAD_COMMAND_OR_FILE
, signifying that make is not found from the system path)
If make is not found from simply running make -v
, then the script attempts to run C:\Program Files (x86)\GnuWin32\bin\make.exe -v
, and checks for the same error 9009
. If make is still not found, the build script aborts.
If this is accepted, the updated build documentation in PR https://github.com/travisvroman/kohi/pull/241 could be simplified to remove the requirement to manually add Make to the system path.
I understand that this may not be the most elegant solution-- But I feel it would be better to add a small amount of complexity to the build script for the sake of greatly simplifying the build documentation.