Statistics
| Branch: | Revision:

root / scout_avr / Makefile @ c2b64420

History | View | Annotate | Download (847 Bytes)

1 807483bf Tom Mullins
2 cc9ca04e Tom Mullins
PART=m128rfa1
3
MCU=atmega128rfa1
4 807483bf Tom Mullins
5
#PART=m328p
6
#MCU=atmega328
7
8 cc9ca04e Tom Mullins
#PART=m2560
9
#MCU=atmega2560
10 807483bf Tom Mullins
11 cc9ca04e Tom Mullins
PROG=avrispMKII
12
#PROG=stk600
13 807483bf Tom Mullins
14 812788aa Tom Mullins
F_CPU=16000000
15 88fb3a79 Tom Mullins
SRC=src/*.cpp src/ros_lib/*.cpp
16 cf115e3d Tom Mullins
HDR=src/*.h
17 88fb3a79 Tom Mullins
FLAGS=-Isrc/ros_lib -Isrc -mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -funsigned-char -Os -fpack-struct -Wall
18
19 c2b64420 Tom Mullins
ROS_MSG_DEPS=rosserial_msgs std_msgs bom sonar
20
21
default: scout_avr.hex
22
23
all: ros_lib scout_avr.hex
24 88fb3a79 Tom Mullins
25
%.hex: %.elf
26
	avr-objcopy -j .text -j .data -O ihex $< $@
27
28 cf115e3d Tom Mullins
scout_avr.elf: $(SRC) $(HDR)
29 88fb3a79 Tom Mullins
	avr-g++ $(FLAGS) $(SRC) -o scout_avr.elf
30
31 8969d535 Tom Mullins
program: scout_avr.hex
32 aadf0a75 Tom Mullins
	avrdude -p $(PART) -c $(PROG) -P usb -B 1 -U flash:w:scout_avr.hex
33 49090532 Tom Mullins
34 c2b64420 Tom Mullins
ros_lib: ros_lib_nomsgs msgs
35
36
ros_lib_nomsgs:
37
	rm -rf src/ros_lib
38
	cp -r `rospack find rosserial_client`/src/ros_lib src
39
40
msgs:
41
	rosrun rosserial_client make_library.py src $(ROS_MSG_DEPS)
42
43 88fb3a79 Tom Mullins
clean:
44 c2b64420 Tom Mullins
	rm -rf scout_avr.elf scout_avr.hex src/ros_lib