#!/bin/bash for file in *.cpp do filename="${file%.*}" list="$list $filename.o" echo -n "Compiling $filename..." g++ -c -I../CoreUtils -I../ServerCore $file & if [ $? = '0' ] then echo "OK" else echo "ERROR" exit -1 fi done wait echo -n "Building executable HTTPServer..." echo $list g++ -o HTTPServer -I../CoreUtils -I../ServerCore -L../CoreUtils -L../ServerCore -lCoreUtils -lServerCore $list if [ $? = '0' ] then echo "OK" else echo "ERROR" exit -1 fi