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: James Hsu
Subject: Re: OT: [avr-gcc-list] How to make to variants with one makefile?
Date: Sun, 21 Nov 2004 17:09:26 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

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.

James Hsu



reply via email to

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