summaryrefslogtreecommitdiff
path: root/tests/Makefile
blob: 6b91c9b1144ab36cebd6d452a7af0bed7fc4f76c (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 := gcc
CFLAGS := -std=c99 -m32 -ffreestanding -O0 -g -Wall -Werror
INCLUDES = -I../src
LD := ld

all: test

test_strlcpy: test_strlcpy.o ../src/string.o
	$(CC) -o test_strlcpy test_strlcpy.o ../src/string.o

test_strlcpy.o: test_strlcpy.c
	$(CC) $(CFLAGS) $(INCLUDES) -c -o test_strlcpy.o test_strlcpy.c

test_itoa: test_itoa.o ../src/stdlib.o ../src/string.o
	$(CC) -o test_itoa test_itoa.o ../src/stdlib.o ../src/string.o

test_itoa.o: test_itoa.c ../src/stdlib.o
	$(CC) $(CFLAGS) $(INCLUDES) -c -o test_itoa.o test_itoa.c

../src/string.o: ../src/string.c
	$(CC) $(CFLAGS) -c -o ../src/string.o ../src/string.c

../src/stdlib.o: ../src/stdlib.c
	$(CC) $(CFLAGS) -c -o ../src/stdlib.o ../src/stdlib.c

test: test_strlcpy test_itoa
	./test_strlcpy
	./test_itoa
	
clean:
	-rm -f test_strlcpy test_itoa *.o