X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=build%2Fmkdep;h=852e7e636b698f1c63808e5f5b2f063424af8208;hb=d3f433a626e18f30bb5c93d05eaf3a77fa7865f5;hp=102b932ebc2c45773f1e2c30fa7c2e1a9b35ad34;hpb=334768c1bbb867f5a5a31d78f20152de5526c2ba;p=openldap diff --git a/build/mkdep b/build/mkdep index 102b932ebc..852e7e636b 100755 --- a/build/mkdep +++ b/build/mkdep @@ -26,6 +26,7 @@ set -e # exit immediately if any errors occur MAKE=Makefile # default makefile name is "Makefile" NOSLASH="no" # by default, / dependencies are included CC=${CC-cc} # default compiler is cc +: ${CC_MKDEP_FLAGS="-M"} # cc -M usually produces dependencies SRCDIR="" SED=cat @@ -127,22 +128,26 @@ cat << _EOF_ >> $TMP _EOF_ -$CC -M $files | \ +$CC $CC_MKDEP_FLAGS $files | \ sed -e 's; \./; ;g' | \ $SED | \ awk ' $1 ~ /:/ { - filenm=$1 - dep=$2 + filenm=$1; + dep=substr($0, length(filenm)+1); } $1 !~ /:/ { - dep=$1 + dep=$0; } /.*/ { - if (( noslash == "yes") && (dep ~ /^\// )) next - if ( length(dep) < 2 ) next - rec = filenm " " dep; - print rec; + split(dep, depends, " "); + for(d in depends) { + dfile = depends[d]; + if (( noslash == "yes") && (dfile ~ /^\// )) next + if ( length(dfile) < 2 ) continue + rec = filenm " " dfile; + print rec; + } } ' noslash="$NOSLASH" >> $TMP