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

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

Re: [avr-gcc-list] Make file to recursivly generate code for more than


From: Geoffrey Wossum
Subject: Re: [avr-gcc-list] Make file to recursivly generate code for more than one target ?
Date: Thu, 3 Jun 2004 16:07:46 -0500
User-agent: KMail/1.6.2

On Thursday 03 June 2004 3:54 pm, Anton Erasmus wrote:
> On 2004/06/02 at 04:45 Sander Pool wrote:
> >An easy way would be to wrap your makefile into a shell script that sets
> >the
> >MCU type and calls make as often as required ?

> I would prefer not to use a shell script, as I am sure that one can do this
> with only the makefile itself.

I use a shell script to build my multiple AVR target applications.  I make 
different build directories for each target, and then call make with the 
appropriate -mmcu flag.

The point is is that the shell script is easy.  Here, I'll right an example 
right now for you:


arches="atmega16 atmega32"
for arch in $arches ; do
    rm -Rf build-$arch
    mkdir build-$arch
    cd build-$arch
    make MCU_CFLAGS="-mmcu=$arch" -f ../Makefile
    cd ..
done

See, easy.  Sure, you could do it entirely in make, but somehow I don't think 
it would as short, as simple, or as easy to maintain as this.

---
Geoffrey Wossum
Software Engineer
Long Range Systems - http://www.pager.net


reply via email to

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