45 lines
918 B
Batchfile
45 lines
918 B
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
echo ===== CubeMX Before Code Generation =====
|
|
|
|
set PROJECT_DIR=%~dp0..
|
|
cd /d "%PROJECT_DIR%"
|
|
|
|
echo Project dir: %CD%
|
|
|
|
set SRC_DIR=Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM4F
|
|
set BACKUP_DIR=tools\cubemx_temp_backup\FreeRTOS_RVDS_ARM_CM4F
|
|
|
|
if not exist "%SRC_DIR%" (
|
|
echo ERROR: Source dir not found: %SRC_DIR%
|
|
exit /b 1
|
|
)
|
|
|
|
if not exist "%BACKUP_DIR%" (
|
|
mkdir "%BACKUP_DIR%"
|
|
)
|
|
|
|
echo Backup from:
|
|
echo %SRC_DIR%
|
|
echo To:
|
|
echo %BACKUP_DIR%
|
|
|
|
if exist "%SRC_DIR%\port.c" (
|
|
copy /Y "%SRC_DIR%\port.c" "%BACKUP_DIR%\port.c"
|
|
)
|
|
|
|
if exist "%SRC_DIR%\portmacro.h" (
|
|
copy /Y "%SRC_DIR%\portmacro.h" "%BACKUP_DIR%\portmacro.h"
|
|
)
|
|
|
|
if exist "%SRC_DIR%\port.h" (
|
|
copy /Y "%SRC_DIR%\port.h" "%BACKUP_DIR%\port.h"
|
|
)
|
|
|
|
if exist "%SRC_DIR%\portasm.s" (
|
|
copy /Y "%SRC_DIR%\portasm.s" "%BACKUP_DIR%\portasm.s"
|
|
)
|
|
|
|
echo Before backup finished.
|
|
exit /b 0 |