aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Makefile
blob: 319fa22193cbbd2ded5a83c78b315057cfdf6d09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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