2022-11-24 21:24:18 +01:00
|
|
|
#!/bin/bash
|
2022-11-24 22:20:17 +01:00
|
|
|
returnCode=0
|
|
|
|
echo -e "compiling all files in working directory $(pwd)\n"
|
|
|
|
for file in $(/bin/ls *.c);
|
|
|
|
do
|
2022-11-25 00:14:31 +01:00
|
|
|
echo "compiling $file ..."
|
|
|
|
noext=$(echo "$file" | cut -f 1 -d '.')
|
|
|
|
gcc $file -o bin/$noext -lm
|
2022-11-24 22:20:17 +01:00
|
|
|
if [ "$?" -ne 0 ]
|
|
|
|
then
|
|
|
|
echo -e "\nERROR: could not compile $file !\n";
|
|
|
|
returnCode=1;
|
|
|
|
fi
|
|
|
|
done
|
2022-11-24 23:00:34 +01:00
|
|
|
echo -ne "\nfinished compiling all source files. ";
|
|
|
|
if [ "$returnCode" -eq 0 ]
|
|
|
|
then
|
|
|
|
echo -ne "No errors occured.";
|
|
|
|
else
|
|
|
|
echo -ne "Some errors occured.";
|
|
|
|
fi
|
|
|
|
echo "";
|
2022-11-24 22:20:17 +01:00
|
|
|
exit $returnCode
|