Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/contrib/kyua/admin/clean-all.sh
39478 views
1
#! /bin/sh
2
# Copyright 2010 The Kyua Authors.
3
# All rights reserved.
4
#
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions are
7
# met:
8
#
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.
17
#
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.
29
30
Prog_Name=${0##*/}
31
32
if [ ! -f ./main.cpp ]; then
33
echo "${Prog_Name}: must be run from the source top directory" 1>&2
34
exit 1
35
fi
36
37
if [ ! -f configure ]; then
38
echo "${Prog_Name}: configure not found; nothing to clean?" 1>&2
39
exit 1
40
fi
41
42
[ -f Makefile ] || ./configure
43
make distclean
44
45
# Top-level directory.
46
rm -f Makefile.in
47
rm -f aclocal.m4
48
rm -rf autom4te.cache
49
rm -f config.h.in
50
rm -f configure
51
rm -f mkinstalldirs
52
rm -f kyua-*.tar.gz
53
54
# admin directory.
55
rm -f admin/ar-lib
56
rm -f admin/compile
57
rm -f admin/config.guess
58
rm -f admin/config.sub
59
rm -f admin/depcomp
60
rm -f admin/install-sh
61
rm -f admin/ltmain.sh
62
rm -f admin/mdate-sh
63
rm -f admin/missing
64
65
# bootstrap directory.
66
rm -f bootstrap/package.m4
67
rm -f bootstrap/testsuite
68
69
# doc directory.
70
rm -f doc/*.info
71
rm -f doc/stamp-vti
72
rm -f doc/version.texi
73
74
# m4 directory.
75
rm -f m4/libtool.m4
76
rm -f m4/lt*.m4
77
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
85
86
# Show remaining files.
87
if [ -n "${GIT}" ]; then
88
echo ">>> untracked and ignored files"
89
"${GIT}" status --porcelain --ignored | grep -E '^(\?\?|!!)' || true
90
fi
91
92