19 lines
391 B
Makefile
19 lines
391 B
Makefile
|
TARGETNAME = togglePin
|
||
|
BUILDFOLDER = ./build/
|
||
|
TARGET = $(BUILDFOLDER)$(TARGETNAME)
|
||
|
|
||
|
INC = -Isrc/include -I/usr/lib/avr/include/
|
||
|
CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega32u4
|
||
|
|
||
|
SRC = $(wildcard src/*.c)
|
||
|
|
||
|
all: $(TARGET)
|
||
|
|
||
|
$(TARGET): $(SRC)
|
||
|
mkdir -p build
|
||
|
avr-gcc -o $@.elf $^ $(CFLAGS) $(INC)
|
||
|
avr-objcopy -j .text -j .data -O ihex $@.elf $@.hex
|
||
|
|
||
|
clean:
|
||
|
rm -fr ./src/*.o ./build/
|