Skip to content

Commit

Permalink
fixed Arduino 0022 + XCode 4.2.1 (I hope)
Browse files Browse the repository at this point in the history
updated the whole project to work with all boards and have all the
settings in the build settings. No need to touch the makefile anymore.

fingers crossed!
  • Loading branch information
timknapen committed Jan 19, 2012
1 parent c2bcb80 commit c3e0ff9
Show file tree
Hide file tree
Showing 38 changed files with 751 additions and 993 deletions.
1,256 changes: 305 additions & 951 deletions Arduino/ArduinoOnXCode4_2/ArduinoOnXCode4.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "19A5FF0D14757BAC00FAEAAB"
BuildableName = "Upload"
BlueprintName = "Build and Upload"
ReferencedContainer = "container:ArduinoOnXCode4.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "19A5FEE8147578E500FAEAAB"
BuildableName = "Build"
BlueprintName = "Build"
ReferencedContainer = "container:ArduinoOnXCode4.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2259D1A514C876480021B514"
BuildableName = "clean"
BlueprintName = "clean"
ReferencedContainer = "container:ArduinoOnXCode4.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Build and Upload.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>Build.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>clean.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>19A5FEE8147578E500FAEAAB</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>19A5FF0D14757BAC00FAEAAB</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>2259D1A514C876480021B514</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
37 changes: 19 additions & 18 deletions Arduino/ArduinoOnXCode4_2/Makefile
@@ -1,34 +1,33 @@

ARDUINO = /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino
LIB_ROOT = /Applications/Arduino.app/Contents/Resources/Java/libraries
#AVRDUDE_DIR = /usr/local/CrossPack-AVR/bin # Crosspack version
AVRDUDE_DIR = /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin
AVRDUDE_CONF= /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf

