summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorVarriount <Varriount@users.noreply.github.com>2014-11-03 01:51:54 -0500
committerVarriount <Varriount@users.noreply.github.com>2014-11-03 01:51:54 -0500
commit1b4dd6f61e311e774b218173b9b4f47c9a78ac8d (patch)
tree04c84a6b9b478aefd41d42d649632b940de2e41b
parent01b262d8d1dbeb6847f8d60ff03b57eedd142eb4 (diff)
downloadNim-1b4dd6f61e311e774b218173b9b4f47c9a78ac8d.tar.gz
Update buildbat.tmpl
Batch scripts generated by `koch csources` now return proper error codes, and stop when there is an error.
-rw-r--r--tools/niminst/buildbat.tmpl13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/niminst/buildbat.tmpl b/tools/niminst/buildbat.tmpl
index 9a19fc70b..415574273 100644
--- a/tools/niminst/buildbat.tmpl
+++ b/tools/niminst/buildbat.tmpl
@@ -20,6 +20,7 @@ REM call the compiler:
 ECHO %CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
 %CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
 #      linkCmd.add(" " & changeFileExt(f, "o"))
+IF ERRORLEVEL 1 (GOTO:END)
 #    end for
 
 ECHO %LINKER% -o ?{"%BIN_DIR%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS%
@@ -27,4 +28,14 @@ ECHO %LINKER% -o ?{"%BIN_DIR%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS%
 
 #  end block
 
-ECHO SUCCESS
+:END
+IF ERRORLEVEL 1 (
+    ECHO FAILURE
+    ECHO.
+    ECHO CSource compilation failed. Please check that the gcc compiler is in
+    ECHO the PATH environment variable, and that you are calling the batch script
+    ECHO that matches the target architecture of the compiler.
+) ELSE (
+    ECHO SUCCESS
+)
+exit /b %ERRORLEVEL%