Thank you for those suggestion; unfortunately, such a post-build step also does not work for me.
I have included
rm -rf ../Debug/Src/uart-ShowVersion.*
as POST-build step; and indeed the file vanishes after project build.
(that is the only <file>.o that I found in the project tree.
HOWEVER, when recompiling, I just see the message
Info: Nothing to build for <project name>
so it seems that Atollic does not realize that the object file was deleted.
I don't know why...
As additional test, when I delete the executeable (*.elf) by hand, and press "CTRL-B" to recompile, I see
Info: Internal Builder is used for build
arm-atollic-eabi-gcc -o Servo R2.elf Drivers\CMSIS\Device\ST\STM32L0xx [... lots of files ...]
arm-atollic-eabi-gcc: error: Src\uart-ShowVersion.o: No such file or directory
so indeed, TrueStudio does not notice that the *.o file is missing.
I am using an "auto-generated" project from CubeMX.