Makefile
author Tero Marttila <terom@fixme.fi>
Sun, 09 May 2010 23:17:14 +0300
changeset 29 453550e69e07
parent 18 79b25e81721f
child 30 5226e512755c
permissions -rw-r--r--
Test use of Timer0
5
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
AS = avra
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
ASFLAGS = 
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
AD_PART = m328p
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
AD_PROG = arduino
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     6
AD_BAUD = 57600
17
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
     7
AD_PORT = /dev/ttyUSB0
5
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     8
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     9
AD = avrdude
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    10
ADFLAGS = -p $(AD_PART) -c $(AD_PROG) -b $(AD_BAUD) -P $(AD_PORT)
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    11
29
453550e69e07 Test use of Timer0
Tero Marttila <terom@fixme.fi>
parents: 18
diff changeset
    12
PROG = timer
17
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
    13
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
    14
all: $(PROG).hex
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
    15
29
453550e69e07 Test use of Timer0
Tero Marttila <terom@fixme.fi>
parents: 18
diff changeset
    16
led7seg.hex: spi.inc led7seg.inc adc.inc timer.inc delay.inc macros.inc
453550e69e07 Test use of Timer0
Tero Marttila <terom@fixme.fi>
parents: 18
diff changeset
    17
timer.hex: timer.inc macros.inc
453550e69e07 Test use of Timer0
Tero Marttila <terom@fixme.fi>
parents: 18
diff changeset
    18
17
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
    19
%.hex: %.s
5
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    20
	$(AS) $(ASFLAGS) $<
17
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
    21
	mv $<.hex $@
5
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    22
17
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
    23
upload: $(PROG).hex
a7c668003a19 split led7seg.s into .inc modules, and update Makefile to use .s -> .hex, and above .inc's for led7seg
Tero Marttila <terom@fixme.fi>
parents: 10
diff changeset
    24
	$(AD) $(ADFLAGS) -U flash:w:$<
5
7feeaeb473b5 Makefile
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    25
10
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    26
SERIAL_BAUD = 9600
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    27
SERIAL_FLOW = n
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    28
SERIAL_PARITY = n
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    29
SERIAL_BITS = 8
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    30
SERIAL_PORT = $(AD_PORT)
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    31
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    32
SERIAL_TERM = picocom
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    33
SERIAL_FLAGS = -b $(SERIAL_BAUD) -f $(SERIAL_FLOW) -p $(SERIAL_PARITY) -d $(SERIAL_BITS)
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    34
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    35
chat:
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    36
	$(SERIAL_TERM) $(SERIAL_FLAGS) $(SERIAL_PORT)
faca61cf204c add a 'make chat' util
Tero Marttila <terom@fixme.fi>
parents: 9
diff changeset
    37