NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » trying to understand MAKE
December 02, 2010 by Gregg |
Just programmed my first project in the nerdkit. I think I am beginning to understand the process, but I am a little stumped on the MAKE FILE. DO I have to create a new MAKEFILE for each program? Where can I get more info on this? Any help would be great! Thanks |
---|---|
December 03, 2010 by nanaeem |
Hi Gregg, I am guessing that you already downloaded the Nerdkits guide from the download section. Pages 68-69 have a surprisingly simple explanation of the Makefile. I would suggest starting there. There is no compulsion to use a Makefile to compile and load your program onto the chip. That said, it is highly recommended. There is a sequence of programs that must be executed to convert you C files into a format that the chip understands followed by loading the chip with the newly compiled program. Without make you would have to execute these programs by writing their run commands directly on the terminal. If nothing else this is time consuming. Creating one Makefile at the start of a new project is therefore highly recommended. make is very popular among developers. Simply trying a google search of "Makefile tutorial" will give you a wealth of information. I still strongly suggest starting with the Nerdkits guide explanation. I myself am quite new to microcontoller programming. My first source of information is always the Nerdkits guide, then this forum and then google. In my experience, the Nerdkits guide always gives the most simplified and easy to understand explanation of things. This forum is brilliant too. -N. |
December 03, 2010 by Ralphxyz |
Here is a neat trick to use when making up Makefiles:
Just change the ProjectName to the name of your C code project file (Line 6). Now you can reuse this Makefile in any of your projects just by changing the ProjectName = ??????????. You can use XyZ instead of ProjectName of course. This tip is curtesy of the forum, I can not remember who originated it. Ralph |
December 03, 2010 by bretm |
You need to use $(ProjectName) to make it do the name replacement of the ProjectName macro. |
December 03, 2010 by Ralphxyz |
I was just coming back to do that.
Ralph |
December 05, 2010 by Gregg |
Wow! Tons of help guys! I was pretty much thinking I could use one make file by changing the target name. Not compleatly sure about the instructions for The replace macro, but, I think I can figure that out. Thanks again. Gregg |
Please log in to post a reply.
Did you know that you can follow NerdKits on Facebook, YouTube, and Twitter? Learn more...
|