Attempt to clean up the emu10k1-alsa.h stuff so that config doesn't

delete it each time its run and have it regenerated each time by make.
I used a quick hackish script rather than putting it in the files file
and used the before-depend rule to avoid the depend/no-depend hacks.
This commit is contained in:
Peter Wemm 2004-02-05 22:51:16 +00:00
parent 47d7e8a96f
commit 0ec876a2f0
3 changed files with 27 additions and 11 deletions

View File

@ -35,6 +35,11 @@ miidevs.h standard \
compile-with "${AWK} -f $S/tools/devlist2h.awk $S/dev/mii/miidevs" \
no-obj no-implicit-rule \
clean "miidevs.h"
emu10k1-alsa%diked.h optional pcm pci \
dependency "$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \
compile-with "CC=${CC} AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \
no-obj no-implicit-rule before-depend \
clean "emu10k1-alsa%diked.h"
kern/device_if.m standard
kern/bus_if.m standard
kern/clock_if.m optional genclock
@ -719,8 +724,7 @@ dev/sound/pci/csa.c optional pcm pci
dev/sound/pci/csamidi.c optional midi csa
dev/sound/pci/csapcm.c optional pcm pci
dev/sound/pci/ds1.c optional pcm pci
dev/sound/pci/emu10k1.c optional pcm pci dependency "emu10k1-alsa%diked.h" \
clean "emu10k1-alsa%diked.h"
dev/sound/pci/emu10k1.c optional pcm pci dependency "emu10k1-alsa%diked.h"
dev/sound/pci/es137x.c optional pcm pci
dev/sound/pci/fm801.c optional pcm pci
dev/sound/pci/ich.c optional pcm pci

View File

@ -224,15 +224,6 @@ vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src
vnode_if.h: $S/tools/vnode_if.awk $S/kern/vnode_if.src
${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -h
emu10k1-alsa%diked.h: $S/gnu/dev/sound/pci/emu10k1-alsa.h
grep -v '#include' ${.OODATE} | ${CC} -E -D__KERNEL__ -dM - \
| awk -F"[ (]" '/define/ \
{ print "#ifndef " $$2 ; print ; print "#endif" }' \
>${.TARGET}
.if !exists(${.OBJDIR}/.depend)
_kernel-depend: emu10k1-alsa%diked.h
.endif
# XXX strictly, everything depends on Makefile because changes to ${PROF}
# only appear there, but we don't handle that.

View File

@ -0,0 +1,21 @@
# $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