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