Index: branches/simulator/lib/bin/libsim.a
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/simulator/lib/bin/libsim.a
===================================================================
--- branches/simulator/lib/bin/libsim.a	(nonexistent)
+++ branches/simulator/lib/bin/libsim.a	(revision 950)

Property changes on: branches/simulator/lib/bin/libsim.a
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: branches/simulator/projects/simulator/libsim/Makefile
===================================================================
--- branches/simulator/projects/simulator/libsim/Makefile	(revision 949)
+++ branches/simulator/projects/simulator/libsim/Makefile	(revision 950)
@@ -2,9 +2,9 @@
 eeprom.c encoders.c lcd.c i2c.c libsim.c motors.c \
 move.c orbs.c rangefinder.c reset.c serial.c spi.c
 
-BRANCH_HOME = ../../..
-INCLUDE = $(BRANCH_HOME)/lib/include/libdragonfly
-OUTPUT = $(BRANCH_HOME)/lib/bin
+CODE_HOME = ../../..
+INCLUDE = $(CODE_HOME)/lib/include/libdragonfly
+OUTPUT = $(CODE_HOME)/lib/bin
 
 OBJ = $(SRC:.c=.o)
 
@@ -13,6 +13,7 @@
 AR = ar
 LDFLAGS = 
 RM = rm
+CP = cp
 
 TARGET = libsim
 
@@ -25,3 +26,5 @@
 clean:
 	$(RM) $(OBJ) $(TARGET).a
 
+dist: all
+	$(CP) $(TARGET).a $(OUTPUT)
Index: branches/simulator/projects/simulator/common/robot_shared.h
===================================================================
--- branches/simulator/projects/simulator/common/robot_shared.h	(nonexistent)
+++ branches/simulator/projects/simulator/common/robot_shared.h	(revision 950)
@@ -0,0 +1,9 @@
+
+
+
+typedef struct RobotSharedType
+{
+	short motor1;
+	short motor2;
+} RobotShared;
+
Index: branches/simulator/projects/template/Makefile
===================================================================
--- branches/simulator/projects/template/Makefile	(revision 949)
+++ branches/simulator/projects/template/Makefile	(revision 950)
@@ -2,10 +2,8 @@
 #
 #
 
-# Relative path to the root directory (containing lib directory)
-ifndef COLONYROOT
-COLONYROOT = ../../..
-endif
+# COMX in Windows. /dev/ttyUSBX in Linux.
+AVRDUDE_PORT = /dev/ttyUSB0
 
 # Target file name (without extension).
 TARGET = template
@@ -13,8 +11,11 @@
 # Uncomment this to use the wireless library
 # USE_WIRELESS = 1
 
-# com1 = serial port. Use lpt1 to connect to parallel port.
-AVRDUDE_PORT = /dev/ttyUSB0
+# Relative path to the root directory (containing lib directory)
+ifndef COLONYLIB
+COLONYLIB = ../../lib
+endif
+
 #
 #
 ###################################
@@ -111,15 +112,13 @@
 CDEFS += -DF_CPU=$(F_CPU)UL
 CDEFS += -DFFP
 # for wireless library
-ifdef USE_WIRELESS
-	CDEFS += -DROBOT
-endif
+CDEFS += -DROBOT
 
 # Place -I, -L options here
-CINCS = -I$(COLONYROOT)/code/lib/include/libdragonfly
-CINCS += -L$(COLONYROOT)/code/lib/bin
+CINCS = -I$(COLONYLIB)/include/libdragonfly
+CINCS += -L$(COLONYLIB)/bin
 ifdef USE_WIRELESS
-	CINCS += -I$(COLONYROOT)/code/lib/include/libwireless
+	CINCS += -I$(COLONYLIB)/include/libwireless
 endif
 
 #---------------- Compiler Options ----------------
@@ -135,9 +134,17 @@
 CFLAGS += -O$(OPT)
 CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
 CFLAGS += -Wall -Wstrict-prototypes
+CFLAGS += $(CSTANDARD)
 CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
-CFLAGS += $(CSTANDARD)
 
+SIMCFLAGS = 
+# SIMCFLAGS = -g$(DEBUG)
+SIMCFLAGS += $(CDEFS) $(CINCS)
+SIMCFLAGS += -O$(OPT)
+SIMCFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
+SIMCFLAGS += -Wall -Wstrict-prototypes
+CFSIMLAGS += $(CSTANDARD)
+
 #---------------- Assembler Options ----------------
 #  -Wa,...:   tell GCC to pass this to the assembler.
 #  -ahlms:    create listing
@@ -197,6 +204,7 @@
 	LDFLAGS += -lwireless
 endif
 LDFLAGS += -ldragonfly
+SIMLDFLAGS = -lsim
 
 
 
@@ -275,6 +283,7 @@
 # Define programs and commands.
 SHELL = sh
 CC = avr-gcc
+SIMCC = gcc
 OBJCOPY = avr-objcopy
 OBJDUMP = avr-objdump
 SIZE = avr-size
@@ -309,6 +318,7 @@
 
 # Define all object files.
 OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
+SIMOBJ = $(SRC:.c=.obj) $(ASRC:.S=.obj)
 
 # Define all listing files.
 LST = $(SRC:.c=.lst) $(ASRC:.S=.lst)
@@ -321,17 +331,20 @@
 # Combine all necessary flags and optional flags.
 # Add target processor to flags.
 ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
+SIMALL_CFLAGS = -I. $(SIMCFLAGS)
 ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 
-
-
-
-
 # Default target.
 all: begin gccversion sizebefore build sizeafter end
 
 build: elf hex eep lss sym
+sim: $(SIMOBJ)
+	$(SIMCC) $(SIMALL_CFLAGS) $^ -o $(TARGET) $(SIMLDFLAGS)
 
+%.obj : %.c
+	$(SIMCC) -c $(SIMALL_CFLAGS) $< -o $@
+
+
 elf: $(TARGET).elf
 hex: $(TARGET).hex
 eep: $(TARGET).eep
@@ -502,6 +515,7 @@
 	$(REMOVE) $(TARGET).sym
 	$(REMOVE) $(TARGET).lss
 	$(REMOVE) $(OBJ)
+	$(REMOVE) $(SIMOBJ)
 	$(REMOVE) $(LST)
 	$(REMOVE) $(SRC:.c=.s)
 	$(REMOVE) $(SRC:.c=.d)
