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.

MSP430FR5969: Tutorial on how to extend the makefile functionality

Part Number: MSP430FR5969

Tool/software:

Hello,

I have seen the post related to the makefile modfiication to obtain the git tag version and use it as environment variable(Reference: e2e.ti.com/.../ccs-msp430fr5969-storing-a-symbol-value-before-building). I've been trying to set up the pre build steps but I amb not able to produce results. Would it be possible to get a tutorial on how to extend the make file to obtain the git tag version?

Regards,

David

  • I will move this thread to CCS topic. Hope they can help you find the answer.

  • Hello,

    Great, is there any update on the matter?

    David

  • Hi David,

    Would it be possible to get a tutorial on how to extend the make file to obtain the git tag version?

    I am not aware of any such tutorial on this. It is not something that we natively support in CCS. Perhaps someone from the community share a solution.

    ki

  • Hello Ki,

    I've been working on a bash script that could do the the task but I was not able to define properly thev git_tag symbols. I can obtain the git tag version and copy it to a txt but i am not able to define the desired syumbol, maybe you can help me with that?

    I am still learning on how to adjust the compiler options through .bat files but i believe it works fine until the compiler flags settings and the symbol defining.

    Regards,

    David

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    @echo off
    setlocal enabledelayedexpansion
    REM Get Git version information
    for /f "tokens=*" %%i in ('git describe --long --dirty --tags 2^>nul') do set GIT_DESCRIBE=%%i
    REM Check if git describe command worked
    if "%GIT_DESCRIBE%"=="" (
    echo WARNING: Git command failed or no tags found. Using default values.
    set GIT_DESCRIBE=v0.0.0-0-dev-dirty
    )
    REM Split the git describe output into components
    set "version=%GIT_DESCRIBE:-= %"
    REM Extract components
    for /f "tokens=1,2,3,4" %%a in ("%version%") do (
    set VERSION_TAG=%%a
    set COMMITS_PAST=%%b
    set COMMIT=%%c
    set DIRTY=%%d
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • I've been working on a bash script

    With bash you have to explicitly export things to a child process. If you don't do that then make will never see them. You can do it all in one go.

    Found hiding in my .bashrc:

    export MSP430_GCC_INCLUDE_DIR=/usr/ti/gcc/include

  • Hello David,

    Thank you for your response, can you please explain me further what would I accomplish with that command?

    Also, correct me if I am mistaken, the child proces should be the bnash script run by CCS, Therefore, should I have to export the symbols to the parent process isntead? I am using the prebuild steps, I believe it is like a separated make commands and I sohuld make an interconenction between the prebuild steps and the actual building procedure top ush the symbols to the compiler.

    Regards,

    David

  • I have no idea what CCS is doing but it is pretty much impossible for a child process to change the environment variables of a parent. You can finagle that a little as shown in a recent post on Hackaday. Although that is mostly about preventing bash from starting a child process to run a script.

**Attention** This is a public forum