Changeset View
Changeset View
Standalone View
Standalone View
include/Makefile
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | |||||
_MARCHS+= x86 | _MARCHS+= x86 | ||||
.endif | .endif | ||||
META_TARGETS+= compat | META_TARGETS+= compat | ||||
stage_includes: ${SHARED} | stage_includes: ${SHARED} | ||||
SDESTDIR= ${SYSROOT:U${DESTDIR}} | SDESTDIR= ${SYSROOT:U${DESTDIR}} | ||||
# Take care of stale directory-level symlinks. | # Take care of stale directory-level symlinks. | ||||
# Note: The "|| true" after find is needed in case one of the directories does | |||||
# not exist (yet). | |||||
compat: | compat: | ||||
.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto | cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} \ | ||||
if [ -L ${SDESTDIR}${INCLUDEDIR}/$i ]; then \ | crypto -maxdepth 0 -mindepth 0 -type l -print -delete || true | ||||
rm -f ${SDESTDIR}${INCLUDEDIR}/$i; \ | |||||
fi | |||||
.endfor | |||||
bdrewery: There's a similar check in `copies`. Both are dealing with a symlinked dir (here) or header… | |||||
Done Inline Actionslike find ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto -maxdepth 1 -mindepth 1 -type l -delete (-depth 1 is slower for some reason). I was wanting to give an xargs example but bmake just passes it all to sh -c anyway so it doesn't help avoid the problem. bdrewery: like `find ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto -maxdepth 1 -mindepth 1 -type l… | |||||
Done Inline ActionsYes, much better! Included in updated version. However, in this case it needs to be maxdepth 0, and 1 below. arichardson: Yes, much better! Included in updated version. However, in this case it needs to be maxdepth 0… | |||||
mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \ | mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \ | ||||
-f ${SRCTOP}/etc/mtree/BSD.include.dist \ | -f ${SRCTOP}/etc/mtree/BSD.include.dist \ | ||||
-p ${SDESTDIR}${INCLUDEDIR} > /dev/null | -p ${SDESTDIR}${INCLUDEDIR} > /dev/null | ||||
copies: .PHONY .META | copies: .PHONY .META | ||||
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \ | cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto \ | ||||
${_MARCHS} | machine machine/pc ${_MARCHS} -maxdepth 1 -mindepth 1 -type l \ | ||||
if [ -d ${SDESTDIR}${INCLUDEDIR}/$i ]; then \ | -name "*.h" -print -delete || true | ||||
Done Inline Actions-print is not necessary here, but I think it could be helpful since it shows the files that have been deleted. arichardson: `-print` is not necessary here, but I think it could be helpful since it shows the files that… | |||||
cd ${SDESTDIR}${INCLUDEDIR}/$i; \ | |||||
for h in *.h; do \ | |||||
if [ -L $$h ]; then rm -f $$h; fi; \ | |||||
done; \ | |||||
fi | |||||
.endfor | |||||
.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hid:Ndev/hyperv:Ndev/pci:Ndev/veriexec} ${LSUBSUBDIRS} | .for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hid:Ndev/hyperv:Ndev/pci:Ndev/veriexec} ${LSUBSUBDIRS} | ||||
cd ${SRCTOP}/sys; \ | cd ${SRCTOP}/sys; \ | ||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ | ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ | ||||
${SDESTDIR}${INCLUDEDIR}/$i | ${SDESTDIR}${INCLUDEDIR}/$i | ||||
.endfor | .endfor | ||||
cd ${SRCTOP}/sys/${MACHINE}/include; \ | cd ${SRCTOP}/sys/${MACHINE}/include; \ | ||||
${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ | ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ | ||||
${SDESTDIR}${INCLUDEDIR}/machine | ${SDESTDIR}${INCLUDEDIR}/machine | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |
There's a similar check in copies. Both are dealing with a symlinked dir (here) or header (there) switching to a file by choice of committers. If INCSLINKS or the mtree change we could get into trouble. Or someone might be switching from make symlinks to default make copies on the destdir. I think we need to keep this as a seatbelt for _any_ incremental build in WORLDTMP, or install to DESTDIR.
It could probably be more efficient with a find but getting all the arguments to there without going over the command line arg max is tricky.