From 3ea6ff0e14a8b95fe488701044d673059418ffd8 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Sun, 2 Nov 2025 19:24:02 +0100 Subject: [PATCH] Merge makefile rules for tests --- barista/.gitignore | 3 ++- barista/Makefile | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/barista/.gitignore b/barista/.gitignore index 46a295a..38fc21e 100644 --- a/barista/.gitignore +++ b/barista/.gitignore @@ -1,3 +1,4 @@ build/ -test_ntc +misc/ +*.test *.o diff --git a/barista/Makefile b/barista/Makefile index 019710d..5a9da64 100644 --- a/barista/Makefile +++ b/barista/Makefile @@ -16,6 +16,10 @@ SRC=barista.ino \ overheat.c \ overheat.h +TESTS=ntc.test \ + overheat.test \ + led.test + # For host test programs CPPFLAGS=-I. LIBS=-lm @@ -31,18 +35,12 @@ upload: $(HEX) serial: picocom -b 9600 --lower-rts --lower-dtr /dev/ttyUSB0 --imap lfcrlf -test: test_ntc test_overheat +test: ntc.test overheat.test led.test -test_ntc: test/test_ntc.o ntc.o - gcc $^ -o $@ $(LIBS) - -test_overheat: test/test_overheat.o overheat.o - gcc $^ -o $@ $(LIBS) - -test_led: test/test_led.o test/compat.o led.o +%.test: test/test_%.o test/compat.o %.o gcc $^ -o $@ $(LIBS) clean: - rm -f test/test_ntc.o ntc.o + rm -f $(TESTS) test/*.o *.o .PHONY: test all clean