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 morethan o


From: Sander Pool
Subject: Re: [avr-gcc-list] Make file to recursivly generate code for morethan one target ?
Date: Thu, 3 Jun 2004 14:51:00 -0700

Since the recipes for make are executed by whatever shell is configured you
can simply stick that shell script in the rule and pretend make is doing the
looping when in fact it's really the shell.

So:


do_all:
    script line 1\
    script line 2\
    etc.

Make would call itself with the same makefile.

    Sander

----- Original Message ----- 
From: "Geoffrey Wossum" <address@hidden>
To: <address@hidden>
Sent: Thursday, June 03, 2004 2:07 PM
Subject: Re: [avr-gcc-list] Make file to recursivly generate code for
morethan one target ?


> 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
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
>
>



reply via email to

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