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