xparq / NMAKE-Jumpstart

Single-file MSVC/NMAKE "jumpstart" Makefile for building source trees without fuss or extra tooling
0 stars 0 forks source link

Stop the main loop on error from a child NMAKE #20

Closed xparq closed 1 year ago

xparq commented 1 year ago

FWIW (also -> #21!):

nmake /f nonexisting || echo %ERRORLEVEL% -> 0 dir nonexisting || echo %ERRORLEVEL% -> 0 nonexisting || echo %ERRORLEVEL% -> 0...

I can't ever get a non-0 with this idiom on the CMD command line. (Haven't tried in a batch file now, but would be (kinda-sorta, "historic'ly") interesting to find out what the hell...)

This form still works (in the same context), though: nmake /f nonexisting || if errorlevel 1 echo FAILED! Still can't capture & forward the original exit code of the failed process.

But at least this form also works with if: if something nmake /f nonexisting || if errorlevel 1 echo FAILED!