3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 # Usage: update_pch.sh [<module>/inc/pch/precompiled_xxx.hxx]
11 # Usage: update_pch.sh [<module>]
12 # Invoke: make cmd cmd="./bin/update_pch.sh [..]"
15 root
=`cd $root/.. && pwd`
19 headers
=`ls ./*/inc/pch/precompiled_*.hxx`
24 # Split the headers into an array.
25 IFS
=' ' read -a aheaders
<<< $headers
27 if [ $hlen -gt 1 ]; then
28 if [ -z "$PARALLELISM" ]; then
29 PARALLELISM
=0 # Let xargs decide
31 echo $headers |
xargs -n 1 -P $PARALLELISM $0
37 # We got a directory, find pch files to update.
38 headers
=`find $root/$x/ -type f -iname "precompiled_*.hxx"`
42 echo updating
`echo $header | sed -e s%$root/%%`
43 module
=`readlink -f $header | sed -e s%$root/%% -e s%/.*%%`
44 libname
=`echo $header | sed -e s/.*precompiled_// -e s/\.hxx//`
46 .
/bin
/update_pch
"$module" "$libname"