avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Adding date/version information to project??


From: Dave Hylands
Subject: Re: [avr-gcc-list] Adding date/version information to project??
Date: Wed, 30 Nov 2005 00:02:37 -0800

Hi Matt,

> I wonder if it can be a part of the script itself, and then have the
> script edit itself in place (using sed -i)?? Hrm, something to try...

Well, you could have the makefile increment the buildnumber:

include buildnum
NEW_BUILDNUMBER = $(shell echo $$(( $(BUILDNUMBER) + 1 )))

This takes advantage of the shell's capability to evaluate expressions
using the

$(( expression ))

syntax, The double $ gets converted to a single $ by the time the
shell is invoked.

Add the following two lines to your linker recipie after a successful link:

    @echo "# Automatically generated file - do not edit" > buildnum
    @echo "BUILDNUMBER=$(NEW_BUILDNUMBER)" >> buildnum

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]