Minimal Changes
This commit is contained in:
23
sketches/led-driver/Makefile
Normal file
23
sketches/led-driver/Makefile
Normal file
@ -0,0 +1,23 @@
|
||||
CFLAGS = -O3 -Wall --std=c11
|
||||
CHIP = 328p
|
||||
SOURCE_FILES = $(wildcard *.c)
|
||||
OBJ_FILES = $(SOURCE_FILES:%.c=%.o)
|
||||
BIN = led-driver.bin
|
||||
HEX = led-driver.hex
|
||||
|
||||
default: $(HEX)
|
||||
|
||||
%.o: %.c
|
||||
avr-gcc $(CFLAGS) -mmcu=atmega$(CHIP) -o $@ $<
|
||||
|
||||
$(BIN): $(OBJ_FILES)
|
||||
avr-gcc $(CFLAGS) -o $@ $^
|
||||
|
||||
$(HEX): $(BIN)
|
||||
avr-objcopy -O ihex -j .text -j .data $^ $@
|
||||
|
||||
flash: $(HEX)
|
||||
avrdude -p m$(CHIP) -c arduino -B 115200 -P /dev/ttyACM0 -v -v -e flash:w:$(HEX):a
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJ_FILES) $(BIN) $(HEX)
|
Reference in New Issue
Block a user