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

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

Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?


From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?
Date: Thu, 29 Jan 2009 01:41:38 +0100

Steven Michalske <address@hidden> wrote:

> CFLAGS+=" -DMY_DATE=`date +%y%m%d` "
> 
> and in your code
> 
> #ifndef MY_DATE
> #error "MY_DATE not defined."
> #endif
> 
> now use MY_DATE instead of __DATE__

Wow, now that looks cool ;-)

I added your line to my makefile:

...
CFLAGS= -Os -g -Wall -ffreestanding -mmcu=$(MCU)
CFLAGS+=" -DMY_DATE=`date +%y%m%d` "
...

...but I get a Make error sadly, any idea, maybe a typo in what you posted ?

=========
avr-gcc -Os -g -Wall -ffreestanding -mmcu=atmega32 " -DMY_DATE=`date +%y%m%d` " 
-c main.c
avr-gcc:  -DMY_DATE=090129 : No such file or directory
make: *** [main.o] Error 1
=========



--
Vince, learning new cool tricks every day..




reply via email to

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