root / scout_avr / Makefile @ 3a73516c
History | View | Annotate | Download (898 Bytes)
1 |
|
---|---|
2 |
PART=m128rfa1 |
3 |
MCU=atmega128rfa1 |
4 |
|
5 |
#PART=m328p |
6 |
#MCU=atmega328 |
7 |
|
8 |
#PART=m2560 |
9 |
#MCU=atmega2560 |
10 |
|
11 |
PROG=avrispMKII |
12 |
#PROG=stk600 |
13 |
|
14 |
F_CPU=16000000 |
15 |
SRC=src/*.cpp src/ros_lib/*.cpp |
16 |
HDR=src/*.h |
17 |
FLAGS=-Isrc/ros_lib -Isrc -mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -funsigned-char -Os -fpack-struct -Wall |
18 |
|
19 |
ROS_MSG_DEPS=rosserial_msgs std_msgs messages |
20 |
|
21 |
default: scout_avr.hex |
22 |
|
23 |
# need the SRC globs above to be re-evaluated |
24 |
all: ros_lib |
25 |
make scout_avr.hex |
26 |
|
27 |
%.hex: %.elf |
28 |
avr-objcopy -j .text -j .data -O ihex $< $@ |
29 |
|
30 |
scout_avr.elf: $(SRC) $(HDR) |
31 |
avr-g++ $(FLAGS) $(SRC) -o scout_avr.elf |
32 |
|
33 |
program: scout_avr.hex |
34 |
avrdude -p $(PART) -c $(PROG) -P usb -B 1 -U flash:w:scout_avr.hex |
35 |
|
36 |
ros_lib: ros_lib_nomsgs msgs |
37 |
|
38 |
ros_lib_nomsgs: |
39 |
rm -rf src/ros_lib |
40 |
cp -r `rospack find rosserial_client`/src/ros_lib src |
41 |
|
42 |
msgs: |
43 |
rosrun rosserial_client make_library.py src $(ROS_MSG_DEPS) |
44 |
|
45 |
clean: |
46 |
rm -rf scout_avr.elf scout_avr.hex src/ros_lib |