Is there a limit of source files ?

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got problems with compiling my project.
But I was sure that there were no mistakes.
So I deleted all the code in all the source files (in a copy of course).
At least there was the main source file and the "int main (void){return 0;}"
code line.
But the compiler still announced 3 Errors.
So I deleted one by one of my source file entries in the make file.
And as I reached about the number of 4 source files the errors were gone. Is there a limit of numbers of source files or is it elff2cof or is it my make file ?

Here my make file :

# Simple Makefile Volker Oth (c) 1999
# edited by AVRfreaks.net nov.2001

########### change these lines according to your project ##################

#put the name of the target mcu here (at90s8515, at90s8535, attiny22, atmega603 etc.)
MCU = at90s8535

#put the name of the target file here (without extension)
TRG = Wechselfeldmeter

#put your C sourcefiles here
SRC = $(TRG).c Anzeigenschleife.c Funktionen_MCL.c Interruptschleife.c Kleine_Funktionen.c Messgroessenauswahl.c Messwertspeicher.c Messwerttimer.c Anzeigefunktionen.c

#put additional assembler source file here
ASRC =

#additional libraries and object files to link
LIB =

#additional includes to compile
INC =

#assembler flags
ASFLAGS = -Wa, -gstabs

#compiler flags
CPFLAGS = -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)

#linker flags
LDFLAGS = -Wl,-Map=$(TRG).map,--cref

########### you should not need to change the following line #############
include $(AVR)/avrfreaks/avr_make

###### dependencies, add any dependencies you need here ###################
$(TRG).o : $(TRG).c Anzeigenschleife.h Funktionen_MCL.h Interruptschleife.h Kleine_Funktionen.h Messgroessenauswahl.h Messwertspeicher.h Messwerttimer.h Anzeigefunktionen.h

Anzeigenschleife.o : Anzeigenschleife.c Anzeigenschleife.h
Funktionen_MCL.o : Funktionen_MCL.c Funktionen_MCL.h
Interruptschleife.o : Interruptschleife.c Interruptschleife.h
Kleine_Funktionen.o : Kleine_Funktionen.c Kleine_Funktionen.h
Messgroessenauswahl.o : Messgroessenauswahl.c Messgroessenauswahl.h
Messwertspeicher.o : Messwertspeicher.c Messwertspeicher.h
Messwerttimer.o : Messwerttimer.c Messwerttimer.h
Anzeigefunktionen.o : Anzeigefunktionen.c Anzeigefunktionen.h

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

are you really sure that you need no source of one c file in a another ??

like this:

Anzeigenschleife.o : Anzeigenschleife.c Anzeigenschleife.h Interruptschleife.h

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ EW (Eric Weddington)

The newline here comes from the forum form.
In the original makefile i don´t have any newlines .

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ BAB (Kai K.)

As I wrote the errors occurs on a complete empty project.
But for my normal project why I need to tell the makefile which source which source neeed?

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

in the past i had crazy errors because i hadnt do this..:)

i hadnt seen that you forgot the backslash

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ Eric Weddington

I now tried to compile a similiar empty project but with other filenames.
This produced now errrors. So I think there is a problem in the filenames.
In the atachement is the error list. But it don´t say the reason

Thank you

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is the tmpout.txt

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps there is aproblem with the fourum.
Here is the tmpout.txt file by cut´n paste:

avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Wechselfeldmeter.lst -mmcu=at90s8535 -I. Wechselfeldmeter.c -o Wechselfeldmeter.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Anzeigenschleife.lst -mmcu=at90s8535 -I. Anzeigenschleife.c -o Anzeigenschleife.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Funktionen_MCL.lst -mmcu=at90s8535 -I. Funktionen_MCL.c -o Funktionen_MCL.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=In.lst -mmcu=at90s8535 -I. In.c -o In.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Kleine_Funktionen.lst -mmcu=at90s8535 -I. Kleine_Funktionen.c -o Kleine_Funktionen.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Messgroessenauswahl.lst -mmcu=at90s8535 -I. Messgroessenauswahl.c -o Messgroessenauswahl.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Messwertspeicher.lst -mmcu=at90s8535 -I. Messwertspeicher.c -o Messwertspeicher.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Messwerttimer.lst -mmcu=at90s8535 -I. Messwerttimer.c -o Messwerttimer.o
avr-gcc -c -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=Anzeigefunktionen.lst -mmcu=at90s8535 -I. Anzeigefunktionen.c -o Anzeigefunktionen.o
avr-gcc Wechselfeldmeter.o Anzeigenschleife.o Funktionen_MCL.o In.o Kleine_Funktionen.o Messgroessenauswahl.o Messwertspeicher.o Messwerttimer.o Anzeigefunktionen.o -Wl,-Map=Wechselfeldmeter.map,--cref -mmcu=at90s8535 -o Wechselfeldmeter.elf
avr-objcopy -O avrobj -R .eeprom Wechselfeldmeter.elf Wechselfeldmeter.obj
avr-objcopy -O ihex -R .eeprom Wechselfeldmeter.elf Wechselfeldmeter.hex
elfcoff Wechselfeldmeter.elf coff Wechselfeldmeter.cof Wechselfeldmeter.sym
Ended
cp coff/Wechselfeldmeter.cof .
cp coff/* .
make.exe: *** [Wechselfeldmeter.cof] Error 3

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems that I found the reason.
I have a project which total empty only the main functions.
There are 9 source files and the main source file.
The 9 files are named as aaaaaaab.c aaaaaaaac.c aaaaaaaad.c and so on.
This project get compiled without any error.
But if I change all filenames to aaaaaaaaaaaaaaaaaaaab.c aaaaaaaaaaaaaaaaaaaac.c aaaaaaaaaaaaaaaaaaaad.c an so on
then the error occurs as posted above. This seems to me that something (maybe elff2cof ) is restricted to the complete number of filename letters .
But I how can I build my project and using all the necessary files ?

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ Eric WEdington

Yes I need the COFF file for simulating.
With obtool I get a different error message.
But I can´t post the error because I don´t know where the output file is.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here are the two project makefiles the first get compiled without error and the second with "error 3" . If I use objtool instead of ell2coff I get no errror for both files.
All files (in both projects) are empty except the aaa.c file. Here is the "int main (void){return 0;}"
function. The bad new line comes from the forum form.

1. file no error:

# Simple Makefile Volker Oth (c) 1999
# edited by AVRfreaks.net nov.2001

########### change these lines according to your project ##################

#put the name of the target mcu here (at90s8515, at90s8535, attiny22, atmega603 etc.)
MCU = at90s8535

#put the name of the target file here (without extension)
TRG = aaa

#put your C sourcefiles here
SRC = $(TRG).c aaaaaaaaaaaaaaaaaaaab.c aaaaaaaaaaaaaaaaaaaac.c
#put additional assembler source file here
ASRC =

#additional libraries and object files to link
LIB =

#additional includes to compile
INC =

#assembler flags
ASFLAGS = -Wa, -gstabs

#compiler flags
CPFLAGS = -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)

#linker flags
LDFLAGS = -Wl,-Map=$(TRG).map,--cref

########### you should not need to change the following line #############
include $(AVR)/avrfreaks/avr_make

###### dependencies, add any dependencies you need here ###################
$(TRG).o : $(TRG).c

aaaaaaaaaaaaaaaaaaaab.o : aaaaaaaaaaaaaaaaaaaab.c aaaaaaaaaaaaaaaaaaaab.h
aaaaaaaaaaaaaaaaaaaac.o : aaaaaaaaaaaaaaaaaaaac.c aaaaaaaaaaaaaaaaaaaac.h

Here the 2. file which produce the error:

# Simple Makefile Volker Oth (c) 1999
# edited by AVRfreaks.net nov.2001

########### change these lines according to your project ##################

#put the name of the target mcu here (at90s8515, at90s8535, attiny22, atmega603 etc.)
MCU = at90s8535

#put the name of the target file here (without extension)
TRG = aaa

#put your C sourcefiles here
SRC = $(TRG).c aaaaaaaaaaaaaaaaaaaab.c aaaaaaaaaaaaaaaaaaaac.c aaaaaaaaaaaaaaaaaaaad.c aaaaaaaaaaaaaaaaaaaae.c aaaaaaaaaaaaaaaaaaaaf.c aaaaaaaaaaaaaaaaaaaag.c aaaaaaaaaaaaaaaaaaaah.c aaaaaaaaaaaaaaaaaaaai.c aaaaaaaaaaaaaaaaaaaaj.c
#put additional assembler source file here
ASRC =

#additional libraries and object files to link
LIB =

#additional includes to compile
INC =

#assembler flags
ASFLAGS = -Wa, -gstabs

#compiler flags
CPFLAGS = -g -O0 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)

#linker flags
LDFLAGS = -Wl,-Map=$(TRG).map,--cref

########### you should not need to change the following line #############
include $(AVR)/avrfreaks/avr_make

###### dependencies, add any dependencies you need here ###################
$(TRG).o : $(TRG).c

aaaaaaaaaaaaaaaaaaaab.o : aaaaaaaaaaaaaaaaaaaab.c aaaaaaaaaaaaaaaaaaaab.h
aaaaaaaaaaaaaaaaaaaac.o : aaaaaaaaaaaaaaaaaaaac.c aaaaaaaaaaaaaaaaaaaac.h
aaaaaaaaaaaaaaaaaaaad.o : aaaaaaaaaaaaaaaaaaaad.c aaaaaaaaaaaaaaaaaaaad.h
aaaaaaaaaaaaaaaaaaaae.o : aaaaaaaaaaaaaaaaaaaae.c aaaaaaaaaaaaaaaaaaaae.h
aaaaaaaaaaaaaaaaaaaaf.o : aaaaaaaaaaaaaaaaaaaaf.c aaaaaaaaaaaaaaaaaaaaf.h
aaaaaaaaaaaaaaaaaaaag.o : aaaaaaaaaaaaaaaaaaaag.c aaaaaaaaaaaaaaaaaaaag.h
aaaaaaaaaaaaaaaaaaaah.o : aaaaaaaaaaaaaaaaaaaah.c aaaaaaaaaaaaaaaaaaaah.h
aaaaaaaaaaaaaaaaaaaai.o : aaaaaaaaaaaaaaaaaaaai.c aaaaaaaaaaaaaaaaaaaai.h
aaaaaaaaaaaaaaaaaaaaj.o : aaaaaaaaaaaaaaaaaaaaj.c aaaaaaaaaaaaaaaaaaaaj.h

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Andreas,

as I know elfcoff can handle only filename with max. about 12 characters. That's one point. But I think the error is not from elfcoff. Here your post again (a part only, of course):

> avr-objcopy -O avrobj -R .eeprom Wechselfeldmeter.elf Wechselfeldmeter.obj
> avr-objcopy -O ihex -R .eeprom Wechselfeldmeter.elf Wechselfeldmeter.hex
> elfcoff Wechselfeldmeter.elf coff Wechselfeldmeter.cof Wechselfeldmeter.sym
> Ended
> cp coff/Wechselfeldmeter.cof .
> cp coff/* .
> make.exe: *** [Wechselfeldmeter.cof] Error 3

After elfcoff the next line is called "Ended" therefore elfcoff produces no error. The make process runs further and stops after "cp coff/* .". As I remember there is a bug in this makefile. You didn't need to copy all of the stuff in the coff directory. To copying the coff file itself is sufficient. So, delete this line in the avr_make.

And the 3 is not the number of the errors, it is a error number. But I can't tell you what does this mean.

HTH

Volkmar

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi There!

I believe the error comes from the fact that your SRC variable is too long. I had the same error. If I made the SRC variable below a certain number of characters, i didn't get anymore errors. My solution was to divide the SRC variable in two.

regards gtoo