Skip to content

Commit

Permalink
Merge bmake-20150606
Browse files Browse the repository at this point in the history
Only change to bmake is man page - document .OBJDIR target.
We also get latest dirdeps.mk and friends.
  • Loading branch information
sgerraty committed Jun 11, 2015
2 parents cc60647 + c86c1f1 commit 128a410
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 41 deletions.
6 changes: 6 additions & 0 deletions contrib/bmake/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2015-06-06 Simon J. Gerraty <[email protected]>

* Makefile (MAKE_VERSION): 20150606
Merge with NetBSD make, pick up
o make.1: document .OBJDIR target

2015-05-05 Simon J. Gerraty <[email protected]>

* Makefile (MAKE_VERSION): 20150505
Expand Down
4 changes: 2 additions & 2 deletions contrib/bmake/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $Id: Makefile,v 1.38 2015/05/05 21:58:05 sjg Exp $
# $Id: Makefile,v 1.39 2015/06/07 15:54:37 sjg Exp $

# Base version on src date
MAKE_VERSION= 20150505
MAKE_VERSION= 20150606

PROG= bmake

Expand Down
20 changes: 15 additions & 5 deletions contrib/bmake/bmake.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $NetBSD: make.1,v 1.247 2015/04/10 08:43:32 wiz Exp $
.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
.Dd April 9, 2015
.Dd June 4, 2015
.Dt MAKE 1
.Os
.Sh NAME
Expand Down Expand Up @@ -993,14 +993,15 @@ This is especially useful with
.Ql Ev MAKEOBJDIR .
.Pp
.Ql Va .OBJDIR
may be modified in the makefile as a global variable.
may be modified in the makefile via the special target
.Ql Ic .OBJDIR .
In all cases,
.Nm
will
.Xr chdir 2
to
to the specified directory if it exists, and set
.Ql Va .OBJDIR
and set
and
.Ql Ev PWD
to that directory before executing any targets.
.
Expand Down Expand Up @@ -2001,6 +2002,15 @@ Disable parallel mode.
Synonym for
.Ic .NOTPARALLEL ,
for compatibility with other pmake variants.
.It Ic .OBJDIR
The source is a new value for
.Ql Va .OBJDIR .
If it exists,
.Nm
will
.Xr chdir 2
to it and update the value of
.Ql Va .OBJDIR .
.It Ic .ORDER
The named targets are made in sequence.
This ordering does not add targets to the list of targets to be made.
Expand Down
13 changes: 8 additions & 5 deletions contrib/bmake/bmake.cat1
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,10 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
may be used. This is especially useful with
`MAKEOBJDIR'.

`_._O_B_J_D_I_R' may be modified in the makefile as a global
variable. In all cases, bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R'
and set `PWD' to that directory before executing any tar-
gets.
`_._O_B_J_D_I_R' may be modified in the makefile via the special
target `..OOBBJJDDIIRR'. In all cases, bbmmaakkee will chdir(2) to
the specified directory if it exists, and set `_._O_B_J_D_I_R'
and `PWD' to that directory before executing any targets.

_._P_A_R_S_E_D_I_R A path to the directory of the current `_M_a_k_e_f_i_l_e' being
parsed.
Expand Down Expand Up @@ -1271,6 +1271,9 @@ SSPPEECCIIAALL TTAARRGGEETTSS
Synonym for ..NNOOTTPPAARRAALLLLEELL, for compatibility with other pmake
variants.

..OOBBJJDDIIRR The source is a new value for `_._O_B_J_D_I_R'. If it exists, bbmmaakkee
will chdir(2) to it and update the value of `_._O_B_J_D_I_R'.

..OORRDDEERR The named targets are made in sequence. This ordering does not
add targets to the list of targets to be made. Since the depen-
dents of a target do not get built until the target itself could
Expand Down Expand Up @@ -1449,4 +1452,4 @@ BBUUGGSS

There is no way of escaping a space character in a filename.

