LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Compilation Timestamp (https://www.linuxquestions.org/questions/programming-9/compilation-timestamp-242923/)

gr33ndata 10-15-2004 06:28 AM

Compilation Timestamp
 
Some programs do print the time they were compiled. And I am sure they do not add it by hand. I think there is macro or something used by gcc or make .. etc to to that.
So does anyone knows what is it

SciYro 10-15-2004 06:35 AM

ummm, seeing how its only "some" programs, i believe they would have added it by hand

probably from the scripts known as the all mighty ./configure

thus i think the macro would be m4?

(look into automake / autoconf I'm sure the answer lies there)

jlliagre 10-15-2004 07:14 AM

I think this is what you are looking for:
Code:

main()
{
        char *compiled=  __DATE__ " @ " __TIME__;
        printf("%s\n",compiled);
}


gr33ndata 10-16-2004 05:00 PM

I think yes, I am gonna try it now jilliagre
Thanks a lot


All times are GMT -5. The time now is 10:37 AM.