xref: /freebsd/contrib/lutok/admin/clean-all.sh (revision c697fb7f7cc9bedc5beee44d35b771c4e87b335a)
1*c697fb7fSBrooks Davis#! /bin/sh
2*c697fb7fSBrooks Davis# Copyright 2010 Google Inc.
3*c697fb7fSBrooks Davis# All rights reserved.
4*c697fb7fSBrooks Davis#
5*c697fb7fSBrooks Davis# Redistribution and use in source and binary forms, with or without
6*c697fb7fSBrooks Davis# modification, are permitted provided that the following conditions are
7*c697fb7fSBrooks Davis# met:
8*c697fb7fSBrooks Davis#
9*c697fb7fSBrooks Davis# * Redistributions of source code must retain the above copyright
10*c697fb7fSBrooks Davis#   notice, this list of conditions and the following disclaimer.
11*c697fb7fSBrooks Davis# * Redistributions in binary form must reproduce the above copyright
12*c697fb7fSBrooks Davis#   notice, this list of conditions and the following disclaimer in the
13*c697fb7fSBrooks Davis#   documentation and/or other materials provided with the distribution.
14*c697fb7fSBrooks Davis# * Neither the name of Google Inc. nor the names of its contributors
15*c697fb7fSBrooks Davis#   may be used to endorse or promote products derived from this software
16*c697fb7fSBrooks Davis#   without specific prior written permission.
17*c697fb7fSBrooks Davis#
18*c697fb7fSBrooks Davis# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19*c697fb7fSBrooks Davis# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20*c697fb7fSBrooks Davis# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21*c697fb7fSBrooks Davis# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22*c697fb7fSBrooks Davis# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23*c697fb7fSBrooks Davis# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24*c697fb7fSBrooks Davis# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25*c697fb7fSBrooks Davis# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26*c697fb7fSBrooks Davis# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27*c697fb7fSBrooks Davis# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28*c697fb7fSBrooks Davis# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29*c697fb7fSBrooks Davis
30*c697fb7fSBrooks DavisProg_Name=${0##*/}
31*c697fb7fSBrooks Davis
32*c697fb7fSBrooks Davisif [ ! -f ./state.hpp ]; then
33*c697fb7fSBrooks Davis    echo "${Prog_Name}: must be run from the source top directory" 1>&2
34*c697fb7fSBrooks Davis    exit 1
35*c697fb7fSBrooks Davisfi
36*c697fb7fSBrooks Davis
37*c697fb7fSBrooks Davisif [ ! -f configure ]; then
38*c697fb7fSBrooks Davis    echo "${Prog_Name}: configure not found; nothing to clean?" 1>&2
39*c697fb7fSBrooks Davis    exit 1
40*c697fb7fSBrooks Davisfi
41*c697fb7fSBrooks Davis
42*c697fb7fSBrooks Davis[ -f Makefile ] || ./configure
43*c697fb7fSBrooks Davismake distclean
44*c697fb7fSBrooks Davis
45*c697fb7fSBrooks Davis# Top-level directory.
46*c697fb7fSBrooks Davisrm -f Makefile.in
47*c697fb7fSBrooks Davisrm -f aclocal.m4
48*c697fb7fSBrooks Davisrm -rf autom4te.cache
49*c697fb7fSBrooks Davisrm -f config.h.in
50*c697fb7fSBrooks Davisrm -f configure
51*c697fb7fSBrooks Davisrm -f mkinstalldirs
52*c697fb7fSBrooks Davisrm -f lutok-*.tar.gz
53*c697fb7fSBrooks Davis
54*c697fb7fSBrooks Davis# admin directory.
55*c697fb7fSBrooks Davisrm -f admin/compile
56*c697fb7fSBrooks Davisrm -f admin/config.guess
57*c697fb7fSBrooks Davisrm -f admin/config.sub
58*c697fb7fSBrooks Davisrm -f admin/depcomp
59*c697fb7fSBrooks Davisrm -f admin/install-sh
60*c697fb7fSBrooks Davisrm -f admin/ltmain.sh
61*c697fb7fSBrooks Davisrm -f admin/mdate-sh
62*c697fb7fSBrooks Davisrm -f admin/missing
63*c697fb7fSBrooks Davisrm -f admin/texinfo.tex
64*c697fb7fSBrooks Davis
65*c697fb7fSBrooks Davis# bootstrap directory.
66*c697fb7fSBrooks Davisrm -f bootstrap/package.m4
67*c697fb7fSBrooks Davisrm -f bootstrap/testsuite
68*c697fb7fSBrooks Davis
69*c697fb7fSBrooks Davis# doc directory.
70*c697fb7fSBrooks Davisrm -f doc/*.info
71*c697fb7fSBrooks Davisrm -f doc/stamp-vti
72*c697fb7fSBrooks Davisrm -f doc/version.texi
73*c697fb7fSBrooks Davis
74*c697fb7fSBrooks Davis# m4 directory.
75*c697fb7fSBrooks Davisrm -f m4/libtool.m4
76*c697fb7fSBrooks Davisrm -f m4/lt*.m4
77*c697fb7fSBrooks Davis
78*c697fb7fSBrooks Davis# Files and directories spread all around the tree.
79*c697fb7fSBrooks Davisfind . -name '#*' | xargs rm -rf
80*c697fb7fSBrooks Davisfind . -name '*~' | xargs rm -rf
81*c697fb7fSBrooks Davisfind . -name .deps | xargs rm -rf
82*c697fb7fSBrooks Davisfind . -name .gdb_history | xargs rm -rf
83*c697fb7fSBrooks Davisfind . -name .libs | xargs rm -rf
84*c697fb7fSBrooks Davisfind . -name .tmp | xargs rm -rf
85*c697fb7fSBrooks Davis
86*c697fb7fSBrooks Davis# Show remaining files.
87*c697fb7fSBrooks Davisif [ -n "${GIT}" ]; then
88*c697fb7fSBrooks Davis    echo ">>> untracked and ignored files"
89*c697fb7fSBrooks Davis    "${GIT}" status --porcelain --ignored | grep -E '^(\?\?|!!)' || true
90*c697fb7fSBrooks Davisfi
91