kohi icon indicating copy to clipboard operation
kohi copied to clipboard

Automatically locate Make for Windows (build script)

Open blake502 opened this issue 5 months ago • 1 comments

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:

  1. The Path Environment Variable
  2. 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.

blake502 avatar Sep 15 '24 17:09 blake502