1#!/bin/sh
2
3#
4# Attempt to remove as many generated files as we can.
5# Ideally, a well-used development sandbox would look like
6# a pristine checkout after running this script.
7#
8
9if [ \! -f build/version ]; then
10    echo 'Must run the clean script from the top-level dir of the libarchive distribution' 1>&2
11    exit 1
12fi
13
14# If we're on BSD, blow away the build dir under /usr/obj
15rm -rf /usr/obj`pwd`
16
17#
18# Try to clean up a bit more...
19#
20
21find . -name '*.So' | xargs rm -f
22find . -name '*.a' | xargs rm -f
23find . -name '*.la' | xargs rm -f
24find . -name '*.lo' | xargs rm -f
25find . -name '*.o' | xargs rm -f
26find . -name '*.orig' | xargs rm -f
27find . -name '*.po' | xargs rm -f
28find . -name '*.rej' | xargs rm -f
29find . -name '*~' | xargs rm -f
30find . -name '.depend' | xargs rm -f
31find . -name '.deps' | xargs rm -rf
32find . -name '.dirstamp' | xargs rm -f
33find . -name '.libs' | xargs rm -rf
34find . -name 'CMakeFiles' | xargs rm -rf
35find . -name 'cmake_install.cmake' | xargs rm -f
36find . -name 'CTestTestfile.cmake' | xargs rm -f
37
38rm -rf Testing
39rm -rf autom4te.cache
40rm -rf bin
41rm -rf cmake.tmp
42rm -rf libarchive/Testing
43
44rm -f CMakeCache.txt
45rm -f DartConfiguration.tcl
46rm -f Makefile
47rm -f Makefile.in
48rm -f aclocal.m4
49rm -f bsdcpio
50rm -f bsdcpio_test
51rm -f bsdtar
52rm -f bsdtar_test
53rm -f build/autoconf/compile
54rm -f build/autoconf/config.guess
55rm -f build/autoconf/config.sub
56rm -f build/autoconf/depcomp
57rm -f build/autoconf/install-sh
58rm -f build/autoconf/libtool.m4
59rm -f build/autoconf/ltmain.sh
60rm -f build/autoconf/ltoptions.m4
61rm -f build/autoconf/ltsugar.m4
62rm -f build/autoconf/ltversion.m4
63rm -f build/autoconf/lt~obsolete.m4
64rm -f build/autoconf/missing
65rm -f build/autoconf/test-driver
66rm -f build/pkgconfig/libarchive.pc
67rm -f build/version.old
68rm -f cat/test/list.h
69rm -f config.h
70rm -f config.h.in
71rm -f config.log
72rm -f config.status
73rm -f configure
74rm -f cpio/*.1.gz
75rm -f cpio/Makefile
76rm -f cpio/bsdcpio
77rm -f cpio/test/Makefile
78rm -f cpio/test/bsdcpio_test
79rm -f cpio/test/list.h
80rm -f doc/html/*
81rm -f doc/man/*
82rm -f doc/pdf/*
83rm -f doc/text/*
84rm -f doc/wiki/*
85rm -f libarchive/*.[35].gz
86rm -f libarchive/Makefile
87rm -f libarchive/libarchive.so*
88rm -f libarchive/test/Makefile
89rm -f libarchive/test/libarchive_test
90rm -f libarchive/test/list.h
91rm -f libarchive_test
92rm -f libtool
93rm -f stamp-h1
94rm -f tar/*.1.gz
95rm -f tar/Makefile
96rm -f tar/bsdtar
97rm -f tar/test/Makefile
98rm -f tar/test/bsdtar_test
99rm -f tar/test/list.h
100