-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (37 loc) · 1.64 KB
/
Makefile
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
43
44
#############################################################################
# RoboCard LED Test
# Copyright (c) 2010 Kjeld Jensen <[email protected]>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
#############################################################################
# File: Makefile
# Project: RoboCard LED Test
# Platform: RoboCard v1.0 http://www.robocard.dk
# Microcontroller: ATmega88PA
# Author: Kjeld Jensen <[email protected]>
# Created: 2010-08-09
# Last modified: 2010-08-09
#############################################################################
PROJECT=main
SOURCES=main.c led.c usart.c adc.c
MMCU=atmega328
CC=avr-gcc
CFLAGS= -mmcu=$(MMCU) -Wall -Os
default:
@echo ""
@echo "make clean......delete object & hex files"
@echo "make hex........build the $(PROJECT).hex file"
@echo "make flash......copy $(PROJECT).hex to RoboCard flash"
@echo ""
hex: $(PROJECT).elf
avr-objcopy -j .text -O ihex $(PROJECT).elf $(PROJECT).hex
$(PROJECT).elf: $(SOURCES)
$(CC) $(CFLAGS) -I./ -o $(PROJECT).elf $(SOURCES)
flash: $(PROJECT).hex
#avrdude -p atmega88p -c usbasp -U flash:w:$(PROJECT).hex
avrdude -c usbasp -p m328p -U flash:w:main.hex:i
clean:
rm -f $(PROJECT).elf $(PROJECT).hex