How do I pause to inspect results of sh commands run by a Makefile?
So, I have a Makefile which runs different commands of how to build S/W. I execute make
from within a MSYS / MinGW enviroment.
I found for example, the sleep <seconds>
command, but this only delays the execution. How can I make it开发者_JS百科 wait for a key being pressed, for example?
You can use the read
command. When you are done you press enter and your script/makefile continues. It's a builtin bash command, so it should work also on MinGW.
My proposition doesn't stop execution but halts and resume display on capable terminals:
Use ctrl-S for halting display, and ctrl-Q for resuming.
You don't need to modify your Makefile.
Pipe the output of the build through more (or less)
e.g.
make <make command line> | more
Or output everything to a file while still watching make progress on screen with your friend tee. I normally prefer this to less or more for bulkier projects.
make <make input arguments> 2>&1 | tee /some/path/build.log
精彩评论