switch-coreboot/util/mkdep
Ronald G. Minnich 371f3e67ce I need this to get my work done and there were no better proposals.
I did change the /bin/bash to /bin/sh per the comments. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@919 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-10-13 18:38:50 +00:00

16 lines
285 B
Bash

#!/bin/sh
out=$1
shift
o=""
while [ "$1" != "--" ]; do
o="$o $1"
shift
done
shift
p=`pwd`
while [ "$1" ] ; do
echo $1 >>${out}
cpp -M -m32 $o $1 | sed 's/.*://' | sed 's/^ *//g' | tr ' ' '\n' | tr '\\' ' ' |sed "s,^include,${p}/include," >>${out}
shift
done
sort -o ${out} -u ${out}