aboutsummaryrefslogtreecommitdiff
path: root/examples/usartecho/makefile
blob: 15254c6630d6335649e8a59e5512613263882bf4 (plain)
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
MAKEFLAGS += --no-builtin-rules

MMCU = atmega328p
F_CPU = 16000000L
IOE_PREFIX = ../..
IOE_SHORTOUTPUT=y
IOE_CFLAGS = -Os -fshort-enums -Wall \
			 -DF_CPU=$(F_CPU) -mmcu=$(MMCU) \
			 -DCONFIG_IOE_USART \
			 -DCONFIG_IOE_USART_OUTBUFFER_SIZE=64 \
			 -DCONFIG_IOE_USART_OUTBUFFER_MODE=0 \
			 -DCONFIG_IOE_USART_BAUD=115200 \
			 -DCONFIG_IOE_USART_PARITY=USART_PARITY_NONE \
			 -DCONFIG_IOE_USART_STOPBIT=USART_STOPBIT_SINGLE \
			 -DCONFIG_IOE_USART_DATABITS=8

all: usart.hex
	@echo Now you can flash usart.hex to your chip.

clean: ioeclean
	$(RM) echo.o
	$(RM) usart.elf usart.hex

include ../../avr-ioe.mk

usart.elf: %.elf: $(IOE_OBJ) echo.o
	@echo " LD       $@"
	@avr-gcc -Os -mmcu=$(MMCU) $^ -o $@

usart.hex: %.hex: %.elf
	@echo " OBJCOPY  $@"
	@avr-objcopy -O ihex -R .eeprom $< $@

echo.o: %.o: %.c
	@echo " CC       $@"
	@avr-gcc $(IOE_CFLAGS) -c -o $@ $<