fixed
This commit is contained in:
parent
4ef2511b9e
commit
6bfd116164
13
build.sh
13
build.sh
@ -1,20 +1,17 @@
|
||||
#!/bin/sh
|
||||
if [ $(id -u) -ne 0 ]; then
|
||||
if [ $(id -u) -eq 0 ]; then
|
||||
echo "Run script without root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Add repos in 0-download-src.sh
|
||||
CC=cc
|
||||
RTFS=$(pwd)/rootfs
|
||||
|
||||
#Tests
|
||||
for i in tests/*; do
|
||||
if ! env CC=$CC $i; then
|
||||
echo "Build failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
if ! ./test.sh; then
|
||||
echo "Build failed" >&2
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
#Clean
|
||||
./clean.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
echo "* Build cross compiler"
|
||||
echo "* Build cross compiler" >&2
|
||||
|
||||
cd tcc
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
echo " * Build micro-utils"
|
||||
echo " * Make rootfs "
|
||||
echo " * Build micro-utils" >&2
|
||||
echo " * Make rootfs " >&2
|
||||
mkdir $RTFS/bin
|
||||
mkdir $RTFS/etc
|
||||
mkdir $RTFS/mnt
|
||||
|
36
test.sh
Executable file
36
test.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! make -h > /dev/null; then
|
||||
echo "[FAILED] Make is not installed..."
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
if git > /dev/null; then
|
||||
echo "[FAILED] Git is not installed..."
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
if ! makeinfo -h > /dev/null; then
|
||||
echo "[FAILED] Texinfo is not installed..."
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
out_name=$(mktemp XXXXXX)
|
||||
|
||||
echo "#include <stdio.h>" >> test.c
|
||||
echo "int main(void){return 0;}" >> test.c
|
||||
|
||||
$CC test.c -o $out_name
|
||||
rm test.c
|
||||
|
||||
if ! ./$out_name; then
|
||||
echo "[FAILED] Fix c compiler or headers..."
|
||||
rm $out_name
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
exit 0
|
20
tests/c.sh
20
tests/c.sh
@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
out_name=$(mktemp XXXXXX)
|
||||
|
||||
echo "#include <stdio.h>" >> test.c
|
||||
echo "int main(void){return 0;}" >> test.c
|
||||
|
||||
$CC test.c -o $out_name
|
||||
rm test.c
|
||||
|
||||
if ./$out_name; then
|
||||
echo "[OK] C compiler work..."
|
||||
rm $out_name
|
||||
exit 0
|
||||
|
||||
else
|
||||
echo "[FAILED] Fix c compiler or headers..."
|
||||
rm $out_name
|
||||
exit 1
|
||||
|
||||
fi
|
12
tests/git.sh
12
tests/git.sh
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! git > /dev/null; then
|
||||
echo "[OK] Git installed..."
|
||||
exit 0;
|
||||
|
||||
else
|
||||
echo "[FAILED] Git is not installed..."
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if make -h > /dev/null; then
|
||||
echo "[OK] Make installed..."
|
||||
exit 0;
|
||||
|
||||
else
|
||||
echo "[FAILED] Make is not installed..."
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if makeinfo -h > /dev/null; then
|
||||
echo "[OK] Texinfo installed..."
|
||||
exit 0;
|
||||
|
||||
else
|
||||
echo "[FAILED] Texinfo is not installed..."
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user