This commit is contained in:
Your Name 2024-01-12 11:36:21 +03:00
parent 4ef2511b9e
commit 6bfd116164
8 changed files with 44 additions and 67 deletions

View File

@ -1,20 +1,17 @@
#!/bin/sh #!/bin/sh
if [ $(id -u) -ne 0 ]; then if [ $(id -u) -eq 0 ]; then
echo "Run script without root" >&2 echo "Run script without root" >&2
exit 1 exit 1
fi fi
#Add repos in 0-download-src.sh
CC=cc CC=cc
RTFS=$(pwd)/rootfs RTFS=$(pwd)/rootfs
#Tests #Tests
for i in tests/*; do if ! ./test.sh; then
if ! env CC=$CC $i; then
echo "Build failed" >&2 echo "Build failed" >&2
exit 1 exit 1;
fi fi
done
#Clean #Clean
./clean.sh ./clean.sh

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
echo "* Build cross compiler" echo "* Build cross compiler" >&2
cd tcc cd tcc

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
echo " * Build micro-utils" echo " * Build micro-utils" >&2
echo " * Make rootfs " echo " * Make rootfs " >&2
mkdir $RTFS/bin mkdir $RTFS/bin
mkdir $RTFS/etc mkdir $RTFS/etc
mkdir $RTFS/mnt mkdir $RTFS/mnt

36
test.sh Executable file
View 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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