This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/Concept/Framework/default/Makefile

146 lines
4.1 KiB
Makefile
Raw Normal View History

###############################################################################
# Makefile for the project RoboCode
###############################################################################
## General Flags
PROJECT = RoboCode
MCU = atmega128
TARGET = RoboCode.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)
2007-02-19 20:57:03 +00:00
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)
2007-02-19 20:57:03 +00:00
LDFLAGS += -lm
## 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
2007-02-18 00:14:00 +00:00
## Include Directories
2007-02-26 21:25:01 +00:00
INCLUDES = -I"Z:\rc2007-soccer\source\Concept\Framework\modules" -I"Z:\rc2007-soccer\source\Concept\Framework\modules\executor" -I"Z:\rc2007-soccer\source\Concept\Framework\modules\input" -I"Z:\rc2007-soccer\source\Concept\Framework\modules\interpreter" -I"Z:\rc2007-soccer\source\Concept\Framework\modules\logic" -I"Z:\rc2007-soccer\source\Concept\Framework\modules\output"
2007-02-18 00:14:00 +00:00
2007-02-18 17:57:03 +00:00
## Libraries
LIBS = -lm
## Objects that must be built in order to link
2007-02-26 21:25:01 +00:00
OBJECTS = io_module.o atmega128io.o main.o robot.o tools.o distance_sensor.o ir_sensor.o keyboard.o mouse_sensor.o sensor.o position_tracker.o display.o dribbler.o engine.o kicker.o led.o ball_tracker.o navigator.o aktuator.o wireless.o logic.o command_handler.o obstacle_tracker.o
## Objects explicitly added by the user
LINKONLYOBJECTS =
## Build
all: $(TARGET) RoboCode.hex RoboCode.eep size
## Compile
2007-02-18 00:14:00 +00:00
io_module.o: ../modules/io_module.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
atmega128io.o: ../atmega128io.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
main.o: ../main.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
robot.o: ../robot.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
tools.o: ../tools.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
distance_sensor.o: ../modules/input/distance_sensor.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
ir_sensor.o: ../modules/input/ir_sensor.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
keyboard.o: ../modules/input/keyboard.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
mouse_sensor.o: ../modules/input/mouse_sensor.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
sensor.o: ../modules/input/sensor.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
position_tracker.o: ../modules/interpreter/position_tracker.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
display.o: ../modules/output/display.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
dribbler.o: ../modules/output/dribbler.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
engine.o: ../modules/output/engine.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
kicker.o: ../modules/output/kicker.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
led.o: ../modules/output/led.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
ball_tracker.o: ../modules/interpreter/ball_tracker.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-18 00:14:00 +00:00
navigator.o: ../modules/executor/navigator.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-22 13:12:03 +00:00
aktuator.o: ../modules/executor/aktuator.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
wireless.o: ../modules/wireless.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
logic.o: ../modules/logic/logic.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
2007-02-26 21:25:01 +00:00
command_handler.o: ../modules/interpreter/command_handler.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
obstacle_tracker.o: ../modules/interpreter/obstacle_tracker.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) RoboCode.elf dep/* RoboCode.hex RoboCode.eep
## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)