guowenxue
4 days ago d42fb887237e30d5026e006a3774d6b0a215b829
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
setlocal
 
cd /d "%~dp0"
 
REM ===== Clean Core (keep main.c) =====
if exist "Core\Src\main.c" (
    copy /y "Core\Src\main.c" "main.c" >nul
    rmdir /s /q "Core" 2>nul
    mkdir "Core\Src" 2>nul
    copy /y "main.c" "Core\Src\main.c" >nul
    del /f /q "main.c"
)
 
REM ===== Clean artifacts =====
call :del_file .mxproject
call :del_file .cproject
call :del_file .project
call :del_file .clangd
call :del_file *.json
call :del_file *.ld
call :del_file *.s
 
call :del_dir .settings
call :del_dir Drivers
call :del_dir Debug
call :del_dir Release
call :del_dir build
call :del_dir cmake
 
exit /b
 
:del_file
if exist "%~1" del /f /q "%~1"
exit /b
 
:del_dir
if exist "%~1\" rmdir /s /q "%~1"
exit /b