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 [..]"
14 if test -n "$SRC_DIR"; then
18 root
=`cd $root/.. >/dev/null && pwd`
20 root
=`readlink -f $root`
24 headers
=`ls ./*/inc/pch/precompiled_*.hxx`
29 # Split the headers into an array.
30 IFS
=' ' read -a aheaders
<<< $headers
32 if [ $hlen -gt 1 ]; then
33 if [ -z "$PARALLELISM" ]; then
34 PARALLELISM
=0 # Let xargs decide
36 echo $headers |
xargs -n 1 -P $PARALLELISM $0
42 # We got a directory, find pch files to update.
43 headers
=`find $root/$x/ -type f -iname "precompiled_*.hxx"`
44 if test -n "$headers"; then
49 update_msg
=`echo $header | sed -e s%$root/%%`
50 module
=`readlink -f $header | sed -e s%$root/%% -e s%/.*%%`
51 if [ "$module" = "pch" ]; then
52 continue # PCH's in pch/inc/pch/ are handled manually
54 echo updating
$update_msg
55 if [ "$module" = "external" ]; then
56 module
=external
/`readlink -f $header | sed -e s%$root/external/%% -e s%/.*%%`
58 libname
=`echo $header | sed -e s/.*precompiled_// -e s/\.hxx//`
60 .
/bin
/update_pch
"$module" "$libname"
62 if test $exitcode -ne 0 -a $exitcode -ne 2; then