alog/tests/tests.mk
Aidan Hahn 643093d7e0
add unique names so that makefiles including these dont have to account for conflict
Signed-off-by: Aidan Hahn <aidan@aidanis.online>
2022-02-28 01:14:56 -08:00

12 lines
356 B
Makefile

ALOG_TEST_SRCS = $(shell find tests -iname "*.c" -exec basename {} \;)
ALOG_TESTS = $(ALOG_TEST_SRCS:.c=)
$(ALOG_TESTS): $(ALOG_LIB)
$(CC) $(CFLAGS) -g -o $(BUILD_DIR)/$@.o -c tests/$@.c
$(CC) -o $(TARGET_DIR)/$@ $(BUILD_DIR)/$@.o $(ALOG_LIB)
chmod +x $(TARGET_DIR)/$@
alog-tests: $(ALOG_TESTS)
for test in $^ ; do \
$(TARGET_DIR)/$$test ; \
done