coffee/barista/Makefile
2025-10-15 21:14:19 +02:00

46 lines
875 B
Makefile

# Copyright (c) 2025 Rodrigo Arias Mallo <rodarima@gmail.com>
# SPDX-License-Identifier: GPL-3.0-or-later
PORT=/dev/ttyUSB0
FQBN=arduino:avr:atmega328bb
OPTS=--no-color --log-level=info
#OPTS+=-v
PROJ=barista
BUILD=build/$(subst :,.,$(FQBN))
HEX=$(BUILD)/$(PROJ).ino.hex
SRC=barista.ino \
ntc.c \
ntc.h \
pinout.h \
overheat.c \
overheat.h
# For host test programs
CPPFLAGS=-I.
LIBS=-lm
all: $(HEX)
$(HEX): $(SRC)
arduino-cli compile $(OPTS) -e --fqbn $(FQBN)
upload: $(HEX)
avrdude -vv -p atmega328p -c arduino -P $(PORT) -b 9600 -D -U flash:w:$(HEX):i
serial:
picocom -b 9600 --lower-rts --lower-dtr /dev/ttyUSB0 --imap lfcrlf
test: test_ntc test_overheat
test_ntc: test/test_ntc.o ntc.o
gcc $^ -o $@ $(LIBS)
test_overheat: test/test_overheat.o overheat.o
gcc $^ -o $@ $(LIBS)
clean:
rm -f test/test_ntc.o ntc.o
.PHONY: test all clean