From f25d8749d49c2dac52891bc0b98559f77826a558 Mon Sep 17 00:00:00 2001 From: sjg Date: Tue, 8 Dec 2015 01:29:07 +0000 Subject: Merge bmake-20151201 --- contrib/bmake/mk/ChangeLog | 28 ++++++++++++++++++++++- contrib/bmake/mk/host-target.mk | 8 +++---- contrib/bmake/mk/init.mk | 6 ++++- contrib/bmake/mk/install-mk | 4 ++-- contrib/bmake/mk/lib.mk | 4 ++-- contrib/bmake/mk/meta.autodep.mk | 7 ++++-- contrib/bmake/mk/meta.stage.mk | 4 ++-- contrib/bmake/mk/meta.subdir.mk | 4 ++-- contrib/bmake/mk/meta.sys.mk | 30 ++++++++++++++---------- contrib/bmake/mk/own.mk | 4 +--- contrib/bmake/mk/sys.mk | 49 +++++++++++++++++++++++++++------------- 11 files changed, 101 insertions(+), 47 deletions(-) (limited to 'contrib/bmake/mk') diff --git a/contrib/bmake/mk/ChangeLog b/contrib/bmake/mk/ChangeLog index e7f71b5..965ff4d 100644 --- a/contrib/bmake/mk/ChangeLog +++ b/contrib/bmake/mk/ChangeLog @@ -1,3 +1,29 @@ +2015-11-14 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151111 + + * meta.sys.mk: include sys.dependfile.mk + + * sys.mk (OPTIONS_DEFAULT_NO): use options.mk + to set MK_AUTO_OBJ and MK_DIRDEPS_BUILD + include local.sys.env.mk early + include local.sys.mk later + + * own.mk (OPTIONS_DEFAULT_NO): AUTO_OBJ etc moved to sys.mk + +2015-11-13 Simon J. Gerraty + + * meta.sys.mk (META_COOKIE_TOUCH): + add ${META_COOKIE_TOUCH} to the end of scripts to touch cookie + + * meta.stage.mk: stage_libs should ignore SYMLINKS. + +2015-10-23 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151022 + + * sys.mk: BSD/OS does not have 'type' as a shell builtin. + 2015-10-20 Simon J. Gerraty * install-mk (MK_VERSION): 20151020 @@ -460,7 +486,7 @@ needed. * gendirdeps.mk: only produce unqualified deps if no .MAKE.DEPENDFILE_PREFERENCE ends in .${MACHINE} - * meta.subdir.mk: apply SUBDIREPS_FILTER + * meta.subdir.mk: apply SUBDIRDEPS_FILTER 2012-04-20 Simon J. Gerraty diff --git a/contrib/bmake/mk/host-target.mk b/contrib/bmake/mk/host-target.mk index b67c34d..f528db9 100644 --- a/contrib/bmake/mk/host-target.mk +++ b/contrib/bmake/mk/host-target.mk @@ -1,5 +1,5 @@ # RCSid: -# $Id: host-target.mk,v 1.9 2015/09/10 18:42:57 sjg Exp $ +# $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $ # Host platform information; may be overridden .if !defined(_HOST_OSNAME) @@ -21,7 +21,7 @@ _HOST_ARCH := ${_HOST_MACHINE} .else _HOST_ARCH != uname -p 2> /dev/null || uname -m # uname -p may produce garbage on linux -.if ${_HOST_ARCH:[\#]} > 1 +.if ${_HOST_ARCH:[\#]} > 1 || ${_HOST_ARCH:Nunknown} == "" _HOST_ARCH := ${_HOST_MACHINE} .endif .endif @@ -33,10 +33,10 @@ HOST_MACHINE := ${_HOST_MACHINE} .endif HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//} -HOST_OSTYPE := ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} +HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} HOST_OS := ${_HOST_OSNAME} host_os := ${_HOST_OSNAME:tl} -HOST_TARGET := ${host_os}${HOST_OSMAJOR}-${_HOST_ARCH} +HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH} # tr is insanely non-portable, accommodate the lowest common denominator TR ?= tr diff --git a/contrib/bmake/mk/init.mk b/contrib/bmake/mk/init.mk index e700370..43561b5 100644 --- a/contrib/bmake/mk/init.mk +++ b/contrib/bmake/mk/init.mk @@ -1,4 +1,4 @@ -# $Id: init.mk,v 1.9 2013/07/18 05:46:24 sjg Exp $ +# $Id: init.mk,v 1.10 2015/12/07 04:28:31 sjg Exp $ # # @(#) Copyright (c) 2002, Simon J. Gerraty # @@ -47,4 +47,8 @@ PROFFLAGS?= -DGPROF -DPROF _SKIP_BUILD = not building at level 0 .endif +.if !empty(_SKIP_BUILD) +all: .PHONY +.warning ${_SKIP_BUILD} +.endif .endif diff --git a/contrib/bmake/mk/install-mk b/contrib/bmake/mk/install-mk index eca75e0..d2500da 100644 --- a/contrib/bmake/mk/install-mk +++ b/contrib/bmake/mk/install-mk @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.115 2015/10/20 22:04:53 sjg Exp $ +# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20151020 +MK_VERSION=20151111 OWNER= GROUP= MODE=444 diff --git a/contrib/bmake/mk/lib.mk b/contrib/bmake/mk/lib.mk index 417aa02..c76fd9b 100644 --- a/contrib/bmake/mk/lib.mk +++ b/contrib/bmake/mk/lib.mk @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.51 2014/05/23 01:30:36 sjg Exp $ +# $Id: lib.mk,v 1.52 2015/11/14 18:09:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -254,7 +254,7 @@ DLLIB ?= -ldl # is a waste of time, this tells meta.autodep.mk to just pick one # (typically .So) # yes, 42 is a random number. -.if ${MK_META_MODE} == "yes" && ${SRCS:Uno:[\#]} > 42 +.if ${MK_DIRDEPS_BUILD} == "yes" && ${SRCS:Uno:[\#]} > 42 OPTIMIZE_OBJECT_META_FILES ?= yes .endif diff --git a/contrib/bmake/mk/meta.autodep.mk b/contrib/bmake/mk/meta.autodep.mk index a062e47..c9fdb0e 100644 --- a/contrib/bmake/mk/meta.autodep.mk +++ b/contrib/bmake/mk/meta.autodep.mk @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.37 2015/06/16 06:29:17 sjg Exp $ +# $Id: meta.autodep.mk,v 1.39 2015/12/07 04:35:32 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -50,6 +50,9 @@ UPDATE_DEPENDFILE = NO .endif _CURDIR ?= ${.CURDIR} +_OBJDIR ?= ${.OBJDIR} +_OBJTOP ?= ${OBJTOP} +_OBJROOT ?= ${OBJROOT:U${_OBJTOP}} _DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T} .if ${.MAKE.LEVEL} == 0 @@ -190,7 +193,7 @@ gendirdeps: ${_DEPENDFILE} # anything which matches ${_OBJROOT}* but not ${_OBJTOP}* # needs to be qualified in DIRDEPS # The pseudo machine "host" is used for HOST_TARGET -DIRDEPS = \ +DIRDEPS += \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} diff --git a/contrib/bmake/mk/meta.stage.mk b/contrib/bmake/mk/meta.stage.mk index 4337c0e..b77b27a 100644 --- a/contrib/bmake/mk/meta.stage.mk +++ b/contrib/bmake/mk/meta.stage.mk @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.40 2015/10/04 17:36:54 sjg Exp $ +# $Id: meta.stage.mk,v 1.41 2015/11/13 17:34:04 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -155,7 +155,7 @@ stage_libs: .dirdep @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} \ ${SHLIB_LINKS:@t@${STAGE_LIBS:T:M$t.*} $t@} .elif !empty(SHLIB_LINK) && !empty(SHLIB_NAME) - @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} ${SYMLINKS:T} + @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} .endif .endif @touch $@ diff --git a/contrib/bmake/mk/meta.subdir.mk b/contrib/bmake/mk/meta.subdir.mk index 2b739ee..d27de10 100644 --- a/contrib/bmake/mk/meta.subdir.mk +++ b/contrib/bmake/mk/meta.subdir.mk @@ -1,4 +1,4 @@ -# $Id: meta.subdir.mk,v 1.10 2012/07/03 05:26:46 sjg Exp $ +# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -62,7 +62,7 @@ _subdeps != cd ${.CURDIR} && \ DIRDEPS = .else # clean up if needed -DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIREPS_FILTER:Uu}} +DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}} .endif # we just dealt with it, if we leave it defined, # dirdeps.mk will compute some interesting combinations. diff --git a/contrib/bmake/mk/meta.sys.mk b/contrib/bmake/mk/meta.sys.mk index 1d1ba53..8e55878 100644 --- a/contrib/bmake/mk/meta.sys.mk +++ b/contrib/bmake/mk/meta.sys.mk @@ -1,4 +1,4 @@ -# $Id: meta.sys.mk,v 1.22 2015/06/16 06:31:05 sjg Exp $ +# $Id: meta.sys.mk,v 1.26 2015/11/14 21:16:13 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -51,17 +51,6 @@ META_MODE += silent=yes .endif .endif -# make defaults .MAKE.DEPENDFILE to .depend -# that won't work for us. -.if ${.MAKE.DEPENDFILE} == ".depend" -.undef .MAKE.DEPENDFILE -.endif - -# if you don't cross build for multiple MACHINEs concurrently, then -# .MAKE.DEPENDFILE = Makefile.depend -# probably makes sense - you can set that in local.sys.mk -.MAKE.DEPENDFILE ?= Makefile.depend.${MACHINE} - # we use the pseudo machine "host" for the build host. # this should be taken care of before we get here .if ${OBJTOP:Ua} == ${HOST_OBJTOP:Ub} @@ -109,10 +98,27 @@ _metaError: .NOMETA .NOTMAIN .endif +META_COOKIE_TOUCH= +# some targets need to be .PHONY in non-meta mode +META_NOPHONY= .PHONY # Are we, after all, in meta mode? .if ${.MAKE.MODE:Mmeta*} != "" MKDEP_MK = meta.autodep.mk +.if ${.MAKE.MAKEFILES:M*sys.dependfile.mk} == "" +# this does all the smarts of setting .MAKE.DEPENDFILE +.-include +# check if we got anything sane +.if ${.MAKE.DEPENDFILE} == ".depend" +.undef .MAKE.DEPENDFILE +.endif +.MAKE.DEPENDFILE ?= Makefile.depend +.endif + +# we can afford to use cookies to prevent some targets +# re-running needlessly +META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} +META_NOPHONY= .if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" .if ${.MAKEFLAGS:Uno:M-k} != "" # make this more obvious diff --git a/contrib/bmake/mk/own.mk b/contrib/bmake/mk/own.mk index 3fdb16b..070044f 100644 --- a/contrib/bmake/mk/own.mk +++ b/contrib/bmake/mk/own.mk @@ -1,4 +1,4 @@ -# $Id: own.mk,v 1.29 2015/09/08 06:15:31 sjg Exp $ +# $Id: own.mk,v 1.30 2015/11/14 18:09:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -89,12 +89,10 @@ OPTIONS_DEFAULT_NO+= DPADD_MK # process options OPTIONS_DEFAULT_NO+= \ - AUTO_OBJ \ INSTALL_AS_USER \ GPROF \ LIBTOOL \ LINT \ - META_MODE \ OPTIONS_DEFAULT_YES+= \ ARCHIVE \ diff --git a/contrib/bmake/mk/sys.mk b/contrib/bmake/mk/sys.mk index 236f62d..9dc0796 100644 --- a/contrib/bmake/mk/sys.mk +++ b/contrib/bmake/mk/sys.mk @@ -1,4 +1,4 @@ -# $Id: sys.mk,v 1.36 2014/05/11 00:30:19 sjg Exp $ +# $Id: sys.mk,v 1.41 2015/11/14 20:20:34 sjg Exp $ # # @(#) Copyright (c) 2003-2009, Simon J. Gerraty # @@ -75,8 +75,12 @@ M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,} M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N, # type should be a builtin in any sh since about 1980, +# but sadly there are exceptions! +.if ${.MAKE.OS:Unknown:NBSD/OS} == "" +_type_sh = which +.endif # AUTOCONF := ${autoconf:L:${M_whence}} -M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g +M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g M_whence = ${M_type}:M/*:[1] # convert a path to a valid shell variable @@ -102,6 +106,9 @@ _TARGETS := ${.TARGETS} # we need HOST_TARGET etc below. .include +# early customizations +.-include + # find the OS specifics .if defined(SYS_OS_MK) .include <${SYS_OS_MK}> @@ -126,11 +133,30 @@ SYS_OS_MK := ${_sys_mk} .export SYS_OS_MK .endif -# allow customization without editing. -.-include +# some options we need to know early +OPTIONS_DEFAULT_NO += \ + DIRDEPS_BUILD \ + DIRDEPS_CACHE \ + META_MODE + +OPTIONS_DEFAULT_DEPENDENT += \ + AUTO_OBJ/DIRDEPS_BUILD \ + STAGING/DIRDEPS_BUILD \ + +.-include "options.mk" + +.if ${MK_DIRDEPS_BUILD:Uno} == "yes" +MK_META_MODE = yes +.-include +.elif ${MK_META_MODE:Uno} == "yes" +.MAKE.MODE = meta verbose +.endif +# make sure we have a harmless value +.MAKE.MODE ?= normal # if you want objdirs make them automatic -.if ${MKOBJDIRS:Uno} == "auto" +# and do it early before we compute .PATH +.if ${MK_AUTO_OBJ:Uno} == "yes" || ${MKOBJDIRS:Uno} == "auto" .include .endif @@ -178,17 +204,8 @@ Mkdirs= Mkdirs() { \ .cc.cpp-out: @${COMPILE.cc:N-c} -E ${.IMPSRC} | grep -v '^[ ]*$$' -# we don't include own.mk but user can expect -DWITH_META_MODE to work -.if defined(WITHOUT_META_MODE) -USE_META= no -.elif defined(WITH_META_MODE) -USE_META= yes -.endif -.if ${USE_META:Uno} == "yes" -.-include -.endif -# make sure we have a harmless value -.MAKE.MODE ?= normal +# late customizations +.-include # if .CURDIR is matched by any entry in DEBUG_MAKE_DIRS we # will apply DEBUG_MAKE_FLAGS, now. -- cgit v1.1