Author Topic: Who is interested in a Makefile tutorial?  (Read 4290 times)

0 Members and 1 Guest are viewing this topic.

Offline chelmiTopic starter

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Who is interested in a Makefile tutorial?
« on: July 16, 2009, 09:18:22 AM »
Hi all,

I noticed that Makefile related issues come up regularly in the forum. Makefile is a wonderful tool but can be really tricky and confusing. As I said in another topic, I use make everyday and if people show interest, I can write a Makefile tutorial for SoR. A few thoughts:
- I don't use winAVR, so my tutorial would be more general than just fixing makefiles generated by winAVR. But if you understand Makefiles, you could be able to fix the problem by yourself.
- I will probably have a section about compilation and the different phases (It's always good to know the general principle behind the gui)
- In the final section I will present my project "template" for command line AVR development under Linux and probably Windows+cygwin. I.e. a directory structure and a easily customizable Makefile.
- As you've probably guessed, English is not my first language and my tut will probably needs some proof-reading ;)

What do you think?

Chelmi.
« Last Edit: July 16, 2009, 09:27:17 AM by chelmi »

Offline kpmcgurk

  • Robot Overlord
  • ****
  • Posts: 152
  • Helpful? 3
  • Robot Love?
    • Probotic world (in progress)
Re: Who is interested in a Makefile tutorial?
« Reply #1 on: July 16, 2009, 09:46:35 AM »
I would read it, I do agree that makefiles do tend to be confusing!
some people are just Born smart, but some people have to work for it, and those are the people who succeed.

http://www.proboticworld.com

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Who is interested in a Makefile tutorial?
« Reply #2 on: July 16, 2009, 10:35:52 AM »
I'm interested

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Who is interested in a Makefile tutorial?
« Reply #3 on: July 16, 2009, 04:50:42 PM »
it would be a great tutorial to have on the site, i agree that it would help some people who are confused like me :P
Howdy

Offline Miles

  • Full Member
  • ***
  • Posts: 49
  • Helpful? 1
Re: Who is interested in a Makefile tutorial?
« Reply #4 on: July 16, 2009, 07:31:07 PM »
I would read it and benefit from it. It's one of the things stopping me from writing my own code from scratch

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Who is interested in a Makefile tutorial?
« Reply #5 on: July 16, 2009, 09:39:01 PM »
I would read it and benefit from it. It's one of the things stopping me from writing my own code from scratch

Yep, same here with code in AVR GCC. That and the non english style of coding. Things like rprintf("%d\r\n",variable) stuff that wasn't easy enough to just write serial.print(variable, DEC).
Check out the uBotino robot controller!

Offline Joker94

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
Re: Who is interested in a Makefile tutorial?
« Reply #6 on: July 16, 2009, 09:44:44 PM »
i think it would help every one

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Who is interested in a Makefile tutorial?
« Reply #7 on: July 16, 2009, 11:19:21 PM »
Quote
I would read it and benefit from it. It's one of the things stopping me from writing my own code from scratch

I'm all for the tutorial, but I don't know why make files should stop you.  You can simply let GCC generate them for you just adjust three parameters in configuration options in AVR Studio.  Those parameters are your clock frequency, the device, and the level of optimization.

Offline chelmiTopic starter

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: Who is interested in a Makefile tutorial?
« Reply #8 on: July 17, 2009, 10:01:49 AM »
Quote
I would read it and benefit from it. It's one of the things stopping me from writing my own code from scratch

I'm all for the tutorial, but I don't know why make files should stop you.  You can simply let GCC generate them for you just adjust three parameters in configuration options in AVR Studio.  Those parameters are your clock frequency, the device, and the level of optimization.

What do you mean by "You can simply let GCC generate them for you"? Makefiles?

Anyway I agree with you, makefiles are not mandatory; but they become almost necessary when you split your application in multiple files (I'll talk about that in my tutorial).

I feel motivated enough and it's going to rain this week end (again...), perfect to write a tutorial.

Chelmi

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Who is interested in a Makefile tutorial?
« Reply #9 on: July 17, 2009, 05:55:48 PM »
Quote
What do you mean by "You can simply let GCC generate them for you"? Makefiles?

As long as you do not select use an external makefile, in the configuration files of AVR Studio, GCC is automatically generating a makefile for you.

Either way knowing how to create makefiles sounds like a valuable skill to have.  I'm all for the tutorial.
« Last Edit: July 17, 2009, 05:58:16 PM by sonictj »

Offline chelmiTopic starter

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: Who is interested in a Makefile tutorial?
« Reply #10 on: July 17, 2009, 06:23:39 PM »
Quote
What do you mean by "You can simply let GCC generate them for you"? Makefiles?

As long as you do not select use an external makefile, in the configuration files of AVR Studio, GCC is automatically generating a makefile for you.

Either way knowing how to create makefiles sounds like a valuable skill to have.  I'm all for the tutorial.

I doubt GCC will create a Makefile, it's probably generated by AVR Studio.

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Who is interested in a Makefile tutorial?
« Reply #11 on: July 17, 2009, 06:52:01 PM »
the generator can be found in wherever gcc is \utils\bin\make.exe this is the makefile plugin to AVR Studio. I tried something new too, if you look in the build pull down menu of AVR Studio you will see export makefile.  This will give you the makefile for your project.  Here is mine that was generated.  I think I kinda understand whats going on in there.
« Last Edit: July 17, 2009, 06:55:42 PM by sonictj »

Offline chelmiTopic starter

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: Who is interested in a Makefile tutorial?
« Reply #12 on: July 17, 2009, 07:37:00 PM »
the generator can be found in wherever gcc is \utils\bin\make.exe this is the makefile plugin to AVR Studio. I tried something new too, if you look in the build pull down menu of AVR Studio you will see export makefile.  This will give you the makefile for your project.  Here is mine that was generated.  I think I kinda understand whats going on in there.

make is the Makefile interpreter. It reads a Makefile and perform the actions described in it. AVR Studio is probably the one generating the Makefile. It will all become clear with my tutorial, hopefully :p

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Who is interested in a Makefile tutorial?
« Reply #13 on: July 17, 2009, 10:23:29 PM »
Quote
make is the Makefile interpreter. It reads a Makefile and perform the actions described in it. AVR Studio is probably the one generating the Makefile. It will all become clear with my tutorial, hopefully :p

ok

 


Get Your Ad Here

data_list