DESC="Generate dependencies and compile source code" main() { mkdir -p src/dep mkdir -p src/obj OBJ="src/obj/Test03.o" DEP="src/dep/dep.ag" EXEC="${AGCC} --path src -v2 -MF ${DEP} -MD -c src/Test.cc -o ${OBJ}" echo "Executing '${EXEC}'" if ( ${EXEC} );then true;else ERR_MSG="Failed executing '${EXEC}'" return 1 fi if [ ! -f ${DEP} ];then ERR_MSG="File '${DEP}' with dependency information was not generated" return 1 fi if [ ! -f ${OBJ} ];then ERR_MSG="Object file '${OBJ}' was not created"; return 1; fi; g++ -include src/trace.ah -M -MF src/dep/dep.g src/Test.cc echo -e "\nDIFF BETWEEN FILES 'dep.g' and 'dep.ag': \n" if ( diff src/dep/dep.g src/dep/dep.ag );then echo " none" return 0 else ERR_MSG="Dependency information differs between 'g++' and 'ag++' (files: 'src/dep/dep.g' and 'src/dep/dep.ag')" return 1 fi } cleanup() { rm -rf src/dep src/obj return 0 }