From 24f0677b76ba5be7114031f2d6d6746dcb64ce55 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 28 Feb 2025 15:03:42 -0500 Subject: refactor tests --- Makefile | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 37303d1..485a08a 100644 --- a/Makefile +++ b/Makefile @@ -3,24 +3,23 @@ LDFLAGS = -lSDL2 -lSDL2_ttf SRC = main.c microui.c renderer.c widget.c ui.c unit.c engine.c OBJ = ${SRC:.c=.o} +HDR = microui.h renderer.h widget.h ui.h unit.h engine.h -all: volute +TEST_SRC = test.c test_angular_speed.c test_volume.c unit.c +TEST_OBJ = ${TEST_SRC:.c=.o} -clean: - rm -f volute *.o - -test: test_unit - for t in $^; do \ - ./$$t; \ - done - -test_unit: test_unit.o unit.o +volute: ${OBJ} ${CC} -o $@ $^ ${LDFLAGS} -volute: ${OBJ} +test: ${TEST_OBJ} ${CC} -o $@ $^ ${LDFLAGS} + ./$@ + +clean: + rm -f volute test *.o %.o: %.c ${CC} -c ${CFLAGS} $< -${OBJ}: microui.h renderer.h widget.h ui.h unit.h engine.h +${OBJ}: ${HDR} +${TEST_OBJ}: ${HDR} test.h -- cgit v1.2.3