summaryrefslogtreecommitdiffstats
path: root/source/AVR_Studio/Soccer/default/Makefile
diff options
context:
space:
mode:
authorsicarius <devnull@localhost>2007-02-11 20:03:00 +0100
committersicarius <devnull@localhost>2007-02-11 20:03:00 +0100
commit05c8b0af602b222d00c227560682158333b726a2 (patch)
tree98a7eaa96222097b9d74343b37447820f9250efc /source/AVR_Studio/Soccer/default/Makefile
parent1a6b28b1c2a68cfccbe8f4ed9866aadf88db7085 (diff)
downloadrc2007-soccer-05c8b0af602b222d00c227560682158333b726a2.tar
rc2007-soccer-05c8b0af602b222d00c227560682158333b726a2.zip
Added lot's of code-files used during work
Diffstat (limited to 'source/AVR_Studio/Soccer/default/Makefile')
-rwxr-xr-xsource/AVR_Studio/Soccer/default/Makefile97
1 files changed, 97 insertions, 0 deletions
diff --git a/source/AVR_Studio/Soccer/default/Makefile b/source/AVR_Studio/Soccer/default/Makefile
new file mode 100755
index 0000000..e12720e
--- /dev/null
+++ b/source/AVR_Studio/Soccer/default/Makefile
@@ -0,0 +1,97 @@
+###############################################################################
+# Makefile for the project Soccer
+###############################################################################
+
+## General Flags
+PROJECT = Soccer
+MCU = atmega128
+TARGET = Soccer.elf
+CC = avr-g++.exe
+
+## Options common to compile, link and assembly rules
+COMMON = -mmcu=$(MCU)
+
+## Compile options common for all C compilation units.
+CFLAGS = $(COMMON)
+CFLAGS += -Wall -gdwarf-2 -DF_CPU=16000000ULUL -O3 -fsigned-char
+CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
+
+## Assembly specific flags
+ASMFLAGS = $(COMMON)
+ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
+
+## Linker flags
+LDFLAGS = $(COMMON)
+LDFLAGS +=
+
+
+## Intel Hex file production flags
+HEX_FLASH_FLAGS = -R .eeprom
+
+HEX_EEPROM_FLAGS = -j .eeprom
+HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
+HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0
+
+
+## Objects that must be built in order to link
+OBJECTS = Soccer.o board.o keylcd.o i2c.o global.o uart.o navigation.o sensor.o ballsensor.o
+
+## Objects explicitly added by the user
+LINKONLYOBJECTS =
+
+## Build
+all: $(TARGET) Soccer.hex Soccer.eep size
+
+## Compile
+Soccer.o: ../Soccer.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+board.o: ../hal/board.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+keylcd.o: ../hal/keylcd.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+i2c.o: ../hal/i2c.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+global.o: ../global.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+uart.o: ../hal/uart.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+navigation.o: ../navigation.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+sensor.o: ../sensor/sensor.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+ballsensor.o: ../sensor/ballsensor.c
+ $(CC) $(INCLUDES) $(CFLAGS) -c $<
+
+##Link
+$(TARGET): $(OBJECTS)
+ $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
+
+%.hex: $(TARGET)
+ avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
+
+%.eep: $(TARGET)
+ avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@
+
+%.lss: $(TARGET)
+ avr-objdump -h -S $< > $@
+
+size: ${TARGET}
+ @echo
+ @avr-size -C --mcu=${MCU} ${TARGET}
+
+## Clean target
+.PHONY: clean
+clean:
+ -rm -rf $(OBJECTS) Soccer.elf dep/* Soccer.hex Soccer.eep
+
+## Other dependencies
+-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
+