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