#!/bin/sh

# This script removes absolute path names in a dependency file. These
# depependecies are probably not referring to a include file in this
# package and should be removed.

Usage () {
  echo "Usage: $0 dependency-file";
}

Remdep () {
  sed -e 's+ /[^ ]*++g
/.*:$/d' < $file > $file.$$
  mv $file.$$ $file
}

if test $# = 0; then
  Usage;
  exit 1;
fi

for arg do
  case $arg in
    -h | -help | --help) 
	Usage
	;;
    -*)
	echo "Unsupported flag: $arg"
	exit 1;
	;;
    *)
	file=$arg
	Remdep
	;;
  esac
done


