This is my compiling script, I've written in the file "~/.bashrc" so it loads at startup.
The written text below is not updated to my latest version of this script, but check the attached file at the bottom for the latest version.
Source code
Name of the script "myc"
function myc {
Asks for which project to compile
echo -n "Enter name of project > "
read text
Check so it exist, or at least the folder does...
if [ -d ~/LentDB/Programmering/$text ]; then
echo "Compiling $text..."
else
echo "Cant find project, aborting..."
exit 1
fi
Enter the folder
cd ~/LentDB/Programmering/$text
Remove temporary files
if [ -f *~ ]; then
rm *~
fi
Remove the compiled program
if [ -f $text ]; then
rm $text
fi
Compile everything
gcc4.2 -o $text *.cpp -lglut -lGL -lGLU
Copy to my program folder and run the program
if [ -f $text ]; then
mv $text ~/LentDB/Program
cd ~/LentDB/Program
./$text
fi
}