Society of Robots - Robot Forum

Software => Software => Topic started by: Neophite_404 on October 12, 2009, 07:07:20 AM

Title: Makefile Help
Post by: Neophite_404 on October 12, 2009, 07:07:20 AM
Hey All,

I'm just starting out with MCU programming and trying to get my workflow/file and folder structure set up. Im in the last stages of this process but I'm running into a problem with the linker portion. (I think :-) ).

This is a screen capture of the output @ command line:

http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&friendID=43977478&albumID=447318&imageID=58183509 (http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&friendID=43977478&albumID=447318&imageID=58183509)

And this is the bit in the makefile that I'm using where I think the issue is:

Quote
# linker
LDFLAGS=-Wl,-Map,$(TRG).map -mmcu=$(MCU) -lm $(LIBS)

The whole makefile template can be seen here: http://electrons.psychogenic.com/articles/Makefile.tpl (http://electrons.psychogenic.com/articles/Makefile.tpl)

I've tried editing the line so that it looks like this:
Quote
LDFLAGS=-Wl -Map $(TRG).map -mmcu=$(MCU) -lm $(LIBS)

That just outputted that it didn't recognize the -Map option. I've also tried looking up the -map option for the ld command and didn't come up with anything. I just simply do not understand what is going on here. :)

Any help would be greatly appreciated.
Title: Re: Makefile Help
Post by: chelmi on October 12, 2009, 11:09:37 AM
The variable TRG seems invalid (workftest                           .out). Since it is created by adding .out to your project name, check the definition of PROJECTNAME for trailing spaces.
Title: Re: Makefile Help
Post by: Neophite_404 on October 12, 2009, 04:04:50 PM
Brilliant. I had a comment off to the side (a bunch of spaces then "## Change this for every project.") After deleting that comment and then making sure that there were no trailing spaces everything seems to work perfectly.

Thank you very much chelmi.
Title: Re: Makefile Help
Post by: chelmi on October 12, 2009, 04:20:59 PM
your welcome!

make is very sensitive about spaces, tabs... You'll get used to it :)