aboutsummaryrefslogtreecommitdiff
path: root/examples/usartecho/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'examples/usartecho/makefile')
-rw-r--r--examples/usartecho/makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/usartecho/makefile b/examples/usartecho/makefile
new file mode 100644
index 0000000..343addc
--- /dev/null
+++ b/examples/usartecho/makefile
@@ -0,0 +1,29 @@
+MAKEFLAGS += --no-builtin-rules
+
+MMCU = atmega328p
+F_CPU = 16000000L
+IOE_PREFIX = ../..
+IOE_CFLAGS = -Os -ffunction-sections -fdata-sections -fshort-enums -Wall -g \
+ -DCONFIG_IOE_USART_OUTBUFFER_SIZE=64 \
+ -DCONFIG_IOE_USART_OUTBUFFER_MODE=0
+
+all: usart.hex
+ @echo Flash usart.hex to chip
+
+install: usart.hex
+ # TODO
+
+clean: ioeclean
+ $(RM) echo.o
+ $(RM) usart.elf usart.hex
+
+include ../../avr-ioe.mk
+
+usart.elf: %.elf: $(IOE_OBJ_USART) echo.o
+ avr-gcc -mmcu=$(MMCU) $^ -o $@
+
+usart.hex: %.hex: %.elf
+ avr-objcopy -O ihex -R .eeprom $< $@
+
+echo.o: %.o: %.c
+ avr-gcc $(IOE_CFLAGS) -c -o $@ $<