Project

General

Profile

Submit #2606 » 0001-update-to-bmake-20131001.patch

kAworu, 11/22/2013 02:26 AM

View differences:

contrib/bmake/ChangeLog
2013-10-01 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20131001
Merge with NetBSD make, pick up
o main.c: for NATIVE build sysctl to get MACHINE_ARCH from
hw.machine_arch if necessary.
o meta.c: meta_oodate - need to look at src of Link and target
of Move as well.
* main.c: check that CTL_HW and HW_MACHINE_ARCH exist.
provide __arraycount() if needed.
2013-09-04 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130904
Merge with NetBSD make, pick up
o Add VAR_INTERNAL context, so that internal setting of
MAKEFILE does not override value set by makefiles.
2013-09-02 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130902
Merge with NetBSD make, pick up
o CompatRunCommand: only apply shellErrFlag when errCheck is true
2013-08-28 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130828
Merge with NetBSD make, pick up
o Fix VAR :sh = syntax from Will Andrews at freebsd.org
o Call Job_SetPrefix() from Job_Init() so makefiles have
opportunity to set .MAKE.JOB.PREFIX
2013-07-30 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130730
Merge with NetBSD make, pick up
o Allow suppression of --- job -- tokens by setting
.MAKE.JOB.PREFIX empty.
2013-07-16 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130716
Merge with NetBSD make, pick up
o number of gmake compatability tweaks
-w for gmake style entering/leaving messages
if .MAKE.LEVEL > 0 indicate it in progname "make[1]" etc.
handle MAKEFLAGS containing only letters.
o when overriding a GLOBAL variable on the command line,
delete it from GLOBAL context so -V doesn't show the wrong
value.
2013-07-06 Simon J. Gerraty <sjg@bad.crufty.net>
* configure.in: We don't need MAKE_LEVEL_SAFE anymore.
* Makefile (MAKE_VERSION): 20130706
Merge with NetBSD make, pick up
o Shell_Init(): export shellErrFlag if commandShell hasErrCtl is
true so that CompatRunCommand() can use it, to ensure
consistent behavior with jobs mode.
o use MAKE_LEVEL_ENV to define the variable to propagate
.MAKE.LEVEL - currently set to MAKELEVEL (same as gmake).
o meta.c: use .MAKE.META.IGNORE_PATHS to allow customization of
paths to ignore.
2013-06-04 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130604
Merge with NetBSD make, pick up
o job.c: JobCreatePipe: do fcntl() after any tweaking of fd's
to avoid leaking descriptors.
2013-05-28 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130528
Merge with NetBSD make, pick up
o var.c: cleanup some left-overs in VarHash()
2013-05-20 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130520
generate manifest from component FILES rather than have to
update FILES when mk/FILES changes.
2013-05-18 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130518
Merge with NetBSD make, pick up
o suff.c: don't skip all processsing for .PHONY targets
else wildcard srcs do not get expanded.
o var.c: expand name of variable to delete if necessary.
2013-03-30 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130330
Merge with NetBSD make, pick up
o meta.c: refine the handling of .OODATE in commands.
Rather than suppress command comparison for the entire script
as though .NOMETA_CMP had been used, only suppress it for the
one command line.
This allows something like ${.OODATE:M.NOMETA_CMP} to be used to
suppress comparison of a command without otherwise affecting it.
o make.1: document that
2013-03-22 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130321
yes, not quite right but its a cooler number.
Merge with NetBSD make, pick up
o parse.c: fix ParseGmakeExport to be portable
and add a unit-test.
* meta.c: call meta_init() before makefiles are read and if built
with filemon support set .MAKE.PATH_FILEMON to _PATH_FILEMON
this let's makefiles test for support.
Call meta_mode_init() to process .MAKE.MODE.
2013-03-13 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130305
Merge with NetBSD make, pick up
o run .STALE: target when a dependency from .depend is missing.
o job.c: add Job_RunTarget() for the above and .BEGIN
2013-03-03 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130303
Merge with NetBSD make, pick up
o main.c: set .MAKE.OS to utsname.sysname
o job.c: more checks for read and poll errors
o var.c: lose VarChangeCase() saves 4% time
2013-03-02 Simon J. Gerraty <sjg@bad.crufty.net>
* boot-strap: remove MAKEOBJDIRPREFIX from environment since we
want to use MAKEOBJDIR
2013-01-27 Simon J. Gerraty <sjg@bad.crufty.net>
* Merge with NetBSD make, pick up
o make.1: more info on how shell commands are handled.
o job.c,main.c: detect write errors to job pipes.
2013-01-25 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20130123
Merge with NetBSD make, pick up
o meta.c: if script uses .OODATE and meta_oodate() decides
rebuild is needed, .OODATE will be empty - set it to .ALLSRC.
o var.c: in debug output indicate which variabale modifiers
apply to.
o remove Check_Cwd logic the makefiles have been fixed.
2012-12-12 Simon J. Gerraty <sjg@bad.crufty.net>
* makefile.in: add a simple makefile for folk who insist on
./configure; make; make install
it just runs boot-strap
* include mk/* to accommodate the above
* boot-strap: re-work to accommodate the above
mksrc defaults to $Mydir/mk
allow op={configure,build,install,clean,all}
add options to facilitate install
* Makefile.config.in: just the bits set by configure
* Makefile: bump version to 20121212
abandon Makefile.in (NetBSD Makefile)
leverage mk/* instead
* configure.in: ensure srcdir is absolute
2012-11-11 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile.in (MAKE_VERSION): 20121111
fix generation of bmake.cat1
2012-11-09 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile.in (MAKE_VERSION): 20121109
Merge with NetBSD make, pick up
o make.c: MakeBuildChild: return 0 so search continues if a
.ORDER dependency is detected.
o unit-tests/order: test the above
2012-11-02 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile.in (MAKE_VERSION): 20121102
Merge with NetBSD make, pick up
o cond.c: allow cond_state[] to grow.
In meta mode with a very large tree, we can hit the limit
while processing dirdeps.
2012-10-25 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile.in: we need to use ${srcdir} not ${.CURDIR}
2012-10-10 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile.in (MAKE_VERSION): 20121010
contrib/bmake/FILES
FILES
ChangeLog
bmake.cat1
boot-strap
bsd.after-import.mk
os.sh
Makefile.in
FILES
Makefile
Makefile.config.in
PSD.doc/Makefile
PSD.doc/tutorial.ms
README
aclocal.m4
arch.c
bmake.1
bmake.cat1
boot-strap
bsd.after-import.mk
buf.c
buf.h
compat.c
cond.c
make-conf.h
make_malloc.c
make_malloc.h
config.h.in
configure
aclocal.m4
configure.in
dir.c
dir.h
dirname.c
find_lib.sh
for.c
getopt.c
......
install-sh
job.c
job.h
meta.c
meta.h
dirname.c
realpath.c
strlcpy.c
strlist.c
strlist.h
stresep.c
trace.c
trace.h
lst.h
lst.lib/Makefile
lst.lib/lstAppend.c
......
lst.lib/lstSucc.c
machine.sh
main.c
make-bootstrap.sh.in
make-conf.h
make.1
bmake.1
make.c
make.h
make-bootstrap.sh.in
make_malloc.c
make_malloc.h
makefile.in
meta.c
meta.h
missing/sys/cdefs.h
mkdeps.sh
nonints.h
os.sh
parse.c
pathnames.h
ranlib.h
realpath.c
setenv.c
sigcompat.c
sprite.h
str.c
stresep.c
strlcpy.c
strlist.c
strlist.h
suff.c
targ.c
util.c
var.c
wait.h
trace.c
trace.h
unit-tests/Makefile.in
unit-tests/comment
unit-tests/cond1
......
unit-tests/error
unit-tests/export
unit-tests/export-all
unit-tests/export-env
unit-tests/forloop
unit-tests/forsubst
unit-tests/hash
......
unit-tests/modorder
unit-tests/modts
unit-tests/modword
unit-tests/order
unit-tests/phony-end
unit-tests/posix
unit-tests/qequals
unit-tests/sunshcmd
unit-tests/sysv
unit-tests/ternary
unit-tests/test.exp
unit-tests/unexport
unit-tests/unexport-env
unit-tests/varcmd
util.c
var.c
wait.h
contrib/bmake/Makefile
# $Id: Makefile,v 1.21 2013/10/01 15:44:05 sjg Exp $
# Base version on src date
MAKE_VERSION= 20131001
PROG= bmake
SRCS= \
arch.c \
buf.c \
compat.c \
cond.c \
dir.c \
for.c \
hash.c \
job.c \
main.c \
make.c \
make_malloc.c \
meta.c \
parse.c \
str.c \
strlist.c \
suff.c \
targ.c \
trace.c \
util.c \
var.c
# from lst.lib/
SRCS+= \
lstAppend.c \
lstAtEnd.c \
lstAtFront.c \
lstClose.c \
lstConcat.c \
lstDatum.c \
lstDeQueue.c \
lstDestroy.c \
lstDupl.c \
lstEnQueue.c \
lstFind.c \
lstFindFrom.c \
lstFirst.c \
lstForEach.c \
lstForEachFrom.c \
lstInit.c \
lstInsert.c \
lstIsAtEnd.c \
lstIsEmpty.c \
lstLast.c \
lstMember.c \
lstNext.c \
lstOpen.c \
lstPrev.c \
lstRemove.c \
lstReplace.c \
lstSucc.c
# this file gets generated by configure
.-include "Makefile.config"
.if !empty(LIBOBJS)
SRCS+= ${LIBOBJS:T:.o=.c}
.endif
# just in case
prefix?= /usr
srcdir?= ${.CURDIR}
DEFAULT_SYS_PATH?= .../share/mk:${prefix}/share/mk
CPPFLAGS+= -DUSE_META
CFLAGS+= ${CPPFLAGS}
CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE
CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
# meta mode can be useful even without filemon
FILEMON_H ?= /usr/include/dev/filemon/filemon.h
.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
.endif
.PATH: ${srcdir}
.PATH: ${srcdir}/lst.lib
.if make(obj) || make(clean)
SUBDIR+= unit-tests
.endif
# start-delete1 for bsd.after-import.mk
# we skip a lot of this when building as part of FreeBSD etc.
# list of OS's which are derrived from BSD4.4
BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly
# we are...
OS!= uname -s
# are we 4.4BSD ?
isBSD44:=${BSD44_LIST:M${OS}}
.if ${isBSD44} == ""
MANTARGET= cat
INSTALL?=${srcdir}/install-sh
.if (${MACHINE} == "sun386")
# even I don't have one of these anymore :-)
CFLAGS+= -DPORTAR
.elif (${MACHINE} != "sunos")
SRCS+= sigcompat.c
CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
.endif
.else
MANTARGET?= man
.endif
# turn this on by default - ignored if we are root
WITH_INSTALL_AS_USER=
# supress with -DWITHOUT_*
OPTIONS_DEFAULT_YES+= \
AUTOCONF_MK \
INSTALL_MK \
PROG_LINK
OPTIONS_DEFAULT_NO+= \
PROG_VERSION
# process options now
.include <own.mk>
.if ${MK_PROG_VERSION} == "yes"
PROG_NAME= ${PROG}-${MAKE_VERSION}
.if ${MK_PROG_LINK} == "yes"
SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG}
.endif
.endif
EXTRACT_MAN=no
# end-delete1
MAN= ${PROG}.1
MAN1= ${MAN}
.if (${PROG} != "make")
CLEANFILES+= my.history
.if make(${MAN}) || !exists(${srcdir}/${MAN})
my.history: ${MAKEFILE}
@(echo ".Nm"; \
echo "is derived from NetBSD"; \
echo ".Xr make 1 ."; \
echo "It uses autoconf to facilitate portability to other platforms."; \
echo ".Pp") > $@
.NOPATH: ${MAN}
${MAN}: make.1 my.history
@echo making $@
@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
-e '/^.Sh HISTORY/rmy.history' \
-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@
all beforeinstall: ${MAN}
_mfromdir=.
.endif
.endif
MANTARGET?= cat
MANDEST?= ${MANDIR}/${MANTARGET}1
.if ${MANTARGET} == "cat"
_mfromdir=${srcdir}
.endif
.include <prog.mk>
CPPFLAGS+= -DMAKE_NATIVE -DHAVE_CONFIG_H
COPTS.var.c += -Wno-cast-qual
COPTS.job.c += -Wno-format-nonliteral
COPTS.parse.c += -Wno-format-nonliteral
COPTS.var.c += -Wno-format-nonliteral
# Force these
SHAREDIR= ${prefix}/share
BINDIR= ${prefix}/bin
MANDIR= ${SHAREDIR}/man
.if !exists(.depend)
${OBJS}: config.h
.endif
# make sure that MAKE_VERSION gets updated.
main.o: ${SRCS} ${MAKEFILE}
# start-delete2 for bsd.after-import.mk
.if ${MK_AUTOCONF_MK} == "yes"
.include <autoconf.mk>
.endif
SHARE_MK?=${SHAREDIR}/mk
MKSRC=${srcdir}/mk
INSTALL?=${srcdir}/install-sh
.if ${MK_INSTALL_MK} == "yes"
install: install-mk
.endif
beforeinstall:
test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR}
test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST}
install-mk:
.if exists(${MKSRC}/install-mk)
test -d ${DESTDIR}${SHARE_MK} || ${INSTALL} -m 775 -d ${DESTDIR}${SHARE_MK}
sh ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${SHARE_MK}
.else
@echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false
.endif
# end-delete2
# A simple unit-test driver to help catch regressions
accept test:
cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
contrib/bmake/Makefile.config.in
# things set by configure
prefix= @prefix@
srcdir= @srcdir@
CC?= @CC@
MACHINE= @machine@
MACHINE_ARCH= @machine_arch@
DEFAULT_SYS_PATH= @default_sys_path@
CPPFLAGS+= @CPPFLAGS@
CFLAGS+= ${CPPFLAGS} @DEFS@
LDFLAGS= @LDFLAGS@
LIBOBJS= @LIBOBJS@
LDADD= @LIBS@
USE_META= @use_meta@
FILEMON_H= @filemon_h@
contrib/bmake/Makefile.in
# $NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
# @(#)Makefile 5.2 (Berkeley) 12/28/90
# $Id: Makefile.in,v 1.174 2012/10/10 18:46:24 sjg Exp $
PROG= bmake
SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
make.c parse.c str.c suff.c targ.c trace.c var.c util.c
SRCS+= strlist.c
SRCS+= make_malloc.c
SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
SRCS += lstPrev.c
# you can use this Makefile if you have an earlier version of bmake.
prefix= @prefix@
srcdir= @srcdir@
CC?= @CC@
# Base version on src date
MAKE_VERSION= 20121010
MACHINE=@machine@
MACHINE_ARCH=@machine_arch@
DEFAULT_SYS_PATH = @default_sys_path@
CPPFLAGS+= @CPPFLAGS@
CFLAGS+= ${CPPFLAGS}
CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
CFLAGS+= -I. -I${srcdir} @DEFS@ ${XDEFS} -DMAKE_NATIVE
CFLAGS+= ${CFLAGS_${.TARGET:T}}
CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
LDFLAGS= @LDFLAGS@
LIBOBJS= @LIBOBJS@
LDADD= @LIBS@
.if !empty(LIBOBJS)
SRCS+= ${LIBOBJS:T:.o=.c}
.endif
USE_META = @use_meta@
.if ${USE_META} != "no"
SRCS+= meta.c
CPPFLAGS+= -DUSE_META
FILEMON_H ?= @filemon_h@
.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
.endif
.endif
.PATH: ${srcdir}
.PATH: ${srcdir}/lst.lib
OS!= uname -s
ARCH!= uname -p 2>/dev/null || uname -m
# list of OS's which are derrived from BSD4.4
isBSD44= NetBSD FreeBSD OpenBSD DragonFly
.if ${OS} == "NetBSD"
# Don't set these for anyone else since we don't know what the effect may be.
# On FreeBSD WARNS=2 sets a bunch of -W flags that make does not handle.
WFORMAT= 1
WARNS=4
.NOPATH: bmake.cat1
.if make(install) && exists(${DESTDIR}/usr/share/doc)
SUBDIR= PSD.doc
.endif
.endif
.if defined(.PARSEDIR)
# we cannot rely on anything but bmake to parse this correctly.
.if empty(isBSD44:M${OS})
MANTARGET=cat
INSTALL?=${srcdir}/install-sh
.if (${MACHINE} == "sun386")
# even I don't have one of these anymore :-)
CFLAGS+= -DPORTAR
.elif (${MACHINE} != "sunos")
SRCS+= sigcompat.c
CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
.endif
.endif
.if make(obj) || make(clean)
SUBDIR+= unit-tests
.endif
.endif
# many systems use gcc these days
CC_IS_GCC=@GCC@
.if ${CC_IS_GCC} == "yes"
# problem with gcc3
CFLAGS_var.o+= -Wno-cast-qual
.endif
CFLAGS_main.o+= "-D@force_machine@MACHINE=\"${MACHINE}\"" "-DMACHINE_ARCH=\"${MACHINE_ARCH}\""
EXTRACT_MAN=no
MAN=${PROG}.1
.if (${PROG} != "make")
my.history: ${MAKEFILE}
@(echo ".Nm"; \
echo "is derived from NetBSD"; \
echo ".Xr make 1 ."; \
echo "It uses autoconf to facilitate portability to other platforms."; \
echo ".Pp") > $@
${MAN}: make.1 my.history
@echo making ${PROG}.1
@sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
-e '/^.Sh HISTORY/rmy.history' \
-e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${.CURDIR}/make.1 > $@
.endif
.if !empty(isBSD44:M${OS})
.if "${OS}" != "NetBSD"
MAN1=${MAN}
.endif
MANTARGET?=man
.endif
MANTARGET?= cat
MANDEST?= ${MANDIR}/${MANTARGET}1
.if ${MANTARGET} == "cat"
_mfromdir=${srcdir}
.endif
.if exists(${srcdir}/../Makefile.inc)
.include "${srcdir}/../Makefile.inc"
.endif
.-include <bsd.prog.mk>
# sigh, FreeBSD at least includes bsd.subdir.mk via bsd.obj.mk
# so the inclusion below, results in complaints about re-defined
# targets. For NetBSD though we need to explicitly include it.
.if defined(.PARSEDIR)
.if defined(SUBDIR) && !target(${SUBDIR:[1]})
.-include <bsd.subdir.mk>
.endif
.endif
CPPFLAGS+= -DMAKE_NATIVE
COPTS.var.c += -Wno-cast-qual
COPTS.job.c += -Wno-format-nonliteral
COPTS.parse.c += -Wno-format-nonliteral
COPTS.var.c += -Wno-format-nonliteral
# Force these
BINDIR= ${prefix}/bin
MANDIR= ${prefix}/man
arch.o: config.h
# make sure that MAKE_VERSION gets updated.
main.o: ${SRCS} ${MAKEFILE}
MK?=${prefix}/share/mk
MKSRC?=@mksrc@
INSTALL?=${srcdir}/install-sh
beforeinstall:
test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR}
test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST}
# latest version of *.mk includes an installer.
# you should not need to set USE_OS
install-mk:
.if exists(${MKSRC}/install-mk)
test -d ${DESTDIR}${MK} || ${INSTALL} -m 775 -d ${DESTDIR}${MK}
${MKSRC}/install-mk -v -m 644 ${DESTDIR}${MK} ${USE_OS}
.else
@echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false
.endif
.ifdef TOOLDIR
# this is a native netbsd build,
# use libutil rather than the local emalloc etc.
CPPFLAGS+= -DUSE_EMALLOC
LDADD+=-lutil
DPADD+=${LIBUTIL}
.endif
# A simple unit-test driver to help catch regressions
accept test:
cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
contrib/bmake/bmake.1
.\" $NetBSD: make.1,v 1.209 2012/10/08 15:09:48 christos Exp $
.\" $NetBSD: make.1,v 1.222 2013/08/11 09:53:49 apb Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
......
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
.Dd October 8, 2012
.Dd August 11, 2013
.Dt MAKE 1
.Os
.Sh NAME
......
.Nd maintain program dependencies
.Sh SYNOPSIS
.Nm
.Op Fl BeikNnqrstWX
.Op Fl BeikNnqrstWwX
.Op Fl C Ar directory
.Op Fl D Ar variable
.Op Fl d Ar flags
......
option to print raw values of variables.
.It Ar v
Print debugging information about variable assignment.
.It Ar w
Print entering and leaving directory messages, pre and post processing.
.It Ar x
Run shell commands with
.Fl x
......
A
.Ql Ic \-
causes any non-zero exit status of the command line to be ignored.
.Pp
When
.Nm
is run in jobs mode with
.Fl j Ar max_jobs ,
the entire script for the target is fed to a
single instance of the shell.
.Pp
In compatibility (non-jobs) mode, each command is run in a separate process.
If the command contains any shell meta characters
.Pq Ql #=|^(){};&<>*?[]:$`\e\en
it will be passed to the shell, otherwise
.Nm
will attempt direct execution.
.Pp
Since
.Nm
will
.Xr chdir 2
to
.Ql Va .OBJDIR
before executing any targets, each child process
starts with that as its current working directory.
.Pp
Makefiles should be written so that the mode of
.Nm
operation does not change their behavior.
For example, any command which needs to use
.Dq cd
or
.Dq chdir ,
without side-effect should be put in parenthesis:
.Bd -literal -offset indent
avoid-chdir-side-effects:
@echo Building $@ in `pwd`
@(cd ${.CURDIR} && ${.MAKE} $@)
@echo Back in `pwd`
ensure-one-shell-regardless-of-mode:
@echo Building $@ in `pwd`; \\
(cd ${.CURDIR} && ${.MAKE} $@); \\
echo Back in `pwd`
.Ed
.Sh VARIABLE ASSIGNMENTS
Variables in make are much like variables in the shell, and, by tradition,
consist of all upper-case letters.
......
.Ql --- target ---
the first part of which can be controlled via
.Va .MAKE.JOB.PREFIX .
If
.Va .MAKE.JOB.PREFIX
is empty, no token is printed.
.br
For example:
.Li .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
......
used (updated or not).
This list can be used to process the meta files to extract dependency
information.
.It Va .MAKE.META.IGNORE_PATHS
Provides a list of path prefixes that should be ignored;
because the contents are expected to change over time.
The default list includes:
.Ql Pa /dev /etc /proc /tmp /var/run /var/tmp
.It Va .MAKE.META.PREFIX
Defines the message printed for each meta file updated in "meta verbose" mode.
The default value is:
......
is re-exported whenever
.Ql Va .MAKEOVERRIDES
is modified.
.It Va .MAKE.PATH_FILEMON
If
.Nm
was built with
.Xr filemon 4
support, this is set to the path of the device node.
This allows makefiles to test for this support.
.It Va .MAKE.PID
The process-id of
.Nm .
......
For example.
.Dl ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
.Pp
However a single character varaiable is often more readable:
However a single character variable is often more readable:
.Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}
.It Cm \&:U Ns Ar newval
If the variable is undefined
......
is the value.
If no such node exists or its path is null, then the
name of the variable is used.
In order for this modifier to work, the name (node) must at least have
In order for this modifier to work, the name (node) must at least have
appeared on the rhs of a dependency.
.Sm off
.It Cm \&:\&! Ar cmd Cm \&!
......
Ignore differences in commands when deciding if target is out of date.
This is useful if the command contains a value which always changes.
If the number of commands change, though, the target will still be out of date.
The same effect applies to any command line that uses the variable
.Va .OODATE ,
which can be used for that purpose even when not otherwise needed or desired:
.Bd -literal -offset indent
skip-compare-for-some:
@echo this will be compared
@echo this will not ${.OODATE:M.NOMETA_CMP}
@echo this will also be compared
.Ed
The
.Cm \&:M
pattern suppresses any expansion of the unwanted variable.
.It Ic .NOPATH
Do not search for the target in the directories specified by
.Ic .PATH .
......
.Ic .DOTLAST
target, then the current working
directory is searched last.
.It Ic .PATH. Ns Va suffix
Like
.Ic .PATH
but applies only to files with a particular suffix.
The suffix must have been previously declared with
.Ic .SUFFIXES .
.It Ic .PHONY
Apply the
.Ic .PHONY
......
.Ic .SILENT
attribute is applied to every
command in the file.
.It Ic .STALE
This target gets run when a dependency file contains stale entries, having
.Va .ALLSRC
set to the name of that dependency file.
.It Ic .SUFFIXES
Each source specifies a suffix to
.Nm .
......
so that they still appear to be variable expansions.
In particular this stops them being treated as syntax, and removes some
obscure problems using them in .if statements.
.Pp
Unlike other
.Nm
programs, this implementation by default executes all commands for a given
target using a single shell invocation.
This is done for both efficiency and to simplify error handling in remote
command invocations.
Typically this is transparent to the user, unless the target commands change
the current working directory using
.Dq cd
or
.Dq chdir .
To be compatible with Makefiles that do this, one can use
.Fl B
to disable this behavior.
.Pp
In compatibility mode, each command is run in a separate process.
If the command contains any shell meta characters
.Pq Ql #=|^(){};&<>*?[]:$`\e\en
it will be passed to the shell, otherwise
.Nm
will attempt direct execution.
.Sh SEE ALSO
.Xr mkdep 1
.Sh HISTORY
......
It was designed to be a parallel distributed make running jobs on different
machines using a daemon called
.Dq customs .
.Pp
Historically the target/dependency
.Dq FRC
has been used to FoRCe rebuilding (since the target/dependency
does not exist... unless someone creates an
.Dq FRC
file).
.Sh BUGS
The
make
contrib/bmake/bmake.cat1
bbmmaakkee -- maintain program dependencies
SSYYNNOOPPSSIISS
bbmmaakkee [--BBeeiikkNNnnqqrrssttWWXX] [--CC _d_i_r_e_c_t_o_r_y] [--DD _v_a_r_i_a_b_l_e] [--dd _f_l_a_g_s]
bbmmaakkee [--BBeeiikkNNnnqqrrssttWWwwXX] [--CC _d_i_r_e_c_t_o_r_y] [--DD _v_a_r_i_a_b_l_e] [--dd _f_l_a_g_s]
[--ff _m_a_k_e_f_i_l_e] [--II _d_i_r_e_c_t_o_r_y] [--JJ _p_r_i_v_a_t_e] [--jj _m_a_x___j_o_b_s]
[--mm _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--VV _v_a_r_i_a_b_l_e] [_v_a_r_i_a_b_l_e_=_v_a_l_u_e]
[_t_a_r_g_e_t _._._.]
......
_v Print debugging information about variable assignment.
_x Run shell commands with --xx so the actual commands are
printed as they are executed.
--ee Specify that environment variables override macro assignments
within makefiles.
--ff _m_a_k_e_f_i_l_e
Specify a makefile to read instead of the default `_m_a_k_e_f_i_l_e'. If
_m_a_k_e_f_i_l_e is `--', standard input is read. Multiple makefiles may
be specified, and are read in the order specified.
--II _d_i_r_e_c_t_o_r_y
Specify a directory in which to search for makefiles and included
makefiles. The system makefile directory (or directories, see
the --mm option) is automatically included as part of this list.
--ii Ignore non-zero exit of shell commands in the makefile. Equiva-
lent to specifying `--' before each command line in the makefile.
--JJ _p_r_i_v_a_t_e
This option should _n_o_t be specified by the user.
When the _j option is in use in a recursive build, this option is
passed by a make to child makes to allow all the make processes
in the build to cooperate to avoid overloading the system.
--jj _m_a_x___j_o_b_s
Specify the maximum number of jobs that bbmmaakkee may have running at
any one time. The value is saved in _._M_A_K_E_._J_O_B_S. Turns compati-
bility mode off, unless the _B flag is also specified. When com-
patibility mode is off, all commands associated with a target are
executed in a single shell invocation as opposed to the tradi-
tional one shell invocation per line. This can break traditional
scripts which change directories on each command invocation and
then expect to start with a fresh environment on the next line.
It is more efficient to correct the scripts rather than turn
backwards compatibility on.
--kk Continue processing after errors are encountered, but only on
those targets that do not depend on the target whose creation
caused the error.
--mm _d_i_r_e_c_t_o_r_y
Specify a directory in which to search for sys.mk and makefiles
included via the <_f_i_l_e>-style include statement. The --mm option
can be used multiple times to form a search path. This path will
override the default system include path: /usr/share/mk. Fur-
thermore the system include path will be appended to the search
path used for "_f_i_l_e"-style include statements (see the --II
option).
If a file or directory name in the --mm argument (or the
MAKESYSPATH environment variable) starts with the string ".../"
then bbmmaakkee will search for the specified file or directory named
in the remaining part of the argument string. The search starts
with the current directory of the Makefile and then works upward
towards the root of the filesystem. If the search is successful,
then the resulting directory replaces the ".../" specification in
the --mm argument. If used, this feature allows bbmmaakkee to easily
search in the current source tree for customized sys.mk files
(e.g., by using ".../mk/sys.mk" as an argument).
--nn Display the commands that would have been executed, but do not
actually execute them unless the target depends on the .MAKE spe-
cial source (see below).
--NN Display the commands which would have been executed, but do not
actually execute any of them; useful for debugging top-level
makefiles without descending into subdirectories.
--qq Do not execute any commands, but exit 0 if the specified targets
are up-to-date and 1, otherwise.
--rr Do not use the built-in rules specified in the system makefile.
--ss Do not echo any commands as they are executed. Equivalent to
specifying `@@' before each command line in the makefile.
--TT _t_r_a_c_e_f_i_l_e
When used with the --jj flag, append a trace record to _t_r_a_c_e_f_i_l_e
for each job started and completed.
--tt Rather than re-building a target as specified in the makefile,
create it or update its modification time to make it appear up-
to-date.
--VV _v_a_r_i_a_b_l_e
Print bbmmaakkee's idea of the value of _v_a_r_i_a_b_l_e, in the global con-
text. Do not build any targets. Multiple instances of this
option may be specified; the variables will be printed one per
line, with a blank line for each null or undefined variable. If
_v_a_r_i_a_b_l_e contains a `$' then the value will be expanded before
printing.
--WW Treat any warnings during makefile parsing as errors.
--XX Don't export variables passed on the command line to the environ-
ment individually. Variables passed on the command line are
still exported via the _M_A_K_E_F_L_A_G_S environment variable. This
option may be useful on systems which have a small limit on the
size of command arguments.
_v_a_r_i_a_b_l_e_=_v_a_l_u_e
Set the value of the variable _v_a_r_i_a_b_l_e to _v_a_l_u_e. Normally, all
values passed on the command line are also exported to sub-makes
in the environment. The --XX flag disables this behavior. Vari-
able assignments should follow options for POSIX compatibility
but no ordering is enforced.
There are seven different types of lines in a makefile: file dependency
specifications, shell commands, variable assignments, include statements,
conditional directives, for loops, and comments.
In general, lines may be continued from one line to the next by ending
them with a backslash (`\'). The trailing newline character and initial
whitespace on the following line are compressed into a single space.
FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEECCIIFFIICCAATTIIOONNSS
Dependency lines consist of one or more targets, an operator, and zero or
more sources. This creates a relationship where the targets ``depend''
on the sources and are usually created from them. The exact relationship
between the target and the source is determined by the operator that sep-
arates them. The three operators are as follows:
:: A target is considered out-of-date if its modification time is less
than those of any of its sources. Sources for a target accumulate
over dependency lines when this operator is used. The target is
removed if bbmmaakkee is interrupted.
!! Targets are always re-created, but not until all sources have been
examined and re-created as necessary. Sources for a target accumu-
late over dependency lines when this operator is used. The target
is removed if bbmmaakkee is interrupted.
:::: If no sources are specified, the target is always re-created. Oth-
erwise, a target is considered out-of-date if any of its sources
has been modified more recently than the target. Sources for a
target do not accumulate over dependency lines when this operator
is used. The target will not be removed if bbmmaakkee is interrupted.
Targets and sources may contain the shell wildcard values `?', `*', `[]',
and `{}'. The values `?', `*', and `[]' may only be used as part of the
final component of the target or source, and must be used to describe
existing files. The value `{}' need not necessarily be used to describe
existing files. Expansion is in directory order, not alphabetically as
done in the shell.
SSHHEELLLL CCOOMMMMAANNDDSS
Each target may have associated with it a series of shell commands, nor-
mally used to create the target. Each of the commands in this script
_m_u_s_t be preceded by a tab. While any target may appear on a dependency
line, only one of these dependencies may be followed by a creation
script, unless the `::::' operator is used.
If the first characters of the command line are any combination of `@@',
`++', or `--', the command is treated specially. A `@@' causes the command
not to be echoed before it is executed. A `++' causes the command to be
executed even when --nn is given. This is similar to the effect of the
.MAKE special source, except that the effect can be limited to a single
line of a script. A `--' causes any non-zero exit status of the command
line to be ignored.
VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
Variables in make are much like variables in the shell, and, by tradi-
tion, consist of all upper-case letters.
VVaarriiaabbllee aassssiiggnnmmeenntt mmooddiiffiieerrss
The five operators that can be used to assign values to variables are as
follows:
== Assign the value to the variable. Any previous value is overrid-
den.
++== Append the value to the current value of the variable.
??== Assign the value to the variable if it is not already defined.
::== Assign with expansion, i.e. expand the value before assigning it
to the variable. Normally, expansion is not done until the vari-
able is referenced. _N_O_T_E: References to undefined variables are
_n_o_t expanded. This can cause problems when variable modifiers
are used.
!!== Expand the value and pass it to the shell for execution and
assign the result to the variable. Any newlines in the result
are replaced with spaces.
Any white-space before the assigned _v_a_l_u_e is removed; if the value is
being appended, a single space is inserted between the previous contents
of the variable and the appended value.
Variables are expanded by surrounding the variable name with either curly
braces (`{}') or parentheses (`()') and preceding it with a dollar sign
(`$'). If the variable name contains only a single letter, the surround-
ing braces or parentheses are not required. This shorter form is not
recommended.
If the variable name contains a dollar, then the name itself is expanded
first. This allows almost arbitrary variable names, however names con-
taining dollar, braces, parenthesis, or whitespace are really best
avoided!
If the result of expanding a variable contains a dollar sign (`$') the
string is expanded again.
Variable substitution occurs at three distinct times, depending on where
the variable is being used.
1. Variables in dependency lines are expanded as the line is read.
2. Variables in shell commands are expanded when the shell command is
executed.
3. ``.for'' loop index variables are expanded on each loop iteration.
Note that other variables are not expanded inside loops so the fol-
lowing example code:
.for i in 1 2 3
a+= ${i}
j= ${i}
b+= ${j}
.endfor
all:
@echo ${a}
@echo ${b}
will print:
1 2 3
3 3 3
Because while ${a} contains ``1 2 3'' after the loop is executed,
${b} contains ``${j} ${j} ${j}'' which expands to ``3 3 3'' since
after the loop completes ${j} contains ``3''.
VVaarriiaabbllee ccllaasssseess
The four different classes of variables (in order of increasing prece-
dence) are:
Environment variables
Variables defined as part of bbmmaakkee's environment.
Global variables
Variables defined in the makefile or in included makefiles.
Command line variables
Variables defined as part of the command line.
Local variables
Variables that are defined specific to a certain target. The
seven local variables are as follows:
_._A_L_L_S_R_C The list of all sources for this target; also known as
`_>'.
_._A_R_C_H_I_V_E The name of the archive file.
_._I_M_P_S_R_C In suffix-transformation rules, the name/path of the
source from which the target is to be transformed (the
``implied'' source); also known as `_<'. It is not
defined in explicit rules.
_._M_E_M_B_E_R The name of the archive member.
_._O_O_D_A_T_E The list of sources for this target that were deemed
out-of-date; also known as `_?'.
_._P_R_E_F_I_X The file prefix of the target, containing only the file
portion, no suffix or preceding directory components;
also known as `_*'.
_._T_A_R_G_E_T The name of the target; also known as `_@'.
The shorter forms `_@', `_?', `_<', `_>', and `_*' are permitted for
backward compatibility with historical makefiles and are not rec-
ommended. The six variables `_@_F', `_@_D', `_<_F', `_<_D', `_*_F', and
`_*_D' are permitted for compatibility with AT&T System V UNIX
makefiles and are not recommended.
Four of the local variables may be used in sources on dependency
lines because they expand to the proper value for each target on
the line. These variables are `_._T_A_R_G_E_T', `_._P_R_E_F_I_X', `_._A_R_C_H_I_V_E',
and `_._M_E_M_B_E_R'.
AAddddiittiioonnaall bbuuiilltt--iinn vvaarriiaabblleess
In addition, bbmmaakkee sets or knows about the following variables:
_$ A single dollar sign `$', i.e. `$$' expands to a single
dollar sign.
_._A_L_L_T_A_R_G_E_T_S The list of all targets encountered in the Makefile. If
evaluated during Makefile parsing, lists only those tar-
gets encountered thus far.
_._C_U_R_D_I_R A path to the directory where bbmmaakkee was executed. Refer
to the description of `PWD' for more details.
MAKE The name that bbmmaakkee was executed with (_a_r_g_v_[_0_]). For
compatibility bbmmaakkee also sets _._M_A_K_E with the same value.
The preferred variable to use is the environment variable
MAKE because it is more compatible with other versions of
bbmmaakkee and cannot be confused with the special target with
the same name.
_._M_A_K_E_._D_E_P_E_N_D_F_I_L_E
Names the makefile (default `_._d_e_p_e_n_d') from which gener-
ated dependencies are read.
_._M_A_K_E_._E_X_P_A_N_D___V_A_R_I_A_B_L_E_S
A boolean that controls the default behavior of the --VV
option.
_._M_A_K_E_._E_X_P_O_R_T_E_D The list of variables exported by bbmmaakkee.
_._M_A_K_E_._J_O_B_S The argument to the --jj option.
_._M_A_K_E_._J_O_B_._P_R_E_F_I_X
If bbmmaakkee is run with _j then output for each target is
... This diff was truncated because it exceeds the maximum size that can be displayed.
(3-3/12)