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

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

Re: OT: [avr-gcc-list] How to make to variants with one makefile?


From: Anton Erasmus
Subject: Re: OT: [avr-gcc-list] How to make to variants with one makefile?
Date: Mon, 22 Nov 2004 20:21:45 +0200

On 21 Nov 2004 at 17:09, James Hsu wrote:

> I guess this is a bit off-topic, but might as well finish off the
> thread... Anton Erasmus wrote:
> 
> >echo -DVersion1  t1.hex
> >-DVersion1 t1.hex
> >echo -DVersion1  t2.hex
> >-DVersion1 t2.hex
> >echo -DVersion2  t1.hex
> >-DVersion2 t1.hex
> >echo -DVersion2  t2.hex
> >-DVersion2 t2.hex
> >
> >Does anybody have a suggestion of how to get make to do the above
> >with a single make command ?
> >
> >  
> >
> If you are trying to make some sort of "debug" and "release" version
> with a single makefile, then you might want to use variables like
> this:
> 
> HEXFILES = t1.hex t2.hex
> 
> v1: $(HEXFILES)
> v1: FLAGS += -DVersion1
> v2: $(HEXFILES)
> v2: FLAGS += -DVersion2
> 
> $(HEXFILES):
>  echo $(FLAGS) $@
> 
> The other thing you might be looking for is just recursively invoking
> make like such:
> 
> ugh:
>  make v1
>  make v2
> 
> which can get pretty ugly if you mess up something.
> 
Hi,

Yes my question was not clear. What I would like to be able to do with
a single makefile with a single invokation is the following:

I have a single set of source that supports a number of different versions of
a PCB with some differences in capabilities. I also use either an ATmega8 on one
PCB or an ATMega16 or ATMega32 on the other PCBs. Currently I have to define
the MCU as well as one other define in the makefile.

I would like to be able to define a list of MCUs and a list of PCB options. The 
makefile
should then generate a rom file for each combination of MCU and PCB option. i.e.
If I have:

MCUS = atmega8, atmega16, atmega32

and

PCBOPT = opt1, opt2

Then it should generate

opt1_atmega8.rom
opt1_atmega16.rom
opt1_atmega32.rom
opt2_atmega8.rom
opt2_atmega16.rom
opt2_atmega32.rom

Hope I have explained myself better this time.

Regards
   Anton Erasmus



-- 
A J Erasmus



reply via email to

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