2021-12-02 20:57:19 +00:00
|
|
|
TARGETNAME = togglePin
|
|
|
|
BUILDFOLDER = ./build/
|
|
|
|
TARGET = $(BUILDFOLDER)$(TARGETNAME)
|
|
|
|
|
|
|
|
INC = -Isrc/include -I/usr/lib/avr/include/
|
|
|
|
CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega32u4
|
2021-12-02 21:27:10 +00:00
|
|
|
CPPFLAGS = -DF_CPU=8000000UL
|
2021-12-02 20:57:19 +00:00
|
|
|
|
|
|
|
SRC = $(wildcard src/*.c)
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(SRC)
|
|
|
|
mkdir -p build
|
2021-12-02 21:27:10 +00:00
|
|
|
avr-gcc -o $@.elf $^ $(CPPFLAGS) $(CFLAGS) $(INC)
|
2021-12-02 20:57:19 +00:00
|
|
|
avr-objcopy -j .text -j .data -O ihex $@.elf $@.hex
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -fr ./src/*.o ./build/
|