Part of the install for an app I am responsible for, compiles some C code libraries. This is done in a console using GNU Make.
So, as part of the install, a console window pops open, you see the make file output wiz by as it compiles and links, when finished the console window closes and the installer continues.
All good, unless there is a compilation error. Then the make file bugs out and the console window closes before you have a chance to figure out what is happening.
So, what I'd like to happen is have the console window pause with a 'press a key to continue' type functionality, if there is an error from the makefile so that the console stays open. Otherwise, just exit as normal and close the console.
I can't work out how to do this in a GNU Makefile or from a batch file that could run the Make.
this should do the trick:
if not ERRORLEVEL 0 pause
type help if
in DOS for more info on errorlevel usage.
This is what you're looking for:
if ERRORLEVEL 1 pause
If you type
HELP IF
you get this info: ERRORLEVEL number | Specifies a true condition if the last program run returned an exit code equal to or greater than the number specified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With