-
Notifications
You must be signed in to change notification settings - Fork 6
/
mkautotools.sh
executable file
·70 lines (61 loc) · 1.1 KB
/
mkautotools.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
AFILES="aclocal.m4 autom4te.cache config/config.guess config.log \
config.status config/config.sub configure config/depcomp \
ThreadsPP-0.1 INSTALL config/install-sh libtool config/ltmain.sh \
Makefile Makefile.in config/missing FLUX-1.0.tar.gz config.h \
config/compile config.h.in config.h.in~ stamp-h1"
bootstrap_autotools()
{
autoreconf -i -I m4
}
cleanup_autotools()
{
if [ -f Makefile ]; then
make distclean
fi
for i in $AFILES; do
if [ -d "$i" ]; then
echo "D[$i]"
rm -r $i
else
if [ -f "$i" ]; then
echo "F[$i]"
rm $i
fi
fi
done
# for i in $(find . -regex '.*Makefile\(\|\.in\)'); do
# if [ -f "$i" ]; then
# echo "F[$i]"
# rm $i
# fi
# done
for i in $(find . -name Makefile); do
if [ -f "$i" -a -f "$i.in" ]; then
echo "F[$i, $i.in]"
rm $i
rm $i.in
fi
done
for i in $(find . -type d -name .deps); do
if [ -d "$i" ]; then
echo "D[$i]"
rm -r $i
fi
done
}
if [ ! -d ./config ]; then
cd ..
fi
case "$1" in
clean)
cleanup_autotools
;;
boot)
bootstrap_autotools
;;
*)
echo "Usage: $0 {clean|boot}"
exit 1
esac
exit 0