Newer
Older
# Binaries that should generate the same output every time
EXPECT_BINS=\
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
args \
arpainet \
assert \
ctype \
error \
fcntl/create \
fcntl/fcntl \
fnmatch \
locale \
math \
select \
setjmp \
signal \
stdio/all \
stdio/setvbuf \
stdio/freopen \
stdio/fwrite \
stdio/getc_unget \
stdio/printf \
stdio/rename \
stdio/scanf \
stdio/sprintf \
stdlib/a64l \
stdlib/atof \
stdlib/atoi \
stdlib/env \
stdlib/mkostemps \
stdlib/rand \
stdlib/strtod \
stdlib/strtol \
stdlib/strtoul \
stdlib/system \
string/mem \
string/strchr \
string/strcpy \
string/strcspn \
string/strncmp \
string/strpbrk \
string/strrchr \
string/strspn \
string/strstr \
string/strtok \
string/strtok_r \
strings \
time/asctime \
time/gmtime \
time/localtime \
time/mktime \
time/strftime \
time/time \
unistd/access \
unistd/brk \
unistd/dup \
unistd/exec \
unistd/fchdir \
unistd/fsync \
unistd/ftruncate \
unistd/getopt \
unistd/isatty \
unistd/pipe \
unistd/rmdir \
unistd/sleep \
unistd/write \
waitpid \
wchar/mbrtowc \
wchar/mbsrtowcs \
wchar/putwchar \
wchar/wcrtomb
# Binaries that may generate varied output
BINS=\
$(EXPECT_BINS) \
dirent \
pwd \
resource/getrusage \
stdlib/alloc \
stdlib/bsearch \
stdlib/mktemp \
time/gettimeofday \
time/times \
unistd/chdir \
unistd/getcwd \
unistd/gethostname \
unistd/getid \
unistd/link \
unistd/setid \
unistd/stat
.PHONY: all $(BINS) clean run expected verify
"bins/$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr" || exit $$?; \
"bins/$${bin}" test args > "gen/$${bin}.stdout" 2> "gen/$${bin}.stderr" || exit $$?; \
diff -u "gen/$${bin}.stdout" "expected/$${bin}.stdout" || exit $$?; \
diff -u "gen/$${bin}.stderr" "expected/$${bin}.stderr" || exit $$?; \
-fno-builtin \
-fno-stack-protector \
-Wall \
-g \
../sysroot/lib/libc.a \
../sysroot/lib/libm.a
../sysroot:
make -C .. sysroot
bins/%: %.c ../sysroot
mkdir -p "$$(dirname "$@")"
$(CC) $(CFLAGS) $(HEADLIBS) "$<" $(TAILLIBS) -o "$@"