File: makeundepend.sh

package info (click to toggle)
tcm 2.20+TSQD-6
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 22,768 kB
  • sloc: ansic: 78,527; sh: 3,618; makefile: 1,345; perl: 753; yacc: 558; lex: 257
file content (32 lines) | stat: -rwxr-xr-x 774 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
#
# makeundepend.sh
# copyright (c) 2001 Henk R. van de Zandschulp, David N. Jansen
# $Id: makeundepend.sh,v 1.2 2002/05/29 08:27:34 henkz Exp $
#

makefile=

[ -f makefile ] && makefile=makefile
[ -f Makefile ] && makefile=Makefile
[ -f GNUMakefile ] && makefile=GNUMakefile
[ ${makefile} ] || {
     echo cannot find a makefile ... bailing out
     exit 1
}

marker='# DO NOT DELETE THIS LINE -- make depend depends on it.'


grep "${marker}" ${makefile} >/dev/null 2>&1
[ $? -eq 0 ] && foundit=y || foundit=
if [ ${foundit} ] ; then
     /bin/rm -f ${makefile}.bak
     mv ${makefile} ${makefile}.bak
     sed -e "/${marker}/q" < ${makefile}.bak > ${makefile} || {
       echo sed command failed ... bailing out
       exit 1
     }
 fi # [ ${foundit} ]

# EOF