Split from git://repo.or.cz/quvi.git
[libquvi-scripts.git] / autogen.sh
blob912388b158329f7dd5dc13e8d94cb984d0abe352
1 #!/bin/sh
2 # autogen.sh for libquvi-scripts.
4 source=.gitignore
5 cachedir=autom4te.cache
7 gen_manual()
9 echo "Generate manual..."
10 MAN=doc/man7/libquvi-scripts.7 ; POD=$MAN.pod ; VN=`./gen-ver.sh`
11 pod2man -c "libquvi-scripts manual" -n libquvi-scripts \
12 -s 7 -r "$VN" "$POD" "$MAN"
13 return $?
16 cleanup()
18 echo "WARNING!
19 Removes _files_ listed in $source and $cachedir directory.
20 Last chance to bail out (^C) before we continue."
21 read n1
22 [ -f Makefile ] && make distclean
23 for file in `cat $source`; do # Remove files only.
24 [ -e "$file" ] && [ -f "$file" ] && rm -f "$file"
25 done
26 [ -e "$cachedir" ] && rm -rf "$cachedir"
27 exit 0
30 help()
32 echo "Usage: $0 [-c|-h] [top_srcdir]
33 -c Make the source tree 'maintainer clean'
34 -h Show this help and exit
35 Run without options to (re)generate the configuration files."
36 exit 0
39 while [ $# -gt 0 ]
41 case "$1" in
42 -c) cleanup;;
43 -h) help;;
44 *) break;;
45 esac
46 shift
47 done
49 echo "Generate configuration files..."
50 autoreconf -if && gen_manual && echo "You can now run 'configure'"