More minor IPI work.
[dragonfly/vkernel-mp.git] / sys / tools / emu10k1-mkalsa.sh
blob3f15b8e71d4e8c56ee8f3a1872ae50d486d8bf12
1 # $FreeBSD: src/sys/tools/emu10k1-mkalsa.sh,v 1.1 2004/02/05 22:51:16 peter Exp $
2 # $DragonFly: src/sys/tools/emu10k1-mkalsa.sh,v 1.1 2007/01/04 22:47:03 corecode Exp $
4 GREP=${GREP:-grep}
5 CC=${CC:-cc}
6 AWK=${AWK:-awk}
7 MV=${MV:=mv}
8 RM=${RM:=rm}
9 IN=$1
10 OUT=$2
12 trap "${RM} -f $OUT.tmp" EXIT
14 $GREP -v '#include' $IN | \
15 $CC -E -D__KERNEL__ -dM - | \
16 $AWK -F"[ (]" '
17 /define/ {
18 print "#ifndef " $2;
19 print;
20 print "#endif";
21 }' > $OUT.tmp
22 ${MV} -f $OUT.tmp $OUT