Files
RedBear-OS/tests/Makefile
T
2018-03-10 22:58:35 +08:00

83 lines
1.3 KiB
Makefile

BINS=\
alloc \
atof \
atoi \
brk \
args \
chdir \
create \
ctype \
dup \
error \
fchdir \
fcntl \
fsync \
ftruncate \
getid \
link \
math \
mem \
pipe \
printf \
rmdir \
setid \
sleep \
sprintf \
stdlib/strtol \
string/strncmp \
string/strcspn \
string/strchr \
string/strspn \
unlink \
write
all: $(BINS)
clean:
rm -f $(BINS) *.out
run: $(BINS)
for bin in $(BINS); \
do \
echo "# $${bin} #"; \
"./$${bin}" test args; \
done
expected: $(BINS)
rm -rf expected
mkdir -p expected
for bin in $(BINS); \
do \
echo "# $${bin} #"; \
mkdir -p expected/`dirname $${bin}`; \
"./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr"; \
done
verify: $(BINS)
rm -rf gen
mkdir -p gen
for bin in $(BINS); \
do \
echo "# $${bin} #"; \
mkdir -p gen/`dirname $${bin}`; \
"./$${bin}" test args > "gen/$${bin}.stdout" 2> "gen/$${bin}.stderr"; \
diff -u "gen/$${bin}.stdout" "expected/$${bin}.stdout"; \
diff -u "gen/$${bin}.stderr" "expected/$${bin}.stderr"; \
done
GCCHEAD=\
-nostdinc \
-nostdlib \
-I ../include \
-I ../target/include \
-I ../openlibm/include \
-I ../openlibm/src \
../target/debug/libcrt0.a
GCCTAIL=\
../target/debug/libc.a \
../openlibm/libopenlibm.a
%: %.c
gcc -fno-stack-protector -Wall $(GCCHEAD) "$<" $(GCCTAIL) -o "$@"