First I have to note that apart from creating the “Hello World” application in Xcode, I have not used Xcode for any application development. Most of my avr code development has been fairly dodgy C code using CodevisionAVR (and assembly code when I was first introduced to microcontroller programming)
So I decided to try and do all my AVR development on my mac. First thing to do was download and install CrossPack from http://www.obdev.at/products/crosspack/index.html. These folks have done a stella job of packaging pretty much all the required software.
The first place I went to to get the OS X avr development tools was http://www.digithink.com/OSX-AVR/ but he pointed users to the CrossPack instead of his package. He did make note however that he was going to contact them and ask them to include the Xcode templates.
I had a look at the Xcode template that is supplied with OSX-AVR (created by Nick Lott) and it looked ok. Installing just the Xcode templates however, put them in the wrong place for my system (I’m running Xcode 3.1.2 and OS X.5.6). They were installed into /Library/Application Support/Apple/Developer Tools. I moved them to ~/Library/Application Support/Developer/Shared/Xcode/
I created a new project using the Basic AVR C project and Built it. The build failed because it was trying to find avr-gcc and it was not in the Xcode project template path. So I edited the project.pbxproj file in ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/AVR/Basic AVR C Project/AVR.xcodeproj directory and removed PATH = “/sw/bin/:/usr/local/bin/:$PATH”; and replaced it with PATH = “$(PATH):/usr/local/CrossPack-AVR/bin”; I had to replace about three instances of this path. After making these changes I was able to successfully build the sample code provided with the template.