#! /bin/sh1# Copyright 2010 The Kyua Authors.2# All rights reserved.3#4# Redistribution and use in source and binary forms, with or without5# modification, are permitted provided that the following conditions are6# met:7#8# * Redistributions of source code must retain the above copyright9# notice, this list of conditions and the following disclaimer.10# * Redistributions in binary form must reproduce the above copyright11# notice, this list of conditions and the following disclaimer in the12# documentation and/or other materials provided with the distribution.13# * Neither the name of Google Inc. nor the names of its contributors14# may be used to endorse or promote products derived from this software15# without specific prior written permission.16#17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2829Prog_Name=${0##*/}3031if [ ! -f ./main.cpp ]; then32echo "${Prog_Name}: must be run from the source top directory" 1>&233exit 134fi3536if [ ! -f configure ]; then37echo "${Prog_Name}: configure not found; nothing to clean?" 1>&238exit 139fi4041[ -f Makefile ] || ./configure42make distclean4344# Top-level directory.45rm -f Makefile.in46rm -f aclocal.m447rm -rf autom4te.cache48rm -f config.h.in49rm -f configure50rm -f mkinstalldirs51rm -f kyua-*.tar.gz5253# admin directory.54rm -f admin/ar-lib55rm -f admin/compile56rm -f admin/config.guess57rm -f admin/config.sub58rm -f admin/depcomp59rm -f admin/install-sh60rm -f admin/ltmain.sh61rm -f admin/mdate-sh62rm -f admin/missing6364# bootstrap directory.65rm -f bootstrap/package.m466rm -f bootstrap/testsuite6768# doc directory.69rm -f doc/*.info70rm -f doc/stamp-vti71rm -f doc/version.texi7273# m4 directory.74rm -f m4/libtool.m475rm -f m4/lt*.m47677# Files and directories spread all around the tree.78find . -name '#*' | xargs rm -rf79find . -name '*~' | xargs rm -rf80find . -name .deps | xargs rm -rf81find . -name .gdb_history | xargs rm -rf82find . -name .libs | xargs rm -rf83find . -name .tmp | xargs rm -rf8485# Show remaining files.86if [ -n "${GIT}" ]; then87echo ">>> untracked and ignored files"88"${GIT}" status --porcelain --ignored | grep -E '^(\?\?|!!)' || true89fi909192