diff options
author | Sven Göthel <[email protected]> | 2024-08-08 17:31:54 +0200 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-08-08 17:31:54 +0200 |
commit | a70c03f57f67c640cde7d6bc3571c056e67214da (patch) | |
tree | ea75a4150eaf0d70d8b46e07d2d43540303b2e24 /scripts/rebuild-preset-doc.sh | |
parent | 59da5b1a9f14875eb0cbc24448463baac79b041f (diff) |
Rename and fix for custom preset rebuild{->-preset}-doc.sh
Diffstat (limited to 'scripts/rebuild-preset-doc.sh')
-rwxr-xr-x | scripts/rebuild-preset-doc.sh | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/scripts/rebuild-preset-doc.sh b/scripts/rebuild-preset-doc.sh new file mode 100755 index 0000000..734b109 --- /dev/null +++ b/scripts/rebuild-preset-doc.sh @@ -0,0 +1,70 @@ +#! /bin/sh + +sdir=`dirname $(readlink -f $0)` +rootdir=`dirname $sdir` +bname=`basename $0 .sh` + +. $sdir/setup-machine-arch.sh + +tripleid="$os_name-$archabi-gcc" + +if [ ! -z "$1" ] ; then + preset_name=$1 + shift 1 +else + echo "ERROR: No preset passed as 1st argument, use one of:" + cmake --list-presets + return 1 +fi + +logfile=$rootdir/${bname}-${preset_name}-${tripleid}.log +rm -f $logfile + +CPU_COUNT=`getconf _NPROCESSORS_ONLN` + +# run as root 'dpkg-reconfigure locales' enable 'en_US.UTF-8' +# perhaps run as root 'update-locale LC_MEASUREMENT=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8' +export LC_MEASUREMENT=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +buildit() { + if [ -z "$JAVA_HOME" -o ! -e "$JAVA_HOME" ] ; then + echo "WARNING: JAVA_HOME $JAVA_HOME does not exist" + else + echo JAVA_HOME $JAVA_HOME + fi + echo rootdir $rootdir + echo logfile $logfile + echo CPU_COUNT $CPU_COUNT + + dist_dir="dist/preset-${preset_name}" + build_dir="build/preset-${preset_name}" + echo dist_dir $dist_dir + echo build_dir $build_dir + + if [ -x /usr/bin/time ] ; then + time_cmd="time" + echo "time command available: ${time_cmd}" + else + time_cmd="" + echo "time command not available" + fi + + cd $rootdir + + ${time_cmd} cmake --build --preset ${preset_name} --parallel $CPU_COUNT --target doc_jau + if [ $? -eq 0 ] ; then + echo "REBUILD SUCCESS $bname $tripleid" + cd ${build_dir} + rm -f $rootdir/documentation.tar.xz + tar caf $rootdir/documentation.tar.xz documentation + cd $rootdir + return 0 + else + echo "REBUILD FAILURE $bname $tripleid" + return 1 + fi +} + +buildit 2>&1 | tee $logfile |