Set BinDir=bin
Set ReleaseDir=release
If Exist %BinDir% Rd /s /q %BinDir%
REM Préparation du répertoire final
If Not Exist %ReleaseDir% Mkdir %ReleaseDir%
REM Traitement des cas
If "%1"=="win32" Goto cleanWin32
If "%1"=="psp" Goto cleanPSP
Goto finish

:cleanWin32
REM Suppression des fichiers "release" de Win32
If Exist %ReleaseDir%\*.exe Del %ReleaseDir%\*.exe
Goto finish

REM Suppression des fichiers "release" de PSP
:cleanPSP
If Exist %ReleaseDir%\*.strip Del %ReleaseDir%\*.strip
If Exist %ReleaseDir%\*.elf   Del %ReleaseDir%\*.elf
If Exist %ReleaseDir%\*.pbp   Del %ReleaseDir%\*.pbp
If Exist %ReleaseDir%\*.sfo   Del %ReleaseDir%\*.sfo
Goto finish

:finish
REM Suppression du répertoire temporaire de construction
If Exist %BinDir% Rd /s /q %BinDir%
REM Fichier spécifiques de Visual Studio
If Exist *.opt              Del *.opt
If Exist *.ncb              Del *.ncb
If Exist *.plg              Del *.plg
If Exist res\build\*.aps    Del res\build\*.aps
If Exist %ReleaseDir%\*.ilk Del %ReleaseDir%\*.ilk
If Exist %ReleaseDir%\*.pdb Del %ReleaseDir%\*.pdb
REM Fichiers spécifiques de GCC
If Exist makefile.var       Del makefile.var
