55 lines
1.5 KiB
Batchfile
55 lines
1.5 KiB
Batchfile
@echo off
|
|
rem ===========================================================================
|
|
rem Remove the build output of every build configuration.
|
|
rem
|
|
rem Usage:
|
|
rem clean_all.bat
|
|
rem
|
|
rem Build layout (see config_paths.bat):
|
|
rem build\<Debug^|Release^>\<REC_AUTO^|REC_OFF^|REC_ON^>
|
|
rem
|
|
rem The legacy per-scan-mode roots build\X256_PS and build\X256_MS (used before
|
|
rem the mechanical/phase variants were merged) are removed as a whole as well.
|
|
rem build\output (archived package export) is never touched.
|
|
rem
|
|
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
|
rem ===========================================================================
|
|
setlocal EnableExtensions
|
|
pushd "%~dp0..\.."
|
|
set "FAILED="
|
|
|
|
rem legacy layout: one root per scan mode (contains its own build tree directly)
|
|
for %%S in (X256_PS X256_MS) do (
|
|
call :remove "build\%%S"
|
|
)
|
|
|
|
rem current layout: build\<Debug|Release>\<REC_*>
|
|
for %%T in (Debug Release) do (
|
|
for %%R in (REC_AUTO REC_OFF REC_ON) do (
|
|
call :remove "build\%%T\%%R"
|
|
)
|
|
rem drop the build type root when every configuration is gone
|
|
rmdir "build\%%T" 2>nul
|
|
)
|
|
|
|
echo.
|
|
echo [clean_all] archived package export "build\output" left untouched
|
|
if defined FAILED (
|
|
echo [clean_all] FAILED - some directories could not be removed, close open files and retry
|
|
popd
|
|
exit /b 1
|
|
)
|
|
echo [clean_all] all build configurations removed
|
|
popd
|
|
exit /b 0
|
|
|
|
:remove
|
|
if not exist "%~1" exit /b 0
|
|
echo [clean_all] remove "%~1"
|
|
rmdir /s /q "%~1"
|
|
if exist "%~1" (
|
|
echo [ERROR] cannot remove "%~1"
|
|
set "FAILED=1"
|
|
)
|
|
exit /b 0
|