LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-15-2004, 07:28 AM   #1
gr33ndata
Member
 
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Rep: Reputation: 15
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
 
Old 10-15-2004, 07:35 AM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
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)
 
Old 10-15-2004, 08:14 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
I think this is what you are looking for:
Code:
main()
{
        char *compiled=  __DATE__ " @ " __TIME__;
        printf("%s\n",compiled);
}
 
Old 10-16-2004, 06:00 PM   #4
gr33ndata
Member
 
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Original Poster
Rep: Reputation: 15
I think yes, I am gonna try it now jilliagre
Thanks a lot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timestamp Help jch02140 Linux - Newbie 7 03-17-2006 03:33 AM
timestamp question jch02140 Linux - Newbie 3 07-19-2005 04:40 AM
Unix Timestamp Nargile Linux - Software 1 03-17-2005 10:07 PM
Timestamp inconsistencies J.W. LQ Suggestions & Feedback 3 03-07-2005 05:47 PM
sql timestamp help vickr1z Linux - Newbie 6 10-12-2004 09:24 PM


All times are GMT -5. The time now is 10:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration