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