LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 06: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, 06: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, 07:14 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I think this is what you are looking for:
Code:
main()
{
        char *compiled=  __DATE__ " @ " __TIME__;
        printf("%s\n",compiled);
}
 
Old 10-16-2004, 05: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



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 02:33 AM
timestamp question jch02140 Linux - Newbie 3 07-19-2005 03:40 AM
Unix Timestamp Nargile Linux - Software 1 03-17-2005 09:07 PM
Timestamp inconsistencies J.W. LQ Suggestions & Feedback 3 03-07-2005 04:47 PM
sql timestamp help vickr1z Linux - Newbie 6 10-12-2004 08:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:07 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration