1@ECHO OFF
2
3ECHO INFO: Building %CD%...
4
5IF EXIST workspace GOTO WORKSPACE_EXISTS
6
7ECHO INFO: Initializing the workspace...
8%AZRTOS_ARM_DS_IDEC% -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data .\workspace -import .\tx -import .\sample_threadx
9IF %ERRORLEVEL% NEQ 0 (
10    ECHO ERROR: failed to initialize the workspace
11    EXIT /B 1
12) ELSE (
13    ECHO INFO: Workspace initialized.
14)
15
16:WORKSPACE_EXISTS
17%AZRTOS_ARM_DS_IDEC% -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data .\workspace -build tx -build sample_threadx
18IF %ERRORLEVEL% NEQ 0 (
19    ECHO ERROR: build failed.
20    EXIT /B 1
21)
22
23ECHO INFO: Build completed successfully!
24