On 10/14/2015 1:30 PM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Wed Oct 14 20:30:32 2015
> New Revision: 289334
> URL: https://svnweb.freebsd.org/changeset/base/289334
> 
> Log:
>   Recurse on 'buildconfig' and 'installconfig'.  Remove the 'config' pseudo 
> target.
>   
>   The 'config' target isn't really needed right now so just remove it to avoid
>   any clashes with config(8) building.  It's also likely misspelled and should
>   be 'configs' if we decide to add it back.  This was just a convenience
>   target recently added.
>   
>   Sponsored by:       EMC / Isilon Storage Division
> 
> Modified:
>   head/share/mk/bsd.subdir.mk
> 
> Modified: head/share/mk/bsd.subdir.mk
> ==============================================================================
> --- head/share/mk/bsd.subdir.mk       Wed Oct 14 20:28:15 2015        
> (r289333)
> +++ head/share/mk/bsd.subdir.mk       Wed Oct 14 20:30:32 2015        
> (r289334)
> @@ -32,9 +32,10 @@
>  .if !target(__<bsd.subdir.mk>__)
>  __<bsd.subdir.mk>__:
>  
> -ALL_SUBDIR_TARGETS= all all-man checkdpadd clean cleandepend cleandir \
> -                 cleanilinks cleanobj depend distribute lint maninstall \
> -                 manlint obj objlink realinstall regress tags \
> +ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \
> +                 cleandir cleanilinks cleanobj depend distribute \
> +                 installconfig lint maninstall manlint obj objlink \
> +                 realinstall regress tags \
>                   ${SUBDIR_TARGETS}
>  
>  .include <bsd.init.mk>
> @@ -127,7 +128,7 @@ _sub.${__target}: _SUBDIR
>  # This is to support 'make includes' calling 'make buildincludes' and
>  # 'make installincludes' in the proper order, and to support these
>  # targets as SUBDIR_TARGETS.
> -.for __target in files includes config
> +.for __target in files includes
>  .for __stage in build install
>  ${__stage}${__target}:
>  .if make(${__stage}${__target})
> 

So the reason I have been tinkering with this code is because it is so
mysterious to me, given the lack of comments and seemingly out-of-place
nature of it.

It turns out that even moving 'buildconfig' as a recurse target creates
a surprising situation that will break with parallel builds since
'buildconfig' is hooked into 'all', thus 'all' and 'buildconfig' both
end up recursing when calling 'make all'. This explains the make() check
here to avoid recursing if called with 'all' (even though it is checking
the opposite, only calling 'buildconfig' directly to recurse).  Comments
are not a sin.

-- 
Regards,
Bryan Drewery

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to