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

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

Re: [avr-gcc-list] How can I "#define" a string in the Makefile?


From: Russell Shaw
Subject: Re: [avr-gcc-list] How can I "#define" a string in the Makefile?
Date: Sat, 01 Nov 2003 03:23:35 +1100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030311 Debian/1.2.1-10

Bob Paddock wrote:

Does this work?:

   static CONST char FLASH Firmware_Prj_str[] PROGMEM = "1.23";

I did not try that specifically, but doing this does work:

===
#ifndef FIRMWARE_REV_STR
#define FIRMWARE_REV_STR "0.00"
#endif

static CONST char FLASH Firmware_Prj_str[] PROGMEM = FIRMWARE_REV_STR;
===

This code works ok with IAR's Project Manager as well, where it is defined
by the project manager and not the code file it self.

It really is a problem involving Make.

FIRMWARE_REV_STR is getting defined to 'something' in Make,
 just not sure what.

Maybe the quotes are being stripped by the shell so that

  -DFIRMWARE_REV_STR="1.23"

gives 1.23 instead of "1.23". Try:

  #define VERSION  FIRMWARE_REV_STR
  static CONST char FLASH Firmware_Prj_str[] PROGMEM = VERSION;




reply via email to

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