1#! /bin/sh 2# Copyright 2010 Google Inc. 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 30Prog_Name=${0##*/} 31 32if [ ! -f ./state.hpp ]; then 33 echo "${Prog_Name}: must be run from the source top directory" 1>&2 34 exit 1 35fi 36 37if [ ! -f configure ]; then 38 echo "${Prog_Name}: configure not found; nothing to clean?" 1>&2 39 exit 1 40fi 41 42[ -f Makefile ] || ./configure 43make distclean 44 45# Top-level directory. 46rm -f Makefile.in 47rm -f aclocal.m4 48rm -rf autom4te.cache 49rm -f config.h.in 50rm -f configure 51rm -f mkinstalldirs 52rm -f lutok-*.tar.gz 53 54# admin directory. 55rm -f admin/compile 56rm -f admin/config.guess 57rm -f admin/config.sub 58rm -f admin/depcomp 59rm -f admin/install-sh 60rm -f admin/ltmain.sh 61rm -f admin/mdate-sh 62rm -f admin/missing 63rm -f admin/texinfo.tex 64 65# bootstrap directory. 66rm -f bootstrap/package.m4 67rm -f bootstrap/testsuite 68 69# doc directory. 70rm -f doc/*.info 71rm -f doc/stamp-vti 72rm -f doc/version.texi 73 74# m4 directory. 75rm -f m4/libtool.m4 76rm -f m4/lt*.m4 77 78# Files and directories spread all around the tree. 79find . -name '#*' | xargs rm -rf 80find . -name '*~' | xargs rm -rf 81find . -name .deps | xargs rm -rf 82find . -name .gdb_history | xargs rm -rf 83find . -name .libs | xargs rm -rf 84find . -name .tmp | xargs rm -rf 85 86# Show remaining files. 87if [ -n "${GIT}" ]; then 88 echo ">>> untracked and ignored files" 89 "${GIT}" status --porcelain --ignored | grep -E '^(\?\?|!!)' || true 90fi 91