How to use the avr-toolchain with Xcode

After reading an article about how to use the avr-toolchain with Xcode, I ended up beeing able to build and clean an avr-project in Xcode but that was it, flash and fuse options still required to switch to a terminal and do so manually. 

This was kind of a step backwards, I thought, since developing in textmate and leaving the rest to the makefile seemed to be still more comfortable, so I played around a bit and came up with this:

First make sure you’ve set up your project like this.

Then double click your project, switch to configurations tab, duplicate twice, and rename your new build-configurations to eg. Build and Deploy 

picture-3

Next, double click your project’s target, select your build configuration e.g. Deploy and add a new setting, name it “COMMAND” and assign “flash to it’s value.
Then 
 change the argument to make from $(ACTION)  to $(COMMAND)
This will result in Xcode executing make flash when you hit build.

 

picture-11

Now select your other build configuration and again, add a “COMMAND”  setting, but this time  just leave the value
blank to run make without any arguments. Otherwise you could set it to “fuse” or what else you want make to do. 

Once you’ve set this up, you can easily use all the capabilities of your makefile by switching between build configurations. 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: