aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-02-28 15:03:42 -0500
committerSam Anthony <sam@samanthony.xyz>2025-02-28 15:03:42 -0500
commit24f0677b76ba5be7114031f2d6d6746dcb64ce55 (patch)
tree8db568429667f9b6637916267a8ee484e87020a1 /Makefile
parent4835ce7a09dc9012539c33b602e581057d945151 (diff)
downloadvolute-24f0677b76ba5be7114031f2d6d6746dcb64ce55.zip
refactor tests
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 11 insertions, 12 deletions
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