avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] HowTo split a program into several files ?


From: Vincent Trouilliez
Subject: Re: [avr-chat] HowTo split a program into several files ?
Date: Tue, 13 Sep 2005 00:09:28 +0200

> Now, how do I modify it to work when there are two files, main.c and
> lcd.c (and lcd.h of course) in my case ?
> 
> I tried writing PRG = main lcd and OBJ = main.o
> but it's not happy with that apparently...


Just in case, this is exactly what makes says :

$ make
avr-gcc -g -Wall -O2 -mmcu=atmega32    -c -o main.o main.c
main.c: In function `__vector_13':
main.c:24: warning: operation on `ptr_in' may be undefined
main.c: In function `s_getc':
main.c:45: warning: operation on `ptr_out' may be undefined
avr-gcc -g -Wall -O2 -mmcu=atmega32  -Wl,-Map,main lcd.map -o main
main.o
avr-gcc: lcd.map: No such file or directory
make: *** [main] Error 1


Despite the warnings, it does create a main.o, but no lcd.o nor any
other file...


Since it looks like one is allowed to attach file on this list, well I
attached my project's files, if it helps...

main.c, that goes round the LCD module's character ROM to display all
the available characters, and the LCD routines in stuffed in.... well
yes, in lcd.c, with the accompanying lcd.h....


--
Vince, feeling so close, please help make it happen...


Attachment: lcd.c
Description: Text Data

Attachment: lcd.h
Description: Text Data

Attachment: main.c
Description: Text Data

Attachment: Makefile
Description: Text Data


reply via email to

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