Rework META_TARGETS so that it automatically adds META_DEPS to the targets.
This will only be done if the target is defined, so if the target is defined after bsd.sys.mk is included then it needs to manually add ${META_DEPS} still. Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
996e1d4975
commit
c41790fef1
@ -131,13 +131,8 @@ _MARCHS+= x86
|
|||||||
META_TARGETS+= compat copies symlinks
|
META_TARGETS+= compat copies symlinks
|
||||||
stage_includes: ${SHARED}
|
stage_includes: ${SHARED}
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
|
||||||
|
|
||||||
installincludes: ${SHARED}
|
|
||||||
${SHARED}: compat
|
|
||||||
|
|
||||||
# Take care of stale directory-level symlinks.
|
# Take care of stale directory-level symlinks.
|
||||||
compat: ${META_DEPS}
|
compat:
|
||||||
.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
|
.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
|
||||||
if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
|
if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
|
||||||
rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
|
rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
|
||||||
@ -147,7 +142,7 @@ compat: ${META_DEPS}
|
|||||||
-f ${.CURDIR}/../etc/mtree/BSD.include.dist \
|
-f ${.CURDIR}/../etc/mtree/BSD.include.dist \
|
||||||
-p ${DESTDIR}${INCLUDEDIR} > /dev/null
|
-p ${DESTDIR}${INCLUDEDIR} > /dev/null
|
||||||
|
|
||||||
copies: ${META_DEPS}
|
copies:
|
||||||
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
|
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
|
||||||
${_MARCHS}
|
${_MARCHS}
|
||||||
if [ -d ${DESTDIR}${INCLUDEDIR}/$i ]; then \
|
if [ -d ${DESTDIR}${INCLUDEDIR}/$i ]; then \
|
||||||
@ -233,7 +228,7 @@ copies: ${META_DEPS}
|
|||||||
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \
|
||||||
${DESTDIR}${INCLUDEDIR}/teken
|
${DESTDIR}${INCLUDEDIR}/teken
|
||||||
|
|
||||||
symlinks: ${META_DEPS}
|
symlinks:
|
||||||
@${ECHO} "Setting up symlinks to kernel source tree..."
|
@${ECHO} "Setting up symlinks to kernel source tree..."
|
||||||
.for i in ${LDIRS}
|
.for i in ${LDIRS}
|
||||||
cd ${.CURDIR}/../sys/$i; \
|
cd ${.CURDIR}/../sys/$i; \
|
||||||
@ -347,6 +342,11 @@ symlinks: ${META_DEPS}
|
|||||||
${DESTDIR}${INCLUDEDIR}/rpc; \
|
${DESTDIR}${INCLUDEDIR}/rpc; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
.include <bsd.prog.mk>
|
||||||
|
|
||||||
|
installincludes: ${SHARED}
|
||||||
|
${SHARED}: compat
|
||||||
|
|
||||||
.if ${MACHINE} == "host" && !defined(_SKIP_BUILD)
|
.if ${MACHINE} == "host" && !defined(_SKIP_BUILD)
|
||||||
# we're here because we are building a sysroot...
|
# we're here because we are building a sysroot...
|
||||||
# we need MACHINE et al set correctly
|
# we need MACHINE et al set correctly
|
||||||
|
@ -222,7 +222,7 @@ beforeinstall: ${SHARED} etc-examples
|
|||||||
META_TARGETS+= copies symlinks
|
META_TARGETS+= copies symlinks
|
||||||
.ORDER: ${SHARED} etc-examples
|
.ORDER: ${SHARED} etc-examples
|
||||||
|
|
||||||
copies: ${META_DEPS}
|
copies:
|
||||||
.for i in ${LDIRS}
|
.for i in ${LDIRS}
|
||||||
if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
|
if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
|
||||||
rm -f ${DESTDIR}${BINDIR}/$i; \
|
rm -f ${DESTDIR}${BINDIR}/$i; \
|
||||||
@ -235,7 +235,7 @@ copies: ${META_DEPS}
|
|||||||
${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file}
|
${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file}
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
symlinks: ${META_DEPS}
|
symlinks:
|
||||||
.for i in ${LDIRS}
|
.for i in ${LDIRS}
|
||||||
rm -rf ${DESTDIR}${BINDIR}/$i
|
rm -rf ${DESTDIR}${BINDIR}/$i
|
||||||
ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i
|
ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i
|
||||||
|
@ -297,3 +297,10 @@ STAGE_SYMLINKS.links= ${SYMLINKS}
|
|||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if defined(META_TARGETS)
|
||||||
|
.for _tgt in ${META_TARGETS}
|
||||||
|
.if target(${_tgt})
|
||||||
|
${_tgt}: ${META_DEPS}
|
||||||
|
.endif
|
||||||
|
.endfor
|
||||||
|
.endif
|
||||||
|
@ -32,6 +32,10 @@ OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP}
|
|||||||
.if ${.MAKE.MODE:Mmeta*} != ""
|
.if ${.MAKE.MODE:Mmeta*} != ""
|
||||||
# we can afford to use cookies to prevent some targets
|
# we can afford to use cookies to prevent some targets
|
||||||
# re-running needlessly but only when using filemon.
|
# re-running needlessly but only when using filemon.
|
||||||
|
# Targets that should support the meta mode cookie handling should just be
|
||||||
|
# added to META_TARGETS. If bsd.sys.mk cannot be included then ${META_DEPS}
|
||||||
|
# should be added as a target dependency as well. Otherwise the target
|
||||||
|
# is added to in bsd.sys.mk since it comes last.
|
||||||
.if ${.MAKE.MODE:Mnofilemon} == ""
|
.if ${.MAKE.MODE:Mnofilemon} == ""
|
||||||
META_COOKIE_COND= empty(.TARGET:M${.OBJDIR})
|
META_COOKIE_COND= empty(.TARGET:M${.OBJDIR})
|
||||||
META_COOKIE= ${COOKIE.${.TARGET}:U${${META_COOKIE_COND}:?${.OBJDIR}/${.TARGET}:${.TARGET}}}
|
META_COOKIE= ${COOKIE.${.TARGET}:U${${META_COOKIE_COND}:?${.OBJDIR}/${.TARGET}:${.TARGET}}}
|
||||||
|
@ -18,7 +18,7 @@ all clean cleandir depend lint tags:
|
|||||||
beforeinstall: ${SHARED}
|
beforeinstall: ${SHARED}
|
||||||
META_TARGETS+= copies symlinks
|
META_TARGETS+= copies symlinks
|
||||||
|
|
||||||
copies: ${META_DEPS}
|
copies:
|
||||||
if [ -L ${DDIR}/${CFDIR} ]; then rm -f ${DDIR}/${CFDIR}; fi
|
if [ -L ${DDIR}/${CFDIR} ]; then rm -f ${DDIR}/${CFDIR}; fi
|
||||||
.for dir in ${CFDIRS}
|
.for dir in ${CFDIRS}
|
||||||
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 -d ${DDIR}/${dir}
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 -d ${DDIR}/${dir}
|
||||||
@ -27,7 +27,7 @@ copies: ${META_DEPS}
|
|||||||
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${SENDMAIL_DIR}/${file} ${DDIR}/${file}
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${SENDMAIL_DIR}/${file} ${DDIR}/${file}
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
symlinks: ${META_DEPS}
|
symlinks:
|
||||||
rm -rf ${DDIR}/${CFDIR}; ln -s ${SENDMAIL_DIR}/${CFDIR} ${DDIR}/${CFDIR}
|
rm -rf ${DDIR}/${CFDIR}; ln -s ${SENDMAIL_DIR}/${CFDIR} ${DDIR}/${CFDIR}
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -72,7 +72,7 @@ all: zoneinfo
|
|||||||
.endif
|
.endif
|
||||||
META_TARGETS+= zoneinfo install-zoneinfo
|
META_TARGETS+= zoneinfo install-zoneinfo
|
||||||
|
|
||||||
zoneinfo: yearistype ${TDATA} ${META_DEPS}
|
zoneinfo: yearistype ${TDATA}
|
||||||
mkdir -p ${TZBUILDDIR}
|
mkdir -p ${TZBUILDDIR}
|
||||||
cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
|
cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
|
||||||
umask 022; cd ${.CURDIR}; \
|
umask 022; cd ${.CURDIR}; \
|
||||||
@ -80,7 +80,7 @@ zoneinfo: yearistype ${TDATA} ${META_DEPS}
|
|||||||
${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
|
${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
|
||||||
|
|
||||||
beforeinstall: install-zoneinfo
|
beforeinstall: install-zoneinfo
|
||||||
install-zoneinfo: ${META_DEPS}
|
install-zoneinfo:
|
||||||
cd ${TZBUILDDIR} && \
|
cd ${TZBUILDDIR} && \
|
||||||
find -s * -type f -print -exec ${INSTALL} \
|
find -s * -type f -print -exec ${INSTALL} \
|
||||||
-o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
|
-o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
|
||||||
|
Loading…
Reference in New Issue
Block a user