Makefile
author Tero Marttila <terom@fixme.fi>
Fri, 07 May 2010 02:04:37 +0300
changeset 10 faca61cf204c
parent 9 30c3807baac1
child 17 a7c668003a19
permissions -rw-r--r--
add a 'make chat' util
AS = avra
ASFLAGS = 

AD_PART = m328p
AD_PROG = arduino
AD_BAUD = 57600
AD_PORT = /dev/ttyUSB1

AD = avrdude
ADFLAGS = -p $(AD_PART) -c $(AD_PROG) -b $(AD_BAUD) -P $(AD_PORT)

PROG = console

all: $(PROG).s.hex

%.s.hex: %.s
	$(AS) $(ASFLAGS) $<

upload: $(PROG).s.hex
	$(AD) $(ADFLAGS) -U flash:w:$(PROG).s.hex

SERIAL_BAUD = 9600
SERIAL_FLOW = n
SERIAL_PARITY = n
SERIAL_BITS = 8
SERIAL_PORT = $(AD_PORT)

SERIAL_TERM = picocom
SERIAL_FLAGS = -b $(SERIAL_BAUD) -f $(SERIAL_FLOW) -p $(SERIAL_PARITY) -d $(SERIAL_BITS)

chat:
	$(SERIAL_TERM) $(SERIAL_FLAGS) $(SERIAL_PORT)