xref: /freebsd/sys/tools/sound/emu10k1-mkalsa.sh (revision 39ee7a7a6bdd1557b1c3532abf60d139798ac88b)
1# $FreeBSD$
2
3GREP=${GREP:-grep}
4CC=${CC:-cc}
5AWK=${AWK:-awk}
6MV=${MV:=mv}
7RM=${RM:=rm}
8IN=$1
9OUT=$2
10
11trap "${RM} -f $OUT.tmp" EXIT
12
13$GREP -v '#include' $IN | \
14$CC -E -D__KERNEL__ -dM -  | \
15$AWK -F"[     (]" '
16/define/  {
17	print "#ifndef " $2;
18	print;
19	print "#endif";
20}' > $OUT.tmp
21${MV} -f $OUT.tmp $OUT
22