1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
# loaded and called from program's build scripts once icm-spch
# and icm-multicomp are available
# $1 is, e.g., /usr/libexec/icmake/icm-dep
. ../buildscripts/precomp
build()
{
precomp # construct the .gch file and soft-links
mkdir -p tmp/`dirname $1`
count=1 # prefix before the object filenames
# construct the jobs-file for icm-multicomp
if [ -e CLASSES ]
then
for dir in `cat CLASSES`
do
echo "$dir" | grep '^[[:blank:]]*#' > /dev/null
[ $? == 0 ] && continue
ls ${dir}/*.cc > /dev/null 2>&1
if [ $? -eq 0 ] ; then
cd $dir # go to the dir containing src files
echo ": $dir tmp $count" >> ../jobs
ls *.cc >> ../jobs
cd ..
let count=$count+1
fi
done
fi
echo ": . tmp 0" >> jobs
ls *.cc >> jobs
opts=" -Wall -Werror ${CXXFLAGS}"
../tmp/usr/libexec/icmake/icm-multicomp -q jobs \
'/usr/bin/g++ -c -o $2 '"${ICMAKE_CPPSTD}${opts}"' $1' || exit 1
/usr/bin/g++ -o ../tmp/$1 tmp/*.o -L../tmp -licmake ${LDFLAGS} || exit 1
rm -rf jobs tmp *.gch */*.gch
}
|