mkdep.in (135447) | mkdep.in (193149) |
---|---|
1#!/bin/sh - 2 | 1#!/bin/sh - 2 |
3## 4## Modified to handle -vpath <path> option by Michael Graff, ISC. 5## The purpose of this is to allow this script to run outside of the 6## source directory, for instance when running configure with 7## ../bind9-mainline/configure 8## and still have "make depend" work. 9## 10 |
|
3## ++Copyright++ 1987 4## - 5## Copyright (c) 1987 Regents of the University of California. 6## All rights reserved. 7## 8## Redistribution and use in source and binary forms, with or without 9## modification, are permitted provided that the following conditions 10## are met: --- 44 unchanged lines hidden (view full) --- 55# 56# @(#)mkdep.sh 5.12 (Berkeley) 6/30/88 57# 58 59MAKE=Makefile # default makefile name is "Makefile" 60 61while : 62 do case "$1" in | 11## ++Copyright++ 1987 12## - 13## Copyright (c) 1987 Regents of the University of California. 14## All rights reserved. 15## 16## Redistribution and use in source and binary forms, with or without 17## modification, are permitted provided that the following conditions 18## are met: --- 44 unchanged lines hidden (view full) --- 63# 64# @(#)mkdep.sh 5.12 (Berkeley) 6/30/88 65# 66 67MAKE=Makefile # default makefile name is "Makefile" 68 69while : 70 do case "$1" in |
71 # -vpath allows one to select a virtual path for .c files 72 -vpath) 73 VPATH=$2; 74 shift; shift ;; |
|
63 # -f allows you to select a makefile name 64 -f) 65 MAKE=$2 66 shift; shift ;; 67 68 # the -p flag produces "program: program.c" style dependencies 69 # so .o's don't get produced 70 -p) 71 SED='s;\.o;;' 72 shift ;; 73 *) 74 break ;; 75 esac 76done 77 78if [ $# = 0 ] ; then | 75 # -f allows you to select a makefile name 76 -f) 77 MAKE=$2 78 shift; shift ;; 79 80 # the -p flag produces "program: program.c" style dependencies 81 # so .o's don't get produced 82 -p) 83 SED='s;\.o;;' 84 shift ;; 85 *) 86 break ;; 87 esac 88done 89 90if [ $# = 0 ] ; then |
79 echo 'usage: mkdep [-p] [-f makefile] [flags] file ...' | 91 echo 'usage: mkdep [-vpath path] [-p] [-f makefile] [flags] file ...' |
80 exit 1 81fi 82 83if [ ! -w $MAKE ]; then 84 echo "mkdep: no writeable file \"$MAKE\"" 85 exit 1 86fi 87 --- 14 unchanged lines hidden (view full) --- 102# If your compiler doesn't have -M, add it. If you can't, the next two 103# lines will try and replace the "cc -M". The real problem is that this 104# hack can't deal with anything that requires a search path, and doesn't 105# even try for anything using bracket (<>) syntax. 106# 107# egrep '^#include[ ]*".*"' /dev/null $* | 108# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' | 109 | 92 exit 1 93fi 94 95if [ ! -w $MAKE ]; then 96 echo "mkdep: no writeable file \"$MAKE\"" 97 exit 1 98fi 99 --- 14 unchanged lines hidden (view full) --- 114# If your compiler doesn't have -M, add it. If you can't, the next two 115# lines will try and replace the "cc -M". The real problem is that this 116# hack can't deal with anything that requires a search path, and doesn't 117# even try for anything using bracket (<>) syntax. 118# 119# egrep '^#include[ ]*".*"' /dev/null $* | 120# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' | 121 |
122if [ X"${VPATH}" != X ] ; then 123 for arg in $* ; do 124 case "$arg" in 125 -*) 126 newargs="$newargs $arg" 127 ;; 128 *) 129 newargs="$newargs $VPATH/$arg" 130 ;; 131 esac 132 done 133else 134 newargs="$*"; 135fi 136 |
|
110MKDEPPROG="@MKDEPPROG@" 111if [ X"${MKDEPPROG}" != X ]; then | 137MKDEPPROG="@MKDEPPROG@" 138if [ X"${MKDEPPROG}" != X ]; then |
112 @SHELL@ -c "${MKDEPPROG} $*" | 139 @SHELL@ -c "${MKDEPPROG} ${newargs}" |
113else | 140else |
114 @MKDEPCC@ @MKDEPCFLAGS@ $* | | 141 @MKDEPCC@ @MKDEPCFLAGS@ ${newargs} | |
115 sed " 116 s; \./; ;g 117 @LIBTOOL_MKDEP_SED@ 118 $SED" | 119 awk '{ 120 if ($1 != prev) { 121 if (rec != "") 122 print rec; --- 26 unchanged lines hidden --- | 142 sed " 143 s; \./; ;g 144 @LIBTOOL_MKDEP_SED@ 145 $SED" | 146 awk '{ 147 if ($1 != prev) { 148 if (rec != "") 149 print rec; --- 26 unchanged lines hidden --- |