[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] missing xversion.h



Helmut Karlowski wrote:
You mean something like this:

xversion.h: $(SRCFILES)
xv.sh $@ $?

and xv.sh:


D=`date -r $2 "+%b %e %Y %H:%M"`
echo \#define BDATETIME \"$D\" >$1

Yes, something like this.

At first glance I didn't see you wanted to get the date of the last modified file into xversion.h.

Your suggestion will fail the first time because $? will contain the list of all the source files.

I was thinking to that:

xversion.h: $(filter-out xversion.h,$(wildcard *.[ch]))
echo '#define BDATETIME "$(shell date -r $(firstword $(shell ls -t $?)) '+%b %e %Y %H:%M')"' >$@

However, the contents of xversion.h will be wrong if some source file is deleted.

I must admit my proposition is a bit insane ;-)

--
Vincent Rivière