xref: /freebsd/sys/tools/sound/emu10k1-mkalsa.sh (revision b1f9167f94059fd55c630891d359bcff987bd7eb)
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