Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Feb 2016 17:19:18 +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: r295988 - in head: kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libheimntlm kerberos5/lib/libhx509 lib/clang share/mk sys/conf
Message-ID:  <201602241719.u1OHJI1d089769@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Wed Feb 24 17:19:18 2016
New Revision: 295988
URL: https://svnweb.freebsd.org/changeset/base/295988

Log:
  FAST_DEPEND: Always run depend via beforebuild which removes many hacks.
  
  This will generate dependencies rather than depending on the previous behavior
  of depending on the guessed OBJS: *.h dependecies or a user running
  'make depend'.
  
  Experimentation showed that depending only on headers was not enough and
  prone to .ORDER errors.  Downstream users may also have added
  dependencies into beforedepend or afterdepend targets.  The safest way to
  ensure dependencies are generated before build is to run 'make depend'
  beforehand rather than just depending on DPSRCS+SRCS.
  
  Note that the OBJS_DEPEND_GUESS mechanism (a.k.a .if !exists(.depend) then
  foo.o: *.h) is still useful as it improves incremental builds with missing
  .depend.* files and allows 'make foo.o' to usually work, while this
  'beforebuild: depend' ensures that the build will always find all dependencies.
  The 'make foo.o' case has no means of a 'beforebuild' hook.
  
  This also removes several hacks in the DIRDEPS_BUILD:
  - NO_INSTALL_INCLUDES is no longer needed as it mostly was to work around
    .ORDER problems with building the needed headers early.
  - DIRDEPS_BUILD: It is no longer necesarry to track "local dependencies" in
    Makefile.depend.
  
    These were only in Makefile.depend for 'clean builds' since nothing would
    generate the files due to skipping 'make depend' and early dependency
    bugs that have been fixed, such as adding headers into SRCS for the
    OBJS_DEPEND_GUESS mechanism.  Normally if a .depend file does not exist then
    a dependency is added by bsd.lib.mk/bsd.prog.mk from OBJS: *.h.  However,
    meta.autodep.mk creates a .depend file from created meta files and inserts
    that into Makefile.depend.  It also only tracks *.[ch] files though which can
    miss some dependencies that are hooked into 'make depend'.  This .depend
    that is created then breaks incremental builds due to the !exists(.depend)
    checks for OBJS_DEPEND_GUESS.  The goal was to skip 'make depend' yet it only
    really works the first time.  After that files are not generated as expected,
    which r288966 tried to address but was using buildfiles: rather than
    beforebuild: and was reverted in r291725.  As noted previously,
    depending only on headers in beforebuild: would create .ORDER errors
    in some cases.
  
    meta.autodep.mk is still used to generate Makefile.depend though via:
      gendirdeps: Makefile.depend
      .END: gendirdeps
  
    This commit allows removing all of the "local dependencies" in
    Makefile.depend which cuts down on churn and removes some of the
    arch-dependent Makefile.depend files.
  
    The "local dependencies" were also problematic for bootstrapping.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/kerberos5/lib/libasn1/Makefile
  head/kerberos5/lib/libhdb/Makefile
  head/kerberos5/lib/libheimntlm/Makefile
  head/kerberos5/lib/libhx509/Makefile
  head/lib/clang/clang.build.mk
  head/share/mk/bsd.dep.mk
  head/sys/conf/kern.post.mk

Modified: head/kerberos5/lib/libasn1/Makefile
==============================================================================
--- head/kerberos5/lib/libasn1/Makefile	Wed Feb 24 17:19:13 2016	(r295987)
+++ head/kerberos5/lib/libasn1/Makefile	Wed Feb 24 17:19:18 2016	(r295988)
@@ -116,11 +116,6 @@ ${GEN_KX509}: kx509.asn1
 .hx.h:
 	${CP} ${.IMPSRC} ${.TARGET}
 
-# This makefile generates a lot of its headers
-# so tell bsd.sys.mk not to try and stage them before they are built.
-# Note: this is rare
-NO_BEFOREBUILD_INCLUDES=
-
 .include <bsd.lib.mk>
 
 .SUFFIXES: .h .c .x .hx

Modified: head/kerberos5/lib/libhdb/Makefile
==============================================================================
--- head/kerberos5/lib/libhdb/Makefile	Wed Feb 24 17:19:13 2016	(r295987)
+++ head/kerberos5/lib/libhdb/Makefile	Wed Feb 24 17:19:18 2016	(r295988)
@@ -97,11 +97,6 @@ ${GEN}: hdb.asn1
 .hx.h:
 	${CP} ${.IMPSRC} ${.TARGET}
 
-# This makefile generates a lot of its headers
-# so tell bsd.sys.mk not to try and stage them before they are built.
-# Note: this is rare
-NO_BEFOREBUILD_INCLUDES=
-
 .include <bsd.lib.mk>
 
 .SUFFIXES: .h .c .x .hx

