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

Re: [MiNT] missing xversion.h



Am 16.05.2010, 22:48 Uhr, schrieb Vincent Rivière <vincent.riviere@freesbee.fr>:

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.

No problem: $2 contains the first of them.


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 ;-)

Maybe that's why I don't understand it ;)


--
Helmut Karlowski