summaryrefslogtreecommitdiff
path: root/digital/io/src/Makefile
blob: 5cbea0bad6bac72c9dff0d8183dcd13492d46650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Base directory of AVR.
BASE = ../../avr
# Name of the program to build.
PROGS = io
# Sources to compile.
io_SOURCES = main.c fsm_queue.c servo.avr.c eeprom.avr.c pwm.c \
	     switch.avr.c chrono.c timer.avr.c servo_pos.c \
	     twi_master.c asserv.c mimot.c \
	     simu.host.c contact.c usdist.c radar.c \
	     path.c food.c events.host.c \
	     fsm.host.c init.c move.c top.c hola.c loader.c fsm_AI_gen.avr.c
# Modules needed for IO.
MODULES = proto uart twi utils adc math/fixed math/geometry path/astar \
	  trace flash spi
AI_MODULES = twi_master common utils fsm
# Configuration file.
CONFIGFILE = avrconfig.h
# IO board use an ATMega128.
AVR_MCU = atmega128
# Optimize for speed.
OPTIMIZE = -O2
HOST_LIBS = -lm

vpath %.c $(AI_MODULES:%=../../ai/src/%)
vpath %.h $(AI_MODULES:%=../../ai/src/%)
INCLUDES += -I. $(AI_MODULES:%=-I../../ai/src/%)

EXTRA_CLEAN_FILES = fsm_AI_gen.h fsm_AI_gen.avr.c

include $(BASE)/make/Makefile.gen

# FSM generation.
obj/main.avr.o: fsm_AI_gen.h
fsm_AI_gen.avr.c: fsm_AI_gen.h
fsm_AI_gen.h: io.host
	./$< --gen
	mv fsm_AI_gen.c fsm_AI_gen.avr.c

events.h events.host.c: trace.trc
	PYTHONPATH=$(BASE)/../../host python $(BASE)/../../tools/trace/trace.py -t create -i $< -o

main.c: events.h