NetBSD 5.1 April 9, 2015 NetBSD 5.1
NetBSD 5.1 June 4, 2015 NetBSD 5.1
20 changes: 15 additions & 5 deletions contrib/bmake/make.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $NetBSD: make.1,v 1.247 2015/04/10 08:43:32 wiz Exp $
.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
.Dd April 9, 2015
.Dd June 4, 2015
.Dt MAKE 1
.Os
.Sh NAME
Expand Down Expand Up @@ -1004,14 +1004,15 @@ This is especially useful with
.Ql Ev MAKEOBJDIR .
.Pp
.Ql Va .OBJDIR
may be modified in the makefile as a global variable.
may be modified in the makefile via the special target
.Ql Ic .OBJDIR .
In all cases,
.Nm
will
.Xr chdir 2
to
to the specified directory if it exists, and set
.Ql Va .OBJDIR
and set
and
.Ql Ev PWD
to that directory before executing any targets.
.
Expand Down Expand Up @@ -2012,6 +2013,15 @@ Disable parallel mode.
Synonym for
.Ic .NOTPARALLEL ,
for compatibility with other pmake variants.
.It Ic .OBJDIR
The source is a new value for
.Ql Va .OBJDIR .
If it exists,
.Nm
will
.Xr chdir 2
to it and update the value of
.Ql Va .OBJDIR .
.It Ic .ORDER
The named targets are made in sequence.
This ordering does not add targets to the list of targets to be made.
Expand Down
26 changes: 26 additions & 0 deletions contrib/bmake/mk/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
2015-06-06 Simon J. Gerraty <[email protected]>

* install-mk (MK_VERSION): 20150606

* dirdeps.mk: don't rely on manually maintained Makefile.depend
to set DEP_RELDIR and reset DIRDEPS.
By setting DEP_RELDIR ourselves we can skip :tA

* gendirdeps.mk: skip setting DEP_RELDIR.

2015-05-24 Simon J. Gerraty <[email protected]>

* dirdeps.mk: avoid wildcards like make(bootstrap*)

2015-05-20 Simon J. Gerraty <[email protected]>

* install-mk (MK_VERSION): 20150520

* dirdeps.mk: when we are building dirdeps cache file we *want*
meta_oodate to look at all the Makefile.depend files, so
set .MAKE.DEPENDFILE to something that won't match.

* meta.stage.mk: for STAGE_AS_* basename of file may not be unique
so first use absolute path as key.
Also skip staging at level 0.

2015-04-30 Simon J. Gerraty <[email protected]>

* install-mk (MK_VERSION): 20150430
Expand Down
14 changes: 11 additions & 3 deletions contrib/bmake/mk/dirdeps.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: dirdeps.mk,v 1.51 2015/05/06 06:07:30 sjg Exp $
# $Id: dirdeps.mk,v 1.54 2015/06/08 20:55:11 sjg Exp $

# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
Expand Down Expand Up @@ -383,6 +383,7 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP
DIRDEPS="${DIRDEPS}" \
MAKEFLAGS= ${.MAKE} -C ${_CURDIR} -f ${BUILD_DIRDEPS_MAKEFILE} \
${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \
.MAKE.DEPENDFILE=.none \
3>&1 1>&2 | sed 's,${SRCTOP},$${SRCTOP},g' >> ${.TARGET}.new && \
mv ${.TARGET}.new ${.TARGET}

Expand Down Expand Up @@ -587,6 +588,11 @@ _qm := ${_m:C;(\.depend)$;\1.${d:E};:${M_dep_qual_fixes:ts:}}
_DEP_TARGET_SPEC := ${d:E}
# some makefiles may still look at this
_DEP_MACHINE := ${d:E:C/,.*//}
# set this "just in case"
# we can skip :tA since we computed the path above
DEP_RELDIR := ${_m:H:S,${SRCTOP}/,,}
# and reset this
DIRDEPS =
.if ${_debug_reldir} && ${_qm} != ${_m}
.info loading ${_m} for ${d:E}
.endif
Expand All @@ -602,13 +608,15 @@ _DEP_MACHINE := ${d:E:C/,.*//}
.elif ${.MAKE.LEVEL} > 42
.error You should have stopped recursing by now.
.else
_DEP_RELDIR := ${DEP_RELDIR}
# we are building something
DEP_RELDIR := ${RELDIR}
_DEP_RELDIR := ${RELDIR}
# pickup local dependencies
.-include <.depend>
.endif

# bootstrapping new dependencies made easy?
.if make(bootstrap*) && !target(bootstrap)
.if (make(bootstrap) || make(bootstrap-recurse)) && !target(bootstrap)

.if exists(${.CURDIR}/${.MAKE.DEPENDFILE:T})
# stop here
Expand Down
4 changes: 1 addition & 3 deletions contrib/bmake/mk/gendirdeps.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: gendirdeps.mk,v 1.26 2014/09/05 04:40:52 sjg Exp $
# $Id: gendirdeps.mk,v 1.27 2015/06/08 20:55:11 sjg Exp $

# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
Expand Down Expand Up @@ -311,7 +311,6 @@ CAT_DEPEND ?= .depend
# to output _{VAR} tokens which we will turn into proper ${VAR} references.
${_DEPENDFILE}: ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):?$m:}@} ${_this} ${META2DEPS}
@(echo '# Autogenerated - do NOT edit!'; echo; \
echo 'DEP_RELDIR := $${_PARSEDIR:S,$${SRCTOP}/,,}'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
${_include_src_dirdeps} \
Expand All @@ -332,7 +331,6 @@ all: ${_DEPENDFILE}

${_DEPENDFILE}: ${MAKEFILE} ${_this}
@(echo '# Autogenerated - do NOT edit!'; echo; \
echo 'DEP_RELDIR := $${_PARSEDIR:S,$${SRCTOP}/,,}'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
echo '.include <dirdeps.mk>'; \
Expand Down
4 changes: 2 additions & 2 deletions contrib/bmake/mk/install-mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Simon J. Gerraty <[email protected]>

# RCSid:
# $Id: install-mk,v 1.110 2015/05/01 06:37:49 sjg Exp $
# $Id: install-mk,v 1.112 2015/06/08 20:55:11 sjg Exp $
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
Expand All @@ -70,7 +70,7 @@
# [email protected]
#

MK_VERSION=20150430
MK_VERSION=20150606
OWNER=
GROUP=
MODE=444
Expand Down
6 changes: 4 additions & 2 deletions contrib/bmake/mk/meta.stage.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: meta.stage.mk,v 1.34 2014/11/20 22:40:08 sjg Exp $
# $Id: meta.stage.mk,v 1.35 2015/05/20 06:40:33 sjg Exp $
#
# @(#) Copyright (c) 2011, Simon J. Gerraty
#
Expand Down Expand Up @@ -218,7 +218,7 @@ STAGE_AS.$s ?= ${.ALLSRC:N.dirdep}

stage_as: stage_as.$s
stage_as.$s: .dirdep
@${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS.$s:@f@$f ${STAGE_AS_${f:T}:U${f:T}}@}
@${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS.$s:@f@$f ${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}}@}
@touch $@

.endfor
Expand All @@ -238,7 +238,9 @@ staging:
# generally we want staging to wait until everything else is done
STAGING_WAIT ?= .WAIT

.if ${.MAKE.LEVEL} > 0
all: ${STAGING_WAIT} staging
.endif

.if exists(${.PARSEDIR}/stage-install.sh) && !defined(STAGE_INSTALL)
# this will run install(1) and then followup with .dirdep files.
Expand Down
13 changes: 9 additions & 4 deletions contrib/bmake/mk/meta.sys.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: meta.sys.mk,v 1.20 2014/08/04 05:12:27 sjg Exp $
# $Id: meta.sys.mk,v 1.21 2015/06/01 22:43:49 sjg Exp $

#
# @(#) Copyright (c) 2010, Simon J. Gerraty
Expand Down Expand Up @@ -108,11 +108,16 @@ _metaError: .NOMETA .NOTMAIN
.if ${.MAKE.MODE:Mmeta*} != ""
MKDEP_MK = meta.autodep.mk

# if we think we are updating dependencies,
# then filemon had better be present
.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !exists(/dev/filemon)
.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no"
.if ${.MAKEFLAGS:Uno:M-k} != ""
# make this more obvious
.warning Setting UPDATE_DEPENDFILE=NO due to -k
UPDATE_DEPENDFILE= NO
.export UPDATE_DEPENDFILE
.elif !exists(/dev/filemon)
.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded.
.endif
.endif

.if ${.MAKE.LEVEL} == 0
# make sure dirdeps target exists and do it first
Expand Down
19 changes: 14 additions & 5 deletions contrib/bmake/mk/mkopt.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:
# $Id: mkopt.sh,v 1.8 2014/11/15 07:07:18 sjg Exp $
# $Id: mkopt.sh,v 1.10 2015/06/07 17:29:08 sjg Exp $
#
# @(#) Copyright (c) 2014, Simon J. Gerraty
#
Expand All @@ -19,9 +19,10 @@

# no need to be included more than once
_MKOPT_SH=:
_MKOPT_PREFIX=${_MKOPT_PREFIX:-MK_}

#
# _mk_opt OPT default
# _mk_opt default OPT
#
# Set MK_$OPT
#
Expand All @@ -35,7 +36,7 @@ _MKOPT_SH=:
#
_mk_opt() {
_d=$1
_mo=MK_$2 _wo=WITHOUT_$2 _wi=WITH_$2
_mo=${_MKOPT_PREFIX}$2 _wo=WITHOUT_$2 _wi=WITH_$2
eval "_mov=\$$_mo _wov=\$$_wo _wiv=\$$_wi"

case "$_wiv" in
Expand Down Expand Up @@ -63,15 +64,23 @@ _mk_opts() {
_d=no
for _o in "$@"
do
case "$_o" in
case "$_o" in
*/*) # option is dirname default comes from basename
eval "_d=\$${_MKOPT_PREFIX}${_o#*/}"
_o=${_o%/*}
;;
yes|no) _d=$_o; continue;;
esac
_mk_opt $_d $_o
done
}

# handle either options.mk style OPTIONS_DEFAULT_*
# or FreeBSD's new bsd.mkopt.mk style __DEFAULT_*_OPTIONS
_mk_opts_defaults() {
_mk_opts no $__DEFAULT_NO_OPTIONS yes $__DEFAULT_YES_OPTIONS
_mk_opts no $OPTIONS_DEFAULT_NO $__DEFAULT_NO_OPTIONS \
yes $OPTIONS_DEFAULT_YES $__DEFAULT_YES_OPTIONS \
$OPTIONS_DEFAULT_DEPENDENT $__DEFAULT_DEPENDENT_OPTIONS
}

case "/$0" in
Expand Down
6 changes: 3 additions & 3 deletions contrib/bmake/targ.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: targ.c,v 1.59 2014/09/07 20:55:34 joerg Exp $ */
/* $NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $ */

/*
* Copyright (c) 1988, 1989, 1990, 1993
Expand Down Expand Up @@ -69,14 +69,14 @@
*/

#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: targ.c,v 1.59 2014/09/07 20:55:34 joerg Exp $";
static char rcsid[] = "$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94";
#else
__RCSID("$NetBSD: targ.c,v 1.59 2014/09/07 20:55:34 joerg Exp $");
__RCSID("$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $");
#endif
#endif /* not lint */
#endif
Expand Down
Loading

0 comments on commit 128a410

Please sign in to comment.