This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C2000WARE: How to build CCS project from command line for Coverity analysis

Part Number: C2000WARE

Hello,

I am trying to perform Coverity static analysis on my CCS project. I have the CCS-generated makefile in the Debug folder.

When I run the Coverity capture, I get errors like:

process_begin: CreateProcess(NULL, rm -f 4101901-001-SC.out, ...) failed.
make (e=2): The system cannot find the file specified.

I want to know the correct way to build my CCS project from the Windows command line using the CCS-generated makefile, so that I can run Coverity capture successfully.

Below is my script :

@echo off
setlocal

REM ==============================
REM User Configuration
REM ==============================
set COVERITY_BIN=C:\Users\..\AppData\Local\Programs\Coverity\Coverity Static Analysis\bin
set CCS_GMAKE=C:\ti\ccs1280\ccs\utils\bin\gmake.exe
set PROJECT_DIR=C:\WorkFolder\VacGen\TI_workspace1\41-SC
set BUILD_DIR=%PROJECT_DIR%\Debug
set MAKEFILE=%BUILD_DIR%\makefile
set COVERITY_REPORT=%PROJECT_DIR%\coverity_report

REM ==============================
REM Ensure Windows deletes are used
REM ==============================
set RM=DEL /F
set RMDIR=RMDIR /S /Q

REM ==============================
REM Delete previous Coverity report
REM ==============================
echo ==========================================================
echo Deleting existing Coverity report directory...
echo ==========================================================
if exist "%COVERITY_REPORT%" (
    %RMDIR% "%COVERITY_REPORT%"
)

REM ==============================
REM Optional: Clean project
REM ==============================
echo ==========================================================
echo Cleaning project...
echo ==========================================================
if exist "%MAKEFILE%" (
    "%CCS_GMAKE%" -f "%MAKEFILE%" clean
) else (
    echo Makefile not found at %MAKEFILE%
)

REM ==============================
REM Capture build with Coverity
REM ==============================
echo ==========================================================
echo Capturing CCS build with Coverity...
echo ==========================================================
if exist "%MAKEFILE%" (
    REM Pass RM variable to gmake so it uses DEL instead of rm
    set RM=DEL /F
    "%COVERITY_BIN%\cov-build.exe" --dir "%COVERITY_REPORT%" "%CCS_GMAKE%" -f "%MAKEFILE%" all
) else (
    echo Makefile not found at %MAKEFILE%, cannot capture build.
)

echo ==========================================================
echo Coverity capture finished.
echo ==========================================================

pause

  • Hello,

    I don't have any experience with Coverity so I can't comment on any specific questions regarding that. I can only answer generic CCS related questions.

    I want to know the correct way to build my CCS project from the Windows command line using the CCS-generated makefile

    Please see: https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_project-command-line.html#build-a-code-composer-studio-project

    The above is the supported way to build CCS projects from the command line. This will generate the makefile(s) as needed and then call gmake on the generated makefiles in the build configuration subfolder. You can see the exact gmake command used by looking at the console output.

    so that I can run Coverity capture successfully.

    I don't have any experience on Coverity or what this process involves so I can't answer this part. It may be best to follow up with Coverity directly.

    Thanks

    ki