Makefile: practice pedantic particularity
[otpcli.git] / awkdep.sh
blob38474ce38a4c501dd398e62331bfc1ca3a5f7a17
1 #!/bin/sh
2 d="$1"; test "$#" "=" "0" || shift
3 LC_ALL=C \
4 awk -v d="${d:+$d : }" -v x="$*" \
5 'BEGIN{if(x&&d){split(x,l," ");for(e in l)print d l[e]}}!/^#(line)?[ \t]+[0-9]/{next}{sub(/^[^"]+"/,"");sub(/".*$/,"");if(/^[\/<#]/)next;sub(/^\.\//,"");if(!s[$0]){s[$0]=1;print d $0}}' |
6 LC_ALL=C sort -u