| [10] | 1 | #!/bin/sh -
|
|---|
| 2 | #
|
|---|
| 3 | # Copyright (c) 1987 Regents of the University of California.
|
|---|
| 4 | # All rights reserved.
|
|---|
| 5 | #
|
|---|
| 6 | # Redistribution and use in source and binary forms are permitted
|
|---|
| 7 | # provided that the above copyright notice and this paragraph are
|
|---|
| 8 | # duplicated in all such forms and that any documentation,
|
|---|
| 9 | # advertising materials, and other materials related to such
|
|---|
| 10 | # distribution and use acknowledge that the software was developed
|
|---|
| 11 | # by the University of California, Berkeley. The name of the
|
|---|
| 12 | # University may not be used to endorse or promote products derived
|
|---|
| 13 | # from this software without specific prior written permission.
|
|---|
| 14 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
|---|
| 15 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|---|
| 16 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 17 | #
|
|---|
| 18 | # @(#)mkdep.sh 5.12 (Berkeley) 6/30/88
|
|---|
| 19 | #
|
|---|
| 20 |
|
|---|
| 21 | MAKE=Makefile # default makefile name is "Makefile"
|
|---|
| 22 |
|
|---|
| 23 | while :
|
|---|
| 24 | do case "$1" in
|
|---|
| 25 | # -f allows you to select a makefile name
|
|---|
| 26 | -f)
|
|---|
| 27 | MAKE=$2
|
|---|
| 28 | shift; shift ;;
|
|---|
| 29 |
|
|---|
| 30 | # the -p flag produces "program: program.c" style dependencies
|
|---|
| 31 | # so .o's don't get produced
|
|---|
| 32 | -p)
|
|---|
| 33 | SED='s;\.o;;'
|
|---|
| 34 | shift ;;
|
|---|
| 35 | *)
|
|---|
| 36 | break ;;
|
|---|
| 37 | esac
|
|---|
| 38 | done
|
|---|
| 39 |
|
|---|
| 40 | if [ $# = 0 ] ; then
|
|---|
| 41 | echo 'usage: mkdep [-p] [-f makefile] [flags] file ...'
|
|---|
| 42 | exit 1
|
|---|
| 43 | fi
|
|---|
| 44 |
|
|---|
| 45 | if [ ! -w $MAKE ]; then
|
|---|
| 46 | echo "mkdep: no writeable file \"$MAKE\""
|
|---|
| 47 | exit 1
|
|---|
| |
|---|