mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 16:49:40 +00:00
22 lines
307 B
Bash
22 lines
307 B
Bash
|
# $FreeBSD$
|
||
|
|
||
|
GREP=${GREP:-grep}
|
||
|
CC=${CC:-cc}
|
||
|
AWK=${AWK:-awk}
|
||
|
MV=${MV:=mv}
|
||
|
RM=${RM:=rm}
|
||
|
IN=$1
|
||
|
OUT=$2
|
||
|
|
||
|
trap "${RM} -f $OUT.tmp" EXIT
|
||
|
|
||
|
$GREP -v '#include' $IN | \
|
||
|
$CC -E -D__KERNEL__ -dM - | \
|
||
|
$AWK -F"[ (]" '
|
||
|
/define/ {
|
||
|
print "#ifndef " $2;
|
||
|
print;
|
||
|
print "#endif";
|
||
|
}' > $OUT.tmp
|
||
|
${MV} -f $OUT.tmp $OUT
|