Modified: head/kerberos5/lib/libheimntlm/Makefile
==============================================================================
--- head/kerberos5/lib/libheimntlm/Makefile	Wed Feb 24 17:19:13 2016	(r295987)
+++ head/kerberos5/lib/libheimntlm/Makefile	Wed Feb 24 17:19:18 2016	(r295988)
@@ -3,7 +3,7 @@
 LIB=	heimntlm
 LDFLAGS=	-Wl,--no-undefined
 LIBADD=	crypto com_err krb5 roken
-SRCS=	ntlm.c ntlm_err.c
+SRCS=	ntlm.c ntlm_err.c ntlm_err.h
 INCS=	heimntlm.h heimntlm-protos.h ntlm_err.h
 CFLAGS+=-I${KRB5DIR}/lib/ntlm -I${KRB5DIR}/lib/roken
 VERSION_MAP= ${KRB5DIR}/lib/ntlm/version-script.map

Modified: head/kerberos5/lib/libhx509/Makefile
==============================================================================
--- head/kerberos5/lib/libhx509/Makefile	Wed Feb 24 17:19:13 2016	(r295987)
+++ head/kerberos5/lib/libhx509/Makefile	Wed Feb 24 17:19:18 2016	(r295988)
@@ -290,11 +290,6 @@ ${GEN_CRMF}: crmf.asn1
 .hx.h:
 	${CP} ${.IMPSRC} ${.TARGET}
 
-# This makefile generates a lot of its headers
-# so tell bsd.sys.mk not to try and stage them before they are built.
-# Note: this is rare
-NO_BEFOREBUILD_INCLUDES=
-
 .include <bsd.lib.mk>
 
 .SUFFIXES: .h .c .x .hx

Modified: head/lib/clang/clang.build.mk
==============================================================================
--- head/lib/clang/clang.build.mk	Wed Feb 24 17:19:13 2016	(r295987)
+++ head/lib/clang/clang.build.mk	Wed Feb 24 17:19:18 2016	(r295988)
@@ -237,7 +237,3 @@ Checkers.inc.h: ${CLANG_SRCS}/lib/Static
 
 SRCS+=		${TGHDRS:C/$/.inc.h/}
 CLEANFILES+=	${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/}
-
-# if we are not doing explicit 'make depend', there is 
-# nothing to cause these to be generated.
-beforebuild: ${SRCS:M*.inc.h}

Modified: head/share/mk/bsd.dep.mk
==============================================================================
--- head/share/mk/bsd.dep.mk	Wed Feb 24 17:19:13 2016	(r295987)
+++ head/share/mk/bsd.dep.mk	Wed Feb 24 17:19:18 2016	(r295988)
@@ -209,6 +209,8 @@ CFLAGS+=	${DEPEND_CFLAGS}
 .endif	# defined(SRCS)
 
 .if ${MK_DIRDEPS_BUILD} == "yes"
+# Prevent meta.autodep.mk from tracking "local dependencies".
+.depend:
 .include <meta.autodep.mk>
 # If using filemon then _EXTRADEPEND is skipped since it is not needed.
 .if empty(.MAKE.MODE:Mnofilemon)
@@ -231,7 +233,14 @@ ${__obj}: ${OBJS_DEPEND_GUESS}
 ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
 .endif
 .endfor
+
+# Always run 'make depend' to generate dependencies early and to avoid the
+# need for manually running it.  The dirdeps build should only do this in
+# sub-makes though since MAKELEVEL0 is for dirdeps calculations.
+.if ${MK_DIRDEPS_BUILD} == "no" || ${.MAKE.LEVEL} > 0
+beforebuild: depend
 .endif
+.endif	# ${MK_FAST_DEPEND} == "yes"
 
 .if !target(depend)
 .if defined(SRCS)

Modified: head/sys/conf/kern.post.mk
==============================================================================
--- head/sys/conf/kern.post.mk	Wed Feb 24 17:19:13 2016	(r295987)
+++ head/sys/conf/kern.post.mk	Wed Feb 24 17:19:18 2016	(r295988)
@@ -251,6 +251,12 @@ CFLAGS+=	${DEPEND_CFLAGS}
 .endfor
 .endif	# !defined(_SKIP_READ_DEPEND)
 .endif	# !defined(_meta_filemon)
+
+# Always run 'make depend' to generate dependencies early and to avoid the
+# need for manually running it.  For the kernel this is mostly a NOP since
+# all dependencies are correctly added or accounted for.  This is mostly to
+# ensure downstream uses of kernel-depend are handled.
+beforebuild: kernel-depend
 .endif	# ${MK_FAST_DEPEND} == "yes"
 
 # Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602241719.u1OHJI1d089769>