summaryrefslogtreecommitdiff
path: root/tests/Makefile
blob: 9cca6f59edcaea41ae6d4bd2f1a89511096786fe (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
32
33
CC=../x86_64-linux-musl-native/bin/gcc
CFLAGS=-I../include/ -D_FORTIFY_SOURCE=3 -static -O2

TARGETS=test_memcpy_static_write  \
	test_memcpy_dynamic_write  \
	test_memcpy_static_read    \
	test_memcpy_dynamic_read   \
	test_memmove_static_write  \
	test_memmove_dynamic_write \
	test_memmove_static_read   \
	test_memmove_dynamic_read  \
	test_memset_static_write   \
	test_memset_dynamic_write  \
	test_strcpy_static_write   \
	test_strcat_static_write   \

.SILENT:

all: $(TARGETS) run

$(TARGETS): %: %.c
	$(CC) $(CFLAGS) -o $@ $<

run: $(TARGETS)
	$(foreach EXE, $(TARGETS), \
		./$(EXE) 1 2 3 4 5 6 7 8 9 0 >/dev/null && echo "$(EXE) OK" || echo "$(EXE) FAIL" ; \
	)

clean:
	$(foreach EXE, $(TARGETS), \
		rm -f ./$(EXE) \
	)