]> git.sur5r.net Git - openldap/blobdiff - build/mkdep
before including <pth.h>:
[openldap] / build / mkdep
index 62e1ad02c859d546df8e97e47e80d21251dbf4df..d2e316865ee29d9373d15f787c4baf30b201fb46 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh -
-## Copyright 1998,1999 The OpenLDAP Foundation
+# $OpenLDAP$
+## Copyright 1998-2000 The OpenLDAP Foundation
 ## COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
 ## of this package for details.
 #
@@ -145,26 +146,29 @@ _EOF_
 $MKDEP_CC $MKDEP_CFLAGS $files | \
        sed -e 's; \./; ;g' | \
        $SED > $TMP.sed
-# dont pipe to awk.  SGI awk wants a filename as argument.
+# do not pipe to awk.  SGI awk wants a filename as argument.
 # (or '-', but I do not know if all other awks support that.)
 awk '
-$1 ~ /:/ {
-       filenm=$1;
-       dep=substr($0, length(filenm)+1);
+$1 ~ /:$/ {
+       filenm=$1
+       dep=substr($0, length(filenm)+1)
 }
-$1 !~ /:/ {
-       dep=$0;
+$1 !~ /:$/ {
+       dep=$0
 }
 /.*/ {
-       split(dep, depends, " ");
+       if ( length(filenm) < 2 ) next
+       if ( filenm ~ /:.*:$/ ) next
+       split(dep, depends, " ")
        for(d in depends) {
-               dfile = depends[d];
-               if (( noslash == "yes") && (dfile ~ /^\// )) next
+               dfile = depends[d]
                if ( length(dfile) < 2 ) continue
-               rec = filenm " " dfile;
-               print rec;
+               if ( dfile ~ /:/ ) continue
+               if (( noslash == "yes") && (dfile ~ /^\// )) continue
+               rec = filenm " " dfile
+               print rec
        }
-    }
+}
 ' noslash="$NOSLASH" $TMP.sed >> $TMP