Date: Wed, 24 Feb 2016 17:19:05 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295985 - in head: share/mk sys/conf Message-ID: <201602241719.u1OHJ5uX089622@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Wed Feb 24 17:19:05 2016 New Revision: 295985 URL: https://svnweb.freebsd.org/changeset/base/295985 Log: FAST_DEPEND: Rework how guessed dependencies are handled. Rather than depend on .depend not existing, check the actual .depend.OBJ file that will be used for that object. If it doesn't exist then use the guessed dependencies. FAST_DEPEND may never have a .depend file. Not having one means all of the previous logic would over-depend all object files on all headers which is not what we wanted. It also means that if a .depend is generated before a build is done for _EXTRADEPEND (such as for PROG or LIB) then all of these dependencies would not be used since the .depend wasn't generated from mkdep and the real .depend.* files are not generated until the build. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/share/mk/bsd.dep.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -94,19 +94,21 @@ _SKIP_READ_DEPEND= 1 .if defined(SRCS) CLEANFILES?= -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .for _S in ${SRCS:N*.[dhly]} -${_S:R}.o: ${_S} -.endfor +OBJS_DEPEND_GUESS.${_S:R}.o= ${_S} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_S:R}.o: ${OBJS_DEPEND_GUESS.${_S:R}.o} .endif +.endfor # Lexical analyzers .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) -${_LC:R}.o: ${_LC} +OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_LC:R}.o: ${OBJS_DEPEND_GUESS.${_LC:R}.o} .endif SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} CLEANFILES+= ${_LC} @@ -136,8 +138,9 @@ CLEANFILES+= ${_YH} ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) -${_YC:R}.o: ${_YC} +OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_YC:R}.o: ${OBJS_DEPEND_GUESS.${_YC:R}.o} .endif .endfor .endfor @@ -195,7 +198,7 @@ DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEP .for __depend_obj in ${DEPENDFILES_OBJS} .sinclude "${__depend_obj}" .endfor -.endif +.endif # !defined(_SKIP_READ_DEPEND) .endif # ${MK_FAST_DEPEND} == "yes" .endif # defined(SRCS) @@ -208,6 +211,18 @@ beforedepend: afterdepend: beforedepend .endif +# Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet. +# Done here to support meta mode as well which does not always need +# the CFLAGS modifications or .depend.* included. +.if ${MK_FAST_DEPEND} == "yes" +.for __obj in ${DEPENDOBJS:O:u} +.if !exists(${.OBJDIR}/${DEPENDFILE}.${__obj}) +${__obj}: ${OBJS_DEPEND_GUESS} +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} +.endif +.endfor +.endif + .if !target(depend) .if defined(SRCS) depend: beforedepend ${DEPENDFILE} afterdepend Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/share/mk/bsd.lib.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -415,28 +415,31 @@ lint: ${SRCS:M*.c} .include <bsd.man.mk> .endif -.include <bsd.dep.mk> - -.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .if defined(LIB) && !empty(LIB) -.if !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS} ${STATICOBJS} ${POBJS}: ${SRCS:M*.h} +OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${OBJS} ${STATICOBJS} ${POBJS}: ${OBJS_DEPEND_GUESS} .endif .for _S in ${SRCS:N*.[hly]} -${_S:R}.po: ${_S} +OBJS_DEPEND_GUESS.${_S:R}.po= ${_S} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_S:R}.po: ${OBJS_DEPEND_GUESS.${_S:R}.po} +.endif .endfor .endif .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) -.if !exists(${.OBJDIR}/${DEPENDFILE}) -${SOBJS}: ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${SOBJS}: ${OBJS_DEPEND_GUESS} .endif .for _S in ${SRCS:N*.[hly]} -${_S:R}.So: ${_S} -.endfor +OBJS_DEPEND_GUESS.${_S:R}.So= ${_S} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${_S:R}.So: ${OBJS_DEPEND_GUESS.${_S:R}.So} .endif +.endfor .endif +.include <bsd.dep.mk> .include <bsd.obj.mk> - .include <bsd.sys.mk> Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/share/mk/bsd.prog.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -275,12 +275,13 @@ lint: ${SRCS:M*.c} .include <bsd.man.mk> .endif -.include <bsd.dep.mk> - -.if defined(PROG) && !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS}: ${SRCS:M*.h} +.if defined(PROG) +OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${OBJS}: ${OBJS_DEPEND_GUESS} +.endif .endif +.include <bsd.dep.mk> .include <bsd.obj.mk> - .include <bsd.sys.mk> Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/sys/conf/kern.post.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -143,8 +143,10 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o .endif ${SYSTEM_LD_TAIL} -.if !exists(${.OBJDIR}/.depend) -${SYSTEM_OBJS}: assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} +OBJS_DEPEND_GUESS+= assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} \ + ${MFILES:T:S/.m$/.h/} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/.depend) +${SYSTEM_OBJS}: ${OBJS_DEPEND_GUESS} .endif LNFILES= ${CFILES:T:S/.c$/.ln/} @@ -239,10 +241,18 @@ CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if !defined(_SKIP_READ_DEPEND) -.for __depend_obj in ${DEPENDFILES_OBJS} -.sinclude "${__depend_obj}" -.endfor +.for __obj in ${DEPENDOBJS} +.if exists(${.OBJDIR}/.depend.${__obj}) +.include ".depend.${__obj}" +.else +# Guess some dependencies for when no .depend.OBJ is generated yet. +.if ${SYSTEM_OBJS:M${__obj}} +${__obj}: ${OBJS_DEPEND_GUESS} .endif +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} +.endif +.endfor +.endif # !defined(_SKIP_READ_DEPEND) .endif # ${MK_FAST_DEPEND} == "yes" .NOPATH: .depend ${DEPENDFILES_OBJS} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Feb 24 17:19:02 2016 (r295984) +++ head/sys/conf/kmod.mk Wed Feb 24 17:19:05 2016 (r295985) @@ -450,16 +450,16 @@ lint: ${SRCS} ${OBJS}: opt_global.h .endif -.include <bsd.dep.mk> - CLEANDEPENDFILES+= ${_ILINKS} # .depend needs include links so we remove them only together. cleanilinks: rm -f ${_ILINKS} -.if !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS}: ${SRCS:M*.h} +OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${OBJS}: ${OBJS_DEPEND_GUESS} .endif +.include <bsd.dep.mk> .include <bsd.obj.mk> .include "kern.mk"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602241719.u1OHJ5uX089622>