CC = cc CFLAGS = LIB = ../libft.a TESTS = test_strlen test_is test_mem test_cmp test_case test_strl test_search \ test_atoi test_alloc all: $(TESTS) @for t in $(TESTS); do \ echo "--- Running $$t ---"; \ ./$$t; \ done test_%: test_%.c $(LIB) $(CC) $(CFLAGS) -o $@ $< $(LIB) # Tests comparing against BSD functions (strlcpy, strlcat, strnstr) # need -lbsd since these are not part of glibc by default. test_strl: test_strl.c $(LIB) $(CC) $(CFLAGS) -o $@ $< $(LIB) -lbsd test_search: test_search.c $(LIB) $(CC) $(CFLAGS) -o $@ $< $(LIB) -lbsd $(LIB): $(MAKE) -C .. clean: rm -f $(TESTS) .PHONY: all clean