Initial commit
This commit is contained in:
commit
8a6c7da3f8
20
Makefile
Normal file
20
Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
MCU=atmega328p
|
||||||
|
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=16000000
|
||||||
|
LDFLAGS=-Wl,-gc-sections -Wl,-relax
|
||||||
|
CC=avr-gcc
|
||||||
|
TARGET=main
|
||||||
|
OBJECT_FILES=main.o
|
||||||
|
|
||||||
|
all: $(TARGET).hex
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o *.hex *.obj *.hex
|
||||||
|
|
||||||
|
%.hex: %.obj
|
||||||
|
avr-objcopy -R .eeprom -O ihex $< $@
|
||||||
|
|
||||||
|
%.obj: $(OBJECT_FILES)
|
||||||
|
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
program: $(TARGET).hex
|
||||||
|
avrdude -p $(MCU) -P /dev/ttyUSB1 -c arduino -b 57600 -U flash:w:$(TARGET).hex
|
Loading…
Reference in New Issue
Block a user