Windows build fix for some mingw gnu make situations #1870
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When tools/top.mk finds it is running on Windows, it expects SHELL set to cmd.exe.
Some Windows development environments invoke a mingw version of gnu make with SHELL set to /bin/sh or /bin/bash (either explicitly or by default), in which case tinyUSB make fails when a $(shell...) command feeds DOS syntax to sh. We can't just use sh, as many Windows environments won't have unix utilities like realpath (used by this makefile for sh shell commands).
This fix forces SHELL=cmd.exe on Windows and documents the issue. Also adds additional documentation to help the next person...
With this fix, tinyUSB can be easily built and debugged in environments like NXP's MCUxpresso (import as a makefile project).