cancel
Showing results for 
Search instead for 
Did you mean: 

[solved] CubeIDE: using __date__/__time__ macros & force rebuild of files using them

RAltm
Senior

Hello,

I'm using the __date__/__time__ macros. Their values are only updated if the file using them is re-compiled. Cleaning up before building forces the values to be updated, but this is not feasible on bigger projects.

Is there a way to tell CubeIDE that a specific file always has to be rebuild? I only found solutions for makefiles, but CubeIDE is not using makefiles.

Regards

10 REPLIES 10
robmilne
Associate III

As in previous replies, touching the file will force a recompile of the file.  In my case I need to recompile a version.c file to capture __date__ and __time__ for every build and was able to do so with the following line as the pre-build step command.  The path refers to the directory structure within the build directory.

if [ -f path/to/version.o ]; then rm path/to/version.o; fi


-rob