2 # Copyright 2010 Google Inc.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # * Neither the name of Google Inc. nor the names of its contributors
15 # may be used to endorse or promote products derived from this software
16 # without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 if [ ! -f ./state.hpp ]; then
33 echo "${Prog_Name}: must be run from the source top directory" 1>&2
37 if [ ! -f configure ]; then
38 echo "${Prog_Name}: configure not found; nothing to clean?" 1>&2
42 [ -f Makefile ] || ./configure
45 # Top-level directory.
56 rm -f admin/config.guess
57 rm -f admin/config.sub
59 rm -f admin/install-sh
63 rm -f admin/texinfo.tex
65 # bootstrap directory.
66 rm -f bootstrap/package.m4
67 rm -f bootstrap/testsuite
72 rm -f doc/version.texi
78 # Files and directories spread all around the tree.
79 find . -name '#*' | xargs rm -rf
80 find . -name '*~' | xargs rm -rf
81 find . -name .deps | xargs rm -rf
82 find . -name .gdb_history | xargs rm -rf
83 find . -name .libs | xargs rm -rf
84 find . -name .tmp | xargs rm -rf
86 # Show remaining files.
87 if [ -n "${GIT}" ]; then
88 echo ">>> untracked and ignored files"
89 "${GIT}" status --porcelain --ignored | grep -E '^(\?\?|!!)' || true