mfile->Makefile

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

I have more than one dir of src files. No problem with main but then the mistery has begun!
I echoe ALL_CFAGS and they are right:
-mmcu=atmega128 -I. -g -O2 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns= -I../inc -std=gnu99 -Wp,-M,-MP,-MT,.o,-MF,.dep/gccversion.d
BUT I failed to find which line of makefile is actually compiling my src!!!
Yes, I thought I now but I was wrong and below you can see options for the trouble call:
avr-gcc -g -O2 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=../bus/bus.lst -I../inc -std=gnu99 -Wl,-Map=main.map,--cref -lm ../bus/bus.c -o ../bus/bus

As you can see some options has disappeared and as a result:
C:/WinAVR/avr/include/avr/io.h:225:6: warning: #warning "device type not defined"
How to???

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

Is the Makefile completely automatically generated, or manually
edited?

Either way, please email me that file for verification.

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

I too was getting the same error "device type not found", when following the WinAVR sample program from the documentation, and came to the conclusion that the makefile included in the latest WinAVR is missing the -mmcu = ...
in the CFLAG statement line.

I made that change by including it and it seemed to work. - mind you I got some other errors :-P.

Hence I could be wrong. Perhaps Eric or Joerg can comment.

Martin

admin's test signature
 

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

CFLAGS is not supposed to contain -mmcu, it is only supposed to be
part of ALL_CFLAGS (and ALL_ASFLAGS). Like brb, you must somehow have
botched your Makefile so it falls back to the generic .c -> .o rule
that uses CFLAGS.

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

Just used a "fresh" makefile and sure that works. (now I have to figure what the difference is)

Thanks Joerg.

Martin

admin's test signature