]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Makefiles/NmakeSubdirs.bat
BaseTool/VfrCompile: Fix potential memory leak issue
[mirror_edk2.git] / BaseTools / Source / C / Makefiles / NmakeSubdirs.bat
index 8fc4bcdb41b165cbb74ba786f7d327755456b647..816d4fa54ff79b1ee056dd54632d39355b8530e4 100644 (file)
@@ -1,17 +1,19 @@
 @REM ## @file\r
+@REM # Makefile\r
 @REM #\r
-@REM # Copyright (c) 2007 - 2010, Intel Corporation\r
-@REM # All rights reserved. This program and the accompanying materials\r
+@REM # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+@REM # This program and the accompanying materials\r
 @REM # are licensed and made available under the terms and conditions of the BSD License\r
 @REM # which accompanies this distribution.    The full text of the license may be found at\r
 @REM # http://opensource.org/licenses/bsd-license.php\r
 @REM #\r
 @REM # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-@REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\r
+@REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+@REM # \r
 \r
 @echo off\r
 setlocal\r
+set TOOL_ERROR=0\r
 SET NMAKE_COMMAND=%1\r
 SHIFT\r
 \r
@@ -21,7 +23,10 @@ if "%1"=="" goto success
 ECHO Building %1\r
 pushd %1\r
 nmake %NMAKE_COMMAND%\r
-if ERRORLEVEL 1 goto error\r
+if ERRORLEVEL 1 (\r
+  set /A TOOL_ERROR= %TOOL_ERROR% + %ERRORLEVEL%\r
+  goto error\r
+)\r
 ECHO %1 built successfully (%NMAKE_COMMAND%)\r
 ECHO.\r
 shift\r
@@ -33,8 +38,9 @@ goto exit
 \r
 :error\r
 popd\r
-ENDLOCAL\r
+set /A TOOL_ERROR=%TOOL_ERROR%+%ERRORLEVEL%\r
 ECHO Error while making %1!\r
 VERIFY OTHER 2>NUL\r
 \r
 :exit\r
+exit /B %TOOL_ERROR%\r