#!/usr/bin/env bash
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-$(python3 -c "import os;print(os.cpu_count())")}

if [ "x$1" = "x" ]; then
    # No arguments
    echo Please provide one argument,e.g : $0 2.0
    exit 1;
fi

# Ensure our 3rd party modules are in place and updated

./3rdparty/sync.sh

./mkdist mcxtrace-manuals $1 doc/manuals/mcxtrace/ "" noarch "o" -- NONE 
echo
echo LaTeX build of McXtrace manuals v $1 done!
echo
cp dist/mcxtrace-manuals-$1-noarch-not-packaged.work/*pdf docpkg/manuals/mcxtrace
echo
echo Consider doing a git commit for the PDF files in docpkg/manuals/mcxtrace, as these have now been updated:
git status docpkg/manuals/mcxtrace
