How to always compile a cpp file with Eclipse?

c++, compilation, eclipse, g++

Solution

You may create a 'pre-build' step which touch the file (so the time stamp is modified and force to recompile the file).

Problem

I have included a unix timestamp `__DATE__` in one of my cpp source files to indicate the build date of my program. Naturally with default setups it compiles the file only when I change it but now I'd like to have it always compiled. I tried to search through the project settings but it seems that this would need deeper understanding of the compiler. I'm using Eclipse with g++. I tried to google and search for an answer but I found it difficult to find good keywords for this. Also is there a markable difference wether I do this change for a header file instead of the source file? Thanks for the answers.

Original source