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

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

Re: [avr-gcc-list] Next version of winavr!!!


From: Andreas Schwarz
Subject: Re: [avr-gcc-list] Next version of winavr!!!
Date: Fri, 22 Aug 2003 16:36:43 +0200

"Dave Hansen" <address@hidden> wrote:

> --- begin included file Project.mak ---
> # Project.mak
> # Project specific definitions for building software with avr-gcc
> #
> 
> # Target file name (without extension).
> #
> TARGET      =   PDC
> 
> # C and assembly source files (C dependencies are automatically
> # generated.)
> #
> CSRC        =   main.c      \
>                 io.c        \
>                 window.c    \
>                 pinch.c     \
>                 timer.c     \
>                 uart.c      \
>                 eeprom.c
> 
> ASRC        =
> 
> # Specify the target processor and clock speed.
> # Examples: atmega32, attiny26, at90s8535.
> # See /WinAVR/doc/avr-libc/avr-libc-user-manual/using_tools.html
> #
> MCU         =   atmega32
> HZ          =   12000000
> 
> # Define project-specific compilation-control symbols
> #
> APPDEFS     =   -D DBUG=1 -D HIGH_CAP=0
> --- end included file Project.mak ---
> 
> This is not difficult stuff.  Munging makefiles is an important skill 
> generally applicable to all fields of programming.  The documentation
> and the example is clear.  If you can't figure it out, perhaps you're
> in the wrong business.  Hand-holding IDE's are for wimps.  Real
> programmers don't eat quiche.  ;-)

I think you've got me wrong. The file you posted above isn't
a makefile, it is a fragment of a makefile which needs a huge include
file to work. It might be easy and comfortable to use, but for a newbie
it is a "black box", he gets no clue how AVR-GCC or make are working.
And as soon as he runs into a problem that cannot be solved with the
WinAVR makefile, he has to come back to ask how he can do this and
that (I see it every week in the forum and chat on my website).

My makefiles usually look like this:

-- begin makefile --
all:
  avr-gcc -g -o demo.elf -Os -Wall -mmcu=atmega16 demo1.c demo2.c
  avr-objcopy -O ihex demo.elf demo.hex
  avr-objdump --source -d demo.elf > demo.lst

prog:
  avrdude -c stk200 -p atmega16 -e -i demo.hex

clean:
  rm -f *.elf *.o *.hex *.lst
-- end makefile --

It might be not as fool-proof (sorry ;) ) as the WinAVR makefile, but
you can see at once _what_ it does and _how_ it does it. If you put in a
few comments or write a short README file, something like this would IMO
be a much better makefile example for WinAVR.

Andreas


reply via email to

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