summaryrefslogtreecommitdiffstats
path: root/sw/programmer/avr/makefile
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-08-07 19:27:05 +0200
committerNao Pross <naopross@thearcway.org>2017-08-07 19:27:05 +0200
commitd0801b36b47d8f3da610597160fde92059fd7e62 (patch)
treef9f0e348145c3548433e60adbf459e784b909f96 /sw/programmer/avr/makefile
parentfilesystem structure intro and docs (diff)
downloadz80uPC-d0801b36b47d8f3da610597160fde92059fd7e62.tar.gz
z80uPC-d0801b36b47d8f3da610597160fde92059fd7e62.zip
implementation for avr programmer
the programmer will receive the binary in blocks of defined size by a program under sw/programmer/linux (moved from sw/linux).
Diffstat (limited to 'sw/programmer/avr/makefile')
-rw-r--r--sw/programmer/avr/makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/sw/programmer/avr/makefile b/sw/programmer/avr/makefile
new file mode 100644
index 0000000..95fb5fe
--- /dev/null
+++ b/sw/programmer/avr/makefile
@@ -0,0 +1,31 @@
+###
+# Project settings
+#
+TARGET := programmer
+SOURCES := $(wildcard *.c)
+
+###
+# Compiler settings
+#
+CC := avr-gcc
+PORT := /dev/ttyUSB0
+MCU := atmega328p
+
+CFLAGS := -g -Wall -mcall-prologues -mmcu=$(MCU) -Os -I . \
+ -DF_CPU=1000000UL
+LDFLAGS := -Wl,-gc-sections -Wl,-relax
+
+.PHONY: all clean program
+all: $(TARGET).hex
+
+clean:
+ rm -f *.o *.hex *.obj *.bin
+
+$(TARGET).hex: $(TARGET).bin
+ avr-objcopy -R .eeprom -O ihex $(TARGET).bin $@
+
+$(TARGET).bin: $(SOURCES)
+ $(CC) $(CFLAGS) $(SOURCES) -o $@ $(LDFLAGS)
+
+program: $(TARGET).hex
+ avrdude -p $(MCU) -c usbasp -P usb -U flash:w:$(TARGET).hex