[Qt-interest] build date
Colin S. Miller
no-spam-thank-you at csmiller.demon.co.uk
Wed Mar 17 23:40:35 CET 2010
SALOMEHER at terra.es wrote:
> Hi, how I can store the creation date of my executable or build date?,
> to view when you run the application.
> Greetings.
Salom,
In GNU make, something like this should work
#!/usr/bin/make -f
# partial makefile to show always-rebuild for datestamp
.dummy : buildtime.c
buildtime.c :
date +'const char buildDate[]="%a %d %b %Y %T %Z";' > $@
buildtime.o : buildtime.c
$(CC) $(CFLAGS) -o $@ $<
The .dummy directive will make make rebuild buildtime.c on each
invocation.
If your make program doesn't support .dummy, then using
rm $<
as the second build rule for buildtime.o will also work.
HTH,
Colin S. Miller
More information about the Qt-interest-old
mailing list