Makefile for linux?

Posting in the faq forum because I doubt Im the only one wondering..

The question: What do people use, and where can I get it? Background: The IDE supplied from the Arduino team is too limiting, and certainly out of place in a linux environment.

I just want some 'simple' things to just work:

make make upload make monitor

..and some more..

Further I want to define my own 'monitor' for the usb/serial line.

I really hope there is something I can use..

Why use make? I would always prefer scons.


eh... I frequently use EMACS to edit and minicom as a serial monitor; it doesn't bother me to use the IDE as the compile/upload tool. IMO, at the moment the build process is in too much flux (wrt changes in directory locations, compiler switches, and etc) to trust an unsupported makefile (or equiv) to generate equivalent code to the IDE...

Hence my recommendation to go for scons. IMHO it is much easier to fix sconstruct files. Make files always give me a headache.


Udo: arscons might be just the tool i want. I did not know that such a ting existed. I will read more about scons. You are quite right about Makefiles; they can be very readable, but the pain starts when you have to change something.

westfw: minicom it is! 8-)

Thank you for youre replies. Just what I needed to get going again.

@noctrl: scons is definitely the tool you want. My first try on Arduino makefiles took me >2 days. And any changes were always painful. My first sconstruct that did what I wanted took about 4 hours and I never did something with scons before. This think is definitely to be prefered. Adapting sconstructs is also much simpler.

Bonus goodie: since it is written in python debugging is easily possible.


So are there published scons files to support Arduino? (I'd never heard of scons before. I have a bad feeling about this. First a proliferation of SCCS, now a proliferation of build utilities. Sigh. No one will ever agree on which one is best, and we'll all end up needing to install and understand ALL of them!.)

@Westf: the proliferation of build utilities started long ago.

According to Wikipedia there at least:

Make, GNU Make, nmake (AT&T), nmake (Microsoft), Turbo Make (Borland), JMake, Opus Make, makepp, mk, SCons, Apache Ant and Apache Maven, Vesta, Jam, Rant, Rake, A-A-P, Yabu

Yes this is sometimes anoying. But Scons was definitely worth to learn.


It is helpful to me.

Well, I started with arscons now. Dont look like there is much into it from my point of view, just edit the paths.

For some reason my USB irqs are messing up, probably unrelated as my cheapo USB scope also have problems.. Once this is sorted out I think I have what I want.

After reading a bit about scons and looking at the arscons script, i think that scons is better fit for our use than make. That is python instead of using shell commands, so it shold be cross platform too.

Only one way to find out .. ;)

hm, not only my irq’s… :

$ avrdude -V -F -c stk500 -b 57600 -p atmega328p -P /dev/ttyUSB0 -U flash:w:test.hex
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
$ avrdude -V -F -c arduino -b 57600 -p atmega328p -P /dev/ttyUSB0 -U flash:w:test.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

So overriding the upload protocol in SConstruct file makes it work:


Dont know why… …Im not familiar with this stuff yet…

I think I found out why uploading fails: (see comment #4)

avrdude supplyed with the arduino-0021 sw is too old. The debian (Sid) provided avrdude (ver 5.10) does the job if I tell (avrdude) to use "arduino" as the upload method/protocol