freebsd-src/sys/tools/emu10k1-mkalsa.sh
Peter Wemm 0ec876a2f0 Attempt to clean up the emu10k1-alsa.h stuff so that config doesn't
delete it each time its run and have it regenerated each time by make.
I used a quick hackish script rather than putting it in the files file
and used the before-depend rule to avoid the depend/no-depend hacks.
2004-02-05 22:51:16 +00:00

22 lines
307 B
Bash

# $FreeBSD$
GREP=${GREP:-grep}
CC=${CC:-cc}
AWK=${AWK:-awk}
MV=${MV:=mv}
RM=${RM:=rm}
IN=$1
OUT=$2
trap "${RM} -f $OUT.tmp" EXIT
$GREP -v '#include' $IN | \
$CC -E -D__KERNEL__ -dM - | \
$AWK -F"[ (]" '
/define/ {
print "#ifndef " $2;
print;
print "#endif";
}' > $OUT.tmp
${MV} -f $OUT.tmp $OUT