AVRDUDE_DIR = $(ARDUINO_APP_PATH)/Contents/Resources/Java/hardware/tools/avr/bin
AVRDUDE_CONF= $(ARDUINO_APP_PATH)/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf
SIZE = $(AVRDUDE_DIR)/avr-size
SOURCES = $(wildcard src/*.cpp)

# loading libraries
LIBRARIES = EEPROM Ethernet/utility SPI \
Firmata LiquidCrystal Matrix Sprite \
SD SD/utility Servo SoftwareSerial \
Stepper Wire Wire/utility
@echo "Whatever you do, this is the called action:" $(ACTION);

# add arduino app path to the paths..
ARD_LIBRARIES = $(ARDUINO_LIBRARIES)
ARD_LIBRARIES_PATH = $(ARDUINO_APP_PATH)$(ARDUINO_LIBRARIES_PATH)
ARD_PATH = $(ARDUINO_APP_PATH)$(ARDUINO_PATH)

# make the correct paths for the libraries
INCLUDE_LIBRARIES = $(addprefix -I$(LIB_ROOT)/,$(LIBRARIES)) \
INCLUDE_LIBRARIES = $(addprefix -I$(ARD_LIBRARIES_PATH)/,$(ARD_LIBRARIES)) \
$(addprefix -I, $(LIBRARY_PATHS))

# find .cpp files in libraries
CPP_LIBRARIES = $(foreach lib,$(LIBRARIES),$(wildcard $(LIB_ROOT)/$(lib)/*.cpp))
CPP_LIBRARIES = $(foreach lib,$(ARD_LIBRARIES),$(wildcard $(ARD_LIBRARIES_PATH)/$(lib)/*.cpp))
CPP_LIBRARIES += $(foreach item, $(LIBRARY_PATHS), $(wildcard $(item)/*.cpp))

# main file
TARGET = main

# find .c files in arduino directory
SRC = $(wildcard $(ARDUINO)/*.c)
SRC = $(wildcard $(ARD_PATH)/*.c)

# .cpp files from libraries and arduino directory
CXXSRC = $(SOURCES) $(wildcard $(ARDUINO)/*.cpp) $(CPP_LIBRARIES)
CXXSRC = $(SOURCES) $(wildcard $(ARD_PATH)/*.cpp) $(CPP_LIBRARIES)


# Name of this Makefile (used for "make depend").
Expand All @@ -46,8 +45,8 @@ CDEFS = -DF_CPU=$(F_CPU)
CXXDEFS = -DF_CPU=$(F_CPU)

# Place -I options here : include libraries
CINCS = -I$(ARDUINO) $(INCLUDE_LIBRARIES)
CXXINCS = -I$(ARDUINO) $(INCLUDE_LIBRARIES)
CINCS = -I$(ARD_PATH) $(INCLUDE_LIBRARIES)
CXXINCS = -I$(ARD_PATH) $(INCLUDE_LIBRARIES)

# Compiler flag to set the C Standard level.
# c89 - "ANSI" C
Expand Down Expand Up @@ -97,7 +96,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)


# Default target.
all: clean build sizeafter
all: clean build sizeafter upload
@echo "action = all";


Expand Down Expand Up @@ -131,6 +130,8 @@ folder:
# Program the device.
upload: bin/$(TARGET).hex
$(AVRDUDE) -C$(AVRDUDE_CONF) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
@echo "action = upload";


# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) bin/$(TARGET).hex
Expand Down Expand Up @@ -209,7 +210,7 @@ bin/$(TARGET).elf: bin/core.a

# Target: clean project.
clean:
$(REMOVE) bin/$(TARGET).hex bin/$(TARGET).eep bin/$(TARGET).cof bin/$(TARGET).elf \
$(REMOVE) bin/*.o bin/*.a bin/$(TARGET).hex bin/$(TARGET).eep bin/$(TARGET).cof bin/$(TARGET).elf \
bin/$(TARGET).map bin/$(TARGET).sym bin/$(TARGET).lss bin/core.a \
$(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d)

Expand Down
22 changes: 18 additions & 4 deletions Arduino/ArduinoOnXCode4_2/README
@@ -1,6 +1,12 @@

### This is the Arduino on XCode 4 help file ###

This is not a real "XCode Template". It is an empty project to start from.
Just copy the whole folder, give it another name and start working with it this way.

This project is for Arduino.app version 0022 !!!
The 1.0 version has had a few changes internally that break the makefile included here (I think)

The preferred place for help, discussion and suggestions is here:
http://arduino.cc/forum/index.php/topic,49956.0.html

Expand All @@ -15,15 +21,23 @@
In the middle window click on the project name under "Project"
Click the "Info" tab (next to Build Settings)
Under "Configuration" click the triangle next to "Release" to make it fold open.
Then fold open the project to see the "Build" and "Build and Upload" targets.
Then fold open the project to see the "Build" , "Clean" and "Build and Upload" targets.
Select your board in the "Based on Configuration File" next to each target.

WARNING it appears that you can't compile the .cpp files included in Arduino.app when it is inside /Applications/
I assume this is because Lion has new permissions for the Applications/ folder.
Suggested solution: move Arduino.app out of /Applications/ into a folder you have full read/write access to.
You will have to change the build setting called 'ARDUINO_APP_PATH' to the correct new path.
Or you change the permissions of Arduino.app to allow everyone read/write access.
To do this, you can go to Arduino.app, right click > Show Package Contents,
Right click on Contents > Show Info. Then scroll down to "Sharing and Permissions" and set everybody's persmissions to Read & Write.
And choose "Apply to enclosing items" from the gear drop-down.

### LIBRARIES

All the standard libraries included in Arduino.app are already included in the makefile.
You just need to #include them like you normally would.

All the standard libraries included in Arduino.app are already included in the build settings.

### To add another library:

Expand Down
1 change: 1 addition & 0 deletions Arduino/ArduinoOnXCode4_2/config/BT168.xcconfig
@@ -1,3 +1,4 @@
#include "_basic_arduino_settings.xcconfig"


// Arduino BT with ATmega168
Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/BT328.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino BT with Atmega328

Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/Diecimila168.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino Diecimila, Duemilanove or Nano with ATmega168

Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/Duemilanove328.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino Duemilanove or Nano w/ ATmega328
// Arduino Duemillanove
Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/Mega2560.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino Mega 2560

Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/NG168.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino NG

Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/NG8.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino NG
BOARD = Arduino_NG
Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/Pro168.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega168

Expand Down
2 changes: 1 addition & 1 deletion Arduino/ArduinoOnXCode4_2/config/Pro328.xcconfig
@@ -1,4 +1,4 @@

#include "_basic_arduino_settings.xcconfig"

// Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328

Expand Down

0 comments on commit c3e0ff9

Please sign in to comment.