Sync with upstream version (20130520) that includes same fixes made last week.
This commit is contained in:
commit
52d8625616
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250837
@ -1,3 +1,17 @@
|
|||||||
|
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>
|
2013-03-30 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||||
|
|
||||||
* Makefile (MAKE_VERSION): 20130330
|
* Makefile (MAKE_VERSION): 20130330
|
||||||
|
@ -1,29 +1,26 @@
|
|||||||
FILES
|
|
||||||
ChangeLog
|
ChangeLog
|
||||||
bmake.cat1
|
FILES
|
||||||
boot-strap
|
|
||||||
bsd.after-import.mk
|
|
||||||
os.sh
|
|
||||||
makefile.in
|
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.config.in
|
Makefile.config.in
|
||||||
PSD.doc/Makefile
|
PSD.doc/Makefile
|
||||||
PSD.doc/tutorial.ms
|
PSD.doc/tutorial.ms
|
||||||
README
|
README
|
||||||
|
aclocal.m4
|
||||||
arch.c
|
arch.c
|
||||||
|
bmake.1
|
||||||
|
bmake.cat1
|
||||||
|
boot-strap
|
||||||
|
bsd.after-import.mk
|
||||||
buf.c
|
buf.c
|
||||||
buf.h
|
buf.h
|
||||||
compat.c
|
compat.c
|
||||||
cond.c
|
cond.c
|
||||||
make-conf.h
|
|
||||||
make_malloc.c
|
|
||||||
make_malloc.h
|
|
||||||
config.h.in
|
config.h.in
|
||||||
configure
|
configure
|
||||||
aclocal.m4
|
|
||||||
configure.in
|
configure.in
|
||||||
dir.c
|
dir.c
|
||||||
dir.h
|
dir.h
|
||||||
|
dirname.c
|
||||||
find_lib.sh
|
find_lib.sh
|
||||||
for.c
|
for.c
|
||||||
getopt.c
|
getopt.c
|
||||||
@ -32,16 +29,6 @@ hash.h
|
|||||||
install-sh
|
install-sh
|
||||||
job.c
|
job.c
|
||||||
job.h
|
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.h
|
||||||
lst.lib/Makefile
|
lst.lib/Makefile
|
||||||
lst.lib/lstAppend.c
|
lst.lib/lstAppend.c
|
||||||
@ -74,26 +61,36 @@ lst.lib/lstReplace.c
|
|||||||
lst.lib/lstSucc.c
|
lst.lib/lstSucc.c
|
||||||
machine.sh
|
machine.sh
|
||||||
main.c
|
main.c
|
||||||
|
make-bootstrap.sh.in
|
||||||
|
make-conf.h
|
||||||
make.1
|
make.1
|
||||||
bmake.1
|
|
||||||
make.c
|
make.c
|
||||||
make.h
|
make.h
|
||||||
make-bootstrap.sh.in
|
make_malloc.c
|
||||||
|
make_malloc.h
|
||||||
|
makefile.in
|
||||||
|
meta.c
|
||||||
|
meta.h
|
||||||
missing/sys/cdefs.h
|
missing/sys/cdefs.h
|
||||||
mkdeps.sh
|
mkdeps.sh
|
||||||
nonints.h
|
nonints.h
|
||||||
|
os.sh
|
||||||
parse.c
|
parse.c
|
||||||
pathnames.h
|
pathnames.h
|
||||||
ranlib.h
|
ranlib.h
|
||||||
|
realpath.c
|
||||||
setenv.c
|
setenv.c
|
||||||
sigcompat.c
|
sigcompat.c
|
||||||
sprite.h
|
sprite.h
|
||||||
str.c
|
str.c
|
||||||
|
stresep.c
|
||||||
|
strlcpy.c
|
||||||
|
strlist.c
|
||||||
|
strlist.h
|
||||||
suff.c
|
suff.c
|
||||||
targ.c
|
targ.c
|
||||||
util.c
|
trace.c
|
||||||
var.c
|
trace.h
|
||||||
wait.h
|
|
||||||
unit-tests/Makefile.in
|
unit-tests/Makefile.in
|
||||||
unit-tests/comment
|
unit-tests/comment
|
||||||
unit-tests/cond1
|
unit-tests/cond1
|
||||||
@ -123,63 +120,6 @@ unit-tests/test.exp
|
|||||||
unit-tests/unexport
|
unit-tests/unexport
|
||||||
unit-tests/unexport-env
|
unit-tests/unexport-env
|
||||||
unit-tests/varcmd
|
unit-tests/varcmd
|
||||||
mk/ChangeLog
|
util.c
|
||||||
mk/FILES
|
var.c
|
||||||
mk/README
|
wait.h
|
||||||
mk/auto.obj.mk
|
|
||||||
mk/autoconf.mk
|
|
||||||
mk/autodep.mk
|
|
||||||
mk/auto.dep.mk
|
|
||||||
mk/dep.mk
|
|
||||||
mk/doc.mk
|
|
||||||
mk/dpadd.mk
|
|
||||||
mk/final.mk
|
|
||||||
mk/host-target.mk
|
|
||||||
mk/host.libnames.mk
|
|
||||||
mk/inc.mk
|
|
||||||
mk/init.mk
|
|
||||||
mk/install-mk
|
|
||||||
mk/java.mk
|
|
||||||
mk/lib.mk
|
|
||||||
mk/libnames.mk
|
|
||||||
mk/libs.mk
|
|
||||||
mk/links.mk
|
|
||||||
mk/man.mk
|
|
||||||
mk/mk-files.txt
|
|
||||||
mk/nls.mk
|
|
||||||
mk/obj.mk
|
|
||||||
mk/options.mk
|
|
||||||
mk/own.mk
|
|
||||||
mk/prlist.mk
|
|
||||||
mk/prog.mk
|
|
||||||
mk/progs.mk
|
|
||||||
mk/rst2htm.mk
|
|
||||||
mk/scripts.mk
|
|
||||||
mk/srctop.mk
|
|
||||||
mk/subdir.mk
|
|
||||||
mk/sys.mk
|
|
||||||
mk/sys.clean-env.mk
|
|
||||||
mk/sys.dependfile.mk
|
|
||||||
mk/sys/AIX.mk
|
|
||||||
mk/sys/Darwin.mk
|
|
||||||
mk/sys/Generic.mk
|
|
||||||
mk/sys/HP-UX.mk
|
|
||||||
mk/sys/IRIX.mk
|
|
||||||
mk/sys/Linux.mk
|
|
||||||
mk/sys/NetBSD.mk
|
|
||||||
mk/sys/OSF1.mk
|
|
||||||
mk/sys/OpenBSD.mk
|
|
||||||
mk/sys/SunOS.mk
|
|
||||||
mk/sys/UnixWare.mk
|
|
||||||
mk/target-flags.mk
|
|
||||||
mk/warnings.mk
|
|
||||||
mk/yacc.mk
|
|
||||||
mk/dirdeps.mk
|
|
||||||
mk/gendirdeps.mk
|
|
||||||
mk/install-new.mk
|
|
||||||
mk/meta2deps.py
|
|
||||||
mk/meta2deps.sh
|
|
||||||
mk/meta.sys.mk
|
|
||||||
mk/meta.autodep.mk
|
|
||||||
mk/meta.stage.mk
|
|
||||||
mk/meta.subdir.mk
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# $Id: Makefile,v 1.10 2013/03/31 05:57:19 sjg Exp $
|
# $Id: Makefile,v 1.12 2013/05/20 16:05:10 sjg Exp $
|
||||||
|
|
||||||
# Base version on src date
|
# Base version on src date
|
||||||
MAKE_VERSION= 20130330
|
MAKE_VERSION= 20130520
|
||||||
|
|
||||||
PROG= bmake
|
PROG= bmake
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: meta.c,v 1.29 2013/03/31 05:49:51 sjg Exp $ */
|
/* $NetBSD: meta.c,v 1.30 2013/05/16 21:56:56 sjg Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implement 'meta' mode.
|
* Implement 'meta' mode.
|
||||||
@ -543,7 +543,7 @@ boolValue(char *s)
|
|||||||
* Initialization we need before reading makefiles.
|
* Initialization we need before reading makefiles.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_init()
|
meta_init(void)
|
||||||
{
|
{
|
||||||
#ifdef USE_FILEMON
|
#ifdef USE_FILEMON
|
||||||
/* this allows makefiles to test if we have filemon support */
|
/* this allows makefiles to test if we have filemon support */
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
|
2013-05-10 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||||
|
|
||||||
|
* install-mk (MK_VERSION): 20130505
|
||||||
|
* gendirdeps.mk, meta2deps.py, meta2deps.sh: handle $TARGET_SPEC
|
||||||
|
for when $MACHINE isn't enough for objdir distinction.
|
||||||
|
Bring meta2deps.sh closer to par with meta2deps.py.
|
||||||
|
|
||||||
|
2013-04-18 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||||
|
|
||||||
|
* meta.stage.mk: set INSTALL to STAGE_INSTALL when making 'all'
|
||||||
|
also if the target 'beforeinstall' exists, make it depend on
|
||||||
|
.dirdep (incase it uses STAGE_INSTALL).
|
||||||
|
|
||||||
|
2013-04-17 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||||
|
|
||||||
|
* install-mk (MK_VERSION): 20130401 ;-)
|
||||||
|
* meta.stage.mk (STAGE_INSTALL_SH): add stage-install.sh as
|
||||||
|
wrapper around install(1).
|
||||||
|
* options.mk (OPTION_PREFIX): Allow a prefix other than MK_
|
||||||
|
|
||||||
2013-03-30 Simon J. Gerraty <sjg@bad.crufty.net>
|
2013-03-30 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||||
|
|
||||||
* meta2deps.py (MetaFile.__init__): ensure self.cwd is initialized.
|
* meta2deps.py (MetaFile.__init__): ensure self.cwd is initialized.
|
||||||
|
@ -31,6 +31,7 @@ progs.mk
|
|||||||
rst2htm.mk
|
rst2htm.mk
|
||||||
scripts.mk
|
scripts.mk
|
||||||
srctop.mk
|
srctop.mk
|
||||||
|
stage-install.sh
|
||||||
subdir.mk
|
subdir.mk
|
||||||
sys.mk
|
sys.mk
|
||||||
sys.clean-env.mk
|
sys.clean-env.mk
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: gendirdeps.mk,v 1.21 2013/03/28 20:01:05 sjg Exp $
|
# $Id: gendirdeps.mk,v 1.22 2013/05/11 05:16:26 sjg Exp $
|
||||||
|
|
||||||
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
@ -111,13 +111,24 @@ _py_d =
|
|||||||
.if ${META2DEPS:E} == "py"
|
.if ${META2DEPS:E} == "py"
|
||||||
# we can afford to do this all the time.
|
# we can afford to do this all the time.
|
||||||
DPDEPS ?= no
|
DPDEPS ?= no
|
||||||
META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} \
|
META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d}
|
||||||
-R ${RELDIR} -H ${HOST_TARGET} \
|
|
||||||
${M2D_OBJROOTS:O:u:@o@-O $o@}
|
|
||||||
|
|
||||||
.if ${DPDEPS:tl} != "no"
|
.if ${DPDEPS:tl} != "no"
|
||||||
META2DEPS_CMD += -D ${DPDEPS}
|
META2DEPS_CMD += -D ${DPDEPS}
|
||||||
.endif
|
.endif
|
||||||
|
META2DEPS_FILTER = sed 's,^src:,${SRCTOP}/,;s,^\([^/]\),${OBJTOP}/\1,' |
|
||||||
|
.elif ${META2DEPS:E} == "sh"
|
||||||
|
META2DEPS_CMD = ${_time} ${_sh_x} ${META2DEPS} OBJTOP=${_OBJTOP}
|
||||||
|
.else
|
||||||
|
META2DEPS_CMD ?= ${META2DEPS}
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.if ${TARGET_OBJ_SPEC:U${MACHINE}} != ${MACHINE}
|
||||||
|
META2DEPS_CMD += -T ${TARGET_OBJ_SPEC}
|
||||||
|
.endif
|
||||||
|
META2DEPS_CMD += \
|
||||||
|
-R ${RELDIR} -H ${HOST_TARGET} \
|
||||||
|
${M2D_OBJROOTS:O:u:@o@-O $o@}
|
||||||
|
|
||||||
|
|
||||||
M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot}
|
M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot}
|
||||||
.if defined(SB_OBJROOT)
|
.if defined(SB_OBJROOT)
|
||||||
@ -133,13 +144,6 @@ META2DEPS_ARGS += MACHINE=none
|
|||||||
META2DEPS_CMD += -S ${SB_BACKING_SB}/src
|
META2DEPS_CMD += -S ${SB_BACKING_SB}/src
|
||||||
M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OBJPREFIX}
|
M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OBJPREFIX}
|
||||||
.endif
|
.endif
|
||||||
META2DEPS_FILTER = sed 's,^src:,${SRCTOP}/,;s,^\([^/]\),${OBJTOP}/\1,' |
|
|
||||||
.elif ${META2DEPS:E} == "sh"
|
|
||||||
META2DEPS_CMD = ${_time} ${_sh_x} ${META2DEPS} \
|
|
||||||
OBJTOP=${_objtop} SB_OBJROOT=${_objroot}
|
|
||||||
.else
|
|
||||||
META2DEPS_CMD ?= ${META2DEPS}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
# we are only interested in the dirs
|
# we are only interested in the dirs
|
||||||
# sepecifically those we read something from.
|
# sepecifically those we read something from.
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
# Simon J. Gerraty <sjg@crufty.net>
|
# Simon J. Gerraty <sjg@crufty.net>
|
||||||
|
|
||||||
# RCSid:
|
# RCSid:
|
||||||
# $Id: install-mk,v 1.88 2013/03/31 22:31:59 sjg Exp $
|
# $Id: install-mk,v 1.90 2013/05/11 05:16:26 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 1994 Simon J. Gerraty
|
# @(#) Copyright (c) 1994 Simon J. Gerraty
|
||||||
#
|
#
|
||||||
@ -70,7 +70,7 @@
|
|||||||
# sjg@crufty.net
|
# sjg@crufty.net
|
||||||
#
|
#
|
||||||
|
|
||||||
MK_VERSION=20130330
|
MK_VERSION=20130505
|
||||||
OWNER=
|
OWNER=
|
||||||
GROUP=
|
GROUP=
|
||||||
MODE=444
|
MODE=444
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: meta.stage.mk,v 1.24 2013/03/23 02:25:19 sjg Exp $
|
# $Id: meta.stage.mk,v 1.30 2013/04/19 16:32:57 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2011, Simon J. Gerraty
|
# @(#) Copyright (c) 2011, Simon J. Gerraty
|
||||||
#
|
#
|
||||||
@ -228,4 +228,17 @@ STAGING_WAIT ?= .WAIT
|
|||||||
|
|
||||||
all: ${STAGING_WAIT} staging
|
all: ${STAGING_WAIT} staging
|
||||||
|
|
||||||
|
.if exists(${.PARSEDIR}/stage-install.sh) && !defined(STAGE_INSTALL)
|
||||||
|
# this will run install(1) and then followup with .dirdep files.
|
||||||
|
STAGE_INSTALL := sh ${.PARSEDIR:tA}/stage-install.sh INSTALL="${INSTALL}" OBJDIR=${.OBJDIR:tA}
|
||||||
|
.endif
|
||||||
|
|
||||||
|
# if ${INSTALL} gets run during 'all' assume it is for staging?
|
||||||
|
.if ${.TARGETS:Nall} == "" && defined(STAGE_INSTALL)
|
||||||
|
INSTALL := ${STAGE_INSTALL}
|
||||||
|
.if target(beforeinstall)
|
||||||
|
beforeinstall: .dirdep
|
||||||
|
.endif
|
||||||
|
.endif
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
RCSid:
|
RCSid:
|
||||||
$Id: meta2deps.py,v 1.12 2013/03/31 22:31:59 sjg Exp $
|
$Id: meta2deps.py,v 1.13 2013/05/11 05:16:26 sjg Exp $
|
||||||
|
|
||||||
Copyright (c) 2011-2013, Juniper Networks, Inc.
|
Copyright (c) 2011-2013, Juniper Networks, Inc.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
@ -124,6 +124,12 @@ def sort_unique(list, cmp=None, key=None, reverse=False):
|
|||||||
nl.append(e)
|
nl.append(e)
|
||||||
return nl
|
return nl
|
||||||
|
|
||||||
|
def add_trims(x):
|
||||||
|
return ['/' + x + '/',
|
||||||
|
'/' + x,
|
||||||
|
x + '/',
|
||||||
|
x]
|
||||||
|
|
||||||
class MetaFile:
|
class MetaFile:
|
||||||
"""class to parse meta files generated by bmake."""
|
"""class to parse meta files generated by bmake."""
|
||||||
|
|
||||||
@ -152,6 +158,9 @@ def __init__(self, name, conf={}):
|
|||||||
set to 'none' if we are not cross-building.
|
set to 'none' if we are not cross-building.
|
||||||
More specifically if machine cannot be deduced from objdirs.
|
More specifically if machine cannot be deduced from objdirs.
|
||||||
|
|
||||||
|
TARGET_SPEC
|
||||||
|
Sometimes MACHINE isn't enough.
|
||||||
|
|
||||||
HOST_TARGET
|
HOST_TARGET
|
||||||
when we build for the psuedo machine 'host'
|
when we build for the psuedo machine 'host'
|
||||||
the object tree uses HOST_TARGET rather than MACHINE.
|
the object tree uses HOST_TARGET rather than MACHINE.
|
||||||
@ -177,6 +186,8 @@ def __init__(self, name, conf={}):
|
|||||||
self.debug_out = getv(conf, 'debug_out', sys.stderr)
|
self.debug_out = getv(conf, 'debug_out', sys.stderr)
|
||||||
|
|
||||||
self.machine = getv(conf, 'MACHINE', '')
|
self.machine = getv(conf, 'MACHINE', '')
|
||||||
|
self.machine_arch = getv(conf, 'MACHINE_ARCH', '')
|
||||||
|
self.target_spec = getv(conf, 'TARGET_SPEC', '')
|
||||||
self.curdir = getv(conf, 'CURDIR')
|
self.curdir = getv(conf, 'CURDIR')
|
||||||
self.reldir = getv(conf, 'RELDIR')
|
self.reldir = getv(conf, 'RELDIR')
|
||||||
self.dpdeps = getv(conf, 'DPDEPS')
|
self.dpdeps = getv(conf, 'DPDEPS')
|
||||||
@ -196,16 +207,11 @@ def __init__(self, name, conf={}):
|
|||||||
if not _srctop in self.srctops:
|
if not _srctop in self.srctops:
|
||||||
self.srctops.append(_srctop)
|
self.srctops.append(_srctop)
|
||||||
|
|
||||||
trim_list = ['/' + self.machine + '/',
|
trim_list = add_trims(self.machine)
|
||||||
'/' + self.machine,
|
|
||||||
self.machine + '/',
|
|
||||||
self.machine]
|
|
||||||
|
|
||||||
if self.machine == 'host':
|
if self.machine == 'host':
|
||||||
trim_list += ['/' + self.host_target + '/',
|
trim_list += add_trims(self.host_target)
|
||||||
'/' + self.host_target,
|
if self.target_spec:
|
||||||
self.host_target + '/',
|
trim_list += add_trims(self.target_spec)
|
||||||
self.host_target]
|
|
||||||
|
|
||||||
for objroot in getv(conf, 'OBJROOTS', []):
|
for objroot in getv(conf, 'OBJROOTS', []):
|
||||||
for e in trim_list:
|
for e in trim_list:
|
||||||
@ -303,6 +309,8 @@ def find_obj(self, objroot, dir, path, input):
|
|||||||
print >> self.debug_out, "found %s: %s\n" % (ddepf, ddep)
|
print >> self.debug_out, "found %s: %s\n" % (ddepf, ddep)
|
||||||
if ddep.endswith(self.machine):
|
if ddep.endswith(self.machine):
|
||||||
ddep = ddep[0:-(1+len(self.machine))]
|
ddep = ddep[0:-(1+len(self.machine))]
|
||||||
|
elif self.target_spec and ddep.endswith(self.target_spec):
|
||||||
|
ddep = ddep[0:-(1+len(self.target_spec))]
|
||||||
|
|
||||||
if not ddep:
|
if not ddep:
|
||||||
# no .dirdeps, so remember that we've seen the raw input
|
# no .dirdeps, so remember that we've seen the raw input
|
||||||
@ -520,6 +528,8 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
|
|||||||
|
|
||||||
-m "MACHINE"
|
-m "MACHINE"
|
||||||
|
|
||||||
|
-a "MACHINE_ARCH"
|
||||||
|
|
||||||
-H "HOST_TARGET"
|
-H "HOST_TARGET"
|
||||||
|
|
||||||
-D "DPDEPS"
|
-D "DPDEPS"
|
||||||
@ -548,6 +558,9 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
|
|||||||
machine = os.environ['MACHINE']
|
machine = os.environ['MACHINE']
|
||||||
if machine:
|
if machine:
|
||||||
conf['MACHINE'] = machine
|
conf['MACHINE'] = machine
|
||||||
|
machine_arch = os.environ['MACHINE_ARCH']
|
||||||
|
if machine_arch:
|
||||||
|
conf['MACHINE_ARCH'] = machine_arch
|
||||||
srctop = os.environ['SB_SRC']
|
srctop = os.environ['SB_SRC']
|
||||||
if srctop:
|
if srctop:
|
||||||
conf['SRCTOPS'].append(srctop)
|
conf['SRCTOPS'].append(srctop)
|
||||||
@ -560,9 +573,11 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
|
|||||||
debug = 0
|
debug = 0
|
||||||
output = True
|
output = True
|
||||||
|
|
||||||
opts, args = getopt.getopt(argv[1:], 'dS:C:O:R:m:D:H:q' + xopts)
|
opts, args = getopt.getopt(argv[1:], 'a:dS:C:O:R:m:D:H:qT:' + xopts)
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o == '-d':
|
if o == '-a':
|
||||||
|
conf['MACHINE_ARCH'] = a
|
||||||
|
elif o == '-d':
|
||||||
debug += 1
|
debug += 1
|
||||||
elif o == '-q':
|
elif o == '-q':
|
||||||
output = False
|
output = False
|
||||||
@ -582,6 +597,8 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
|
|||||||
conf['DPDEPS'] = a
|
conf['DPDEPS'] = a
|
||||||
elif o == '-m':
|
elif o == '-m':
|
||||||
conf['MACHINE'] = a
|
conf['MACHINE'] = a
|
||||||
|
elif o == '-T':
|
||||||
|
conf['TARGET_SPEC'] = a
|
||||||
elif xoptf:
|
elif xoptf:
|
||||||
xoptf(o, a, conf)
|
xoptf(o, a, conf)
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@
|
|||||||
# The output, is a set of absolute paths with "SB" like:
|
# The output, is a set of absolute paths with "SB" like:
|
||||||
#.nf
|
#.nf
|
||||||
#
|
#
|
||||||
# $SB/obj-i386/junos/gnu/lib/csu
|
# $SB/obj-i386/bsd/gnu/lib/csu
|
||||||
# $SB/obj-i386/junos/gnu/lib/libgcc
|
# $SB/obj-i386/bsd/gnu/lib/libgcc
|
||||||
# $SB/obj-i386/bsd/include
|
# $SB/obj-i386/bsd/include
|
||||||
# $SB/obj-i386/bsd/lib/csu/i386-elf
|
# $SB/obj-i386/bsd/lib/csu/i386-elf
|
||||||
# $SB/obj-i386/bsd/lib/libc
|
# $SB/obj-i386/bsd/lib/libc
|
||||||
@ -77,9 +77,9 @@
|
|||||||
|
|
||||||
|
|
||||||
# RCSid:
|
# RCSid:
|
||||||
# $Id: meta2deps.sh,v 1.5 2013/02/10 19:21:46 sjg Exp $
|
# $Id: meta2deps.sh,v 1.6 2013/05/11 05:16:26 sjg Exp $
|
||||||
|
|
||||||
# Copyright (c) 2010-2012, Juniper Networks, Inc.
|
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -115,16 +115,89 @@ meta2dirs() {
|
|||||||
sort -u
|
sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_list() {
|
||||||
|
sep=' '
|
||||||
|
suffix=
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
"|") sep="$1"; shift;;
|
||||||
|
-s) suffix="$2"; shift 2;;
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
name=$1
|
||||||
|
shift
|
||||||
|
eval list="\$$name"
|
||||||
|
for top in "$@"
|
||||||
|
do
|
||||||
|
case "$sep$list$sep" in
|
||||||
|
*"$sep$top$suffix$sep"*) continue;;
|
||||||
|
esac
|
||||||
|
list="${list:+$list$sep}$top$suffix"
|
||||||
|
done
|
||||||
|
eval "$name=\"$list\""
|
||||||
|
}
|
||||||
|
|
||||||
meta2deps() {
|
meta2deps() {
|
||||||
DPDEPS=
|
DPDEPS=
|
||||||
|
SRCTOPS=$SRCTOP
|
||||||
|
OBJROOTS=
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*=*) eval export "$1"; shift;;
|
*=*) eval export "$1"; shift;;
|
||||||
|
-a) MACHINE_ARCH=$2; shift 2;;
|
||||||
|
-m) MACHINE=$2; shift 2;;
|
||||||
|
-C) CURDIR=$2; shift 2;;
|
||||||
|
-H) HOST_TARGET=$2; shift 2;;
|
||||||
|
-S) add_list SRCTOPS $2; shift 2;;
|
||||||
|
-O) add_list OBJROOTS $2; shift 2;;
|
||||||
|
-R) RELDIR=$2; shift 2;;
|
||||||
|
-T) TARGET_SPEC=$2; shift 2;;
|
||||||
*) break;;
|
*) break;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
_th= _o=
|
||||||
|
case "$MACHINE" in
|
||||||
|
host) _ht=$HOST_TARGET;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
for o in $OBJROOTS
|
||||||
|
do
|
||||||
|
case "$MACHINE,/$o/" in
|
||||||
|
host,*$HOST_TARGET*) ;;
|
||||||
|
*$MACHINE*|*${TARGET_SPEC:-$MACHINE}*) ;;
|
||||||
|
*) add_list _o $o; continue;;
|
||||||
|
esac
|
||||||
|
for x in $_ht $TARGET_SPEC $MACHINE
|
||||||
|
do
|
||||||
|
case "$o" in
|
||||||
|
"") continue;;
|
||||||
|
*/$x/) add_list _o ${o%$x/}; o=;;
|
||||||
|
*/$x) add_list _o ${o%$x}; o=;;
|
||||||
|
*$x/) add_list _o ${o%$x/}; o=;;
|
||||||
|
*$x) add_list _o ${o%$x}; o=;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
done
|
||||||
|
OBJROOTS="$_o"
|
||||||
|
|
||||||
|
case "$OBJTOP" in
|
||||||
|
"")
|
||||||
|
for o in $OBJROOTS
|
||||||
|
do
|
||||||
|
OBJTOP=$o${TARGET_SPEC:-$MACHINE}
|
||||||
|
break
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
src_re=
|
||||||
|
obj_re=
|
||||||
|
add_list '|' -s '/*' src_re $SRCTOPS
|
||||||
|
add_list '|' -s '*' obj_re $OBJROOTS
|
||||||
|
|
||||||
[ -z "$RELDIR" ] && unset DPDEPS
|
[ -z "$RELDIR" ] && unset DPDEPS
|
||||||
tf=/tmp/m2d$$-$USER
|
tf=/tmp/m2d$$-$USER
|
||||||
rm -f $tf.*
|
rm -f $tf.*
|
||||||
@ -166,8 +239,7 @@ meta2deps() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case "$op,$path" in
|
case "$op,$path" in
|
||||||
*.dirdep) continue;;
|
W,*srcrel|*.dirdep) continue;;
|
||||||
W,*srcrel) continue;;
|
|
||||||
C,*)
|
C,*)
|
||||||
case "$path" in
|
case "$path" in
|
||||||
/*) cwd=$path;;
|
/*) cwd=$path;;
|
||||||
@ -182,8 +254,7 @@ meta2deps() {
|
|||||||
;;
|
;;
|
||||||
*) dir=${path%/*}
|
*) dir=${path%/*}
|
||||||
case "$path" in
|
case "$path" in
|
||||||
$SB/*|${SB_BACKING_SB:-$SB}/*) ;;
|
$src_re|$obj_re) ;;
|
||||||
$SB_OBJROOT*) ;;
|
|
||||||
/*/stage/*) ;;
|
/*/stage/*) ;;
|
||||||
/*) continue;;
|
/*) continue;;
|
||||||
*) for path in $ldir/$path $cwd/$path
|
*) for path in $ldir/$path $cwd/$path
|
||||||
@ -215,7 +286,7 @@ meta2deps() {
|
|||||||
esac
|
esac
|
||||||
case "$dir" in
|
case "$dir" in
|
||||||
${CURDIR:-.}|${CURDIR:-.}/*|"") continue;;
|
${CURDIR:-.}|${CURDIR:-.}/*|"") continue;;
|
||||||
$SRCTOP/*|${SB_BACKING_SB:-$SB}/src/*)
|
$src_re)
|
||||||
# avoid repeating ourselves...
|
# avoid repeating ourselves...
|
||||||
case "$DPDEPS,$seensrc," in
|
case "$DPDEPS,$seensrc," in
|
||||||
,*)
|
,*)
|
||||||
@ -241,7 +312,7 @@ meta2deps() {
|
|||||||
[ -f $path ] || continue
|
[ -f $path ] || continue
|
||||||
case "$dir" in
|
case "$dir" in
|
||||||
$CWD) continue;; # ignore
|
$CWD) continue;; # ignore
|
||||||
$SRCTOP/*|${SB_BACKING_SB:-$SB}/src/*)
|
$src_re)
|
||||||
seenit="$seenit,$seen"
|
seenit="$seenit,$seen"
|
||||||
echo $dir >> $tf.srcdep
|
echo $dir >> $tf.srcdep
|
||||||
case "$DPDEPS,$reldir,$seensrc," in
|
case "$DPDEPS,$reldir,$seensrc," in
|
||||||
@ -267,7 +338,7 @@ meta2deps() {
|
|||||||
fi
|
fi
|
||||||
seenit="$seenit,$seen"
|
seenit="$seenit,$seen"
|
||||||
case "$dir" in
|
case "$dir" in
|
||||||
$SB/*|${SB_OBJROOT:-$SB/}*|${SB_BACKING_SB:-$SB}/*)
|
$obj_re)
|
||||||
echo $dir;;
|
echo $dir;;
|
||||||
esac
|
esac
|
||||||
done > $tf.dirdep
|
done > $tf.dirdep
|
||||||
@ -283,7 +354,7 @@ meta2deps() {
|
|||||||
# qualified with .<machine> as needed.
|
# qualified with .<machine> as needed.
|
||||||
# We strip .$MACHINE though
|
# We strip .$MACHINE though
|
||||||
xargs cat < $f | sort -u |
|
xargs cat < $f | sort -u |
|
||||||
sed "s,^# ,,;s,^,$OBJTOP/,;s,\.$MACHINE\$,,"
|
sed "s,^# ,,;s,^,$OBJTOP/,;s,\.${TARGET_SPEC:-$MACHINE}\$,,;s,\.$MACHINE\$,,"
|
||||||
;;
|
;;
|
||||||
*) sort -u $f;;
|
*) sort -u $f;;
|
||||||
esac
|
esac
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: options.mk,v 1.6 2013/01/28 19:28:52 sjg Exp $
|
# $Id: options.mk,v 1.7 2013/04/17 20:32:38 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2012, Simon J. Gerraty
|
# @(#) Copyright (c) 2012, Simon J. Gerraty
|
||||||
#
|
#
|
||||||
@ -13,7 +13,7 @@
|
|||||||
# sjg@crufty.net
|
# sjg@crufty.net
|
||||||
#
|
#
|
||||||
|
|
||||||
# Inspired by FreeBSD bsd.own.mk, but intentionally simpler.
|
# Inspired by FreeBSD bsd.own.mk, but intentionally simpler and more flexible.
|
||||||
|
|
||||||
# Options are normally listed in either OPTIONS_DEFAULT_{YES,NO}
|
# Options are normally listed in either OPTIONS_DEFAULT_{YES,NO}
|
||||||
# We convert these to ${OPTION}/{yes,no} in OPTIONS_DEFAULT_VALUES.
|
# We convert these to ${OPTION}/{yes,no} in OPTIONS_DEFAULT_VALUES.
|
||||||
@ -24,35 +24,36 @@
|
|||||||
# ${OPTION}/yes in OPTIONS_DEFAULT_VALUES.
|
# ${OPTION}/yes in OPTIONS_DEFAULT_VALUES.
|
||||||
# A makefile may set NO_* (or NO*) to indicate it cannot do something.
|
# A makefile may set NO_* (or NO*) to indicate it cannot do something.
|
||||||
# User sets WITH_* and WITHOUT_* to indicate what they want.
|
# User sets WITH_* and WITHOUT_* to indicate what they want.
|
||||||
# We set MK_* which is then all we need care about.
|
# We set ${OPTION_PREFIX:UMK_}* which is then all we need care about.
|
||||||
OPTIONS_DEFAULT_VALUES += \
|
OPTIONS_DEFAULT_VALUES += \
|
||||||
${OPTIONS_DEFAULT_NO:O:u:S,$,/no,} \
|
${OPTIONS_DEFAULT_NO:O:u:S,$,/no,} \
|
||||||
${OPTIONS_DEFAULT_YES:O:u:S,$,/yes,}
|
${OPTIONS_DEFAULT_YES:O:u:S,$,/yes,}
|
||||||
|
|
||||||
|
OPTION_PREFIX ?= MK_
|
||||||
.for o in ${OPTIONS_DEFAULT_VALUES:M*/*}
|
.for o in ${OPTIONS_DEFAULT_VALUES:M*/*}
|
||||||
.if ${o:T:tl} == "no"
|
.if ${o:T:tl} == "no"
|
||||||
.if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H})
|
.if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H})
|
||||||
MK_${o:H} ?= yes
|
${OPTION_PREFIX}${o:H} ?= yes
|
||||||
.else
|
.else
|
||||||
MK_${o:H} ?= no
|
${OPTION_PREFIX}${o:H} ?= no
|
||||||
.endif
|
.endif
|
||||||
.else
|
.else
|
||||||
.if defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H})
|
.if defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H})
|
||||||
MK_${o:H} ?= no
|
${OPTION_PREFIX}${o:H} ?= no
|
||||||
.else
|
.else
|
||||||
MK_${o:H} ?= yes
|
${OPTION_PREFIX}${o:H} ?= yes
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
# OPTIONS_DEFAULT_DEPENDENT += FOO_UTILS/FOO
|
# OPTIONS_DEFAULT_DEPENDENT += FOO_UTILS/FOO
|
||||||
# if neither WITH[OUT]_FOO_UTILS is set, use value of MK_FOO
|
# if neither WITH[OUT]_FOO_UTILS is set, use value of ${OPTION_PREFIX}FOO
|
||||||
.for o in ${OPTIONS_DEFAULT_DEPENDENT:M*/*:O:u}
|
.for o in ${OPTIONS_DEFAULT_DEPENDENT:M*/*:O:u}
|
||||||
.if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H})
|
.if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H})
|
||||||
MK_${o:H} ?= yes
|
${OPTION_PREFIX}${o:H} ?= yes
|
||||||
.elif defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H})
|
.elif defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H})
|
||||||
MK_${o:H} ?= no
|
${OPTION_PREFIX}${o:H} ?= no
|
||||||
.else
|
.else
|
||||||
MK_${o:H} ?= ${MK_${o:T}}
|
${OPTION_PREFIX}${o:H} ?= ${${OPTION_PREFIX}${o:T}}
|
||||||
.endif
|
.endif
|
||||||
.endfor
|
.endfor
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: progs.mk,v 1.11 2012/11/06 17:18:54 sjg Exp $
|
# $Id: progs.mk,v 1.12 2013/04/22 18:10:04 sjg Exp $
|
||||||
#
|
#
|
||||||
# @(#) Copyright (c) 2006, Simon J. Gerraty
|
# @(#) Copyright (c) 2006, Simon J. Gerraty
|
||||||
#
|
#
|
||||||
@ -35,9 +35,11 @@ PROG ?= $t
|
|||||||
|
|
||||||
.if defined(PROG)
|
.if defined(PROG)
|
||||||
# just one of many
|
# just one of many
|
||||||
PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS
|
PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS
|
||||||
.for v in ${PROG_VARS:O:u}
|
.for v in ${PROG_VARS:O:u}
|
||||||
|
.if defined(${v}.${PROG})
|
||||||
$v += ${${v}_${PROG}:U${${v}.${PROG}}}
|
$v += ${${v}_${PROG}:U${${v}.${PROG}}}
|
||||||
|
.endif
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
# for meta mode, there can be only one!
|
# for meta mode, there can be only one!
|
||||||
@ -63,7 +65,8 @@ UPDATE_DEPENDFILE = NO
|
|||||||
.include <${.PARSEFILE:S,progs,prog,}>
|
.include <${.PARSEFILE:S,progs,prog,}>
|
||||||
|
|
||||||
.ifndef PROG
|
.ifndef PROG
|
||||||
PROGS_TARGETS += clean
|
# tell progs.mk we might want to install things
|
||||||
|
PROGS_TARGETS+= cleandepend cleandir cleanobj depend install
|
||||||
|
|
||||||
.for p in ${PROGS}
|
.for p in ${PROGS}
|
||||||
.if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)
|
.if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p)
|
||||||
|
98
contrib/bmake/mk/stage-install.sh
Executable file
98
contrib/bmake/mk/stage-install.sh
Executable file
@ -0,0 +1,98 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# NAME:
|
||||||
|
# stage-install.sh - wrapper around install
|
||||||
|
#
|
||||||
|
# SYNOPSIS:
|
||||||
|
# stage-install.sh [variable="value"] "args" "dest"
|
||||||
|
#
|
||||||
|
# DESCRIPTION:
|
||||||
|
# This script is a wrapper around the normal install(1).
|
||||||
|
# Its role is to add '.dirdep' files to the destination.
|
||||||
|
# The variables we might use are:
|
||||||
|
#
|
||||||
|
# INSTALL
|
||||||
|
# Path to actual install(1), default is
|
||||||
|
# $REAL_INSTALL
|
||||||
|
#
|
||||||
|
# OBJDIR
|
||||||
|
# Path to the dir where '.dirdep' was generated,
|
||||||
|
# default is '.'
|
||||||
|
#
|
||||||
|
# _DIRDEP
|
||||||
|
# Path to actual '.dirdep' file, default is
|
||||||
|
# $OBJDIR/.dirdep
|
||||||
|
#
|
||||||
|
# The "args" and "dest" are passed as is to install(1), and if a
|
||||||
|
# '.dirdep' file exists it will be linked or copied to each
|
||||||
|
# "file".dirdep placed in "dest" or "dest".dirdep if it happed
|
||||||
|
# to be a file rather than a directory.
|
||||||
|
#
|
||||||
|
# SEE ALSO:
|
||||||
|
# meta.stage.mk
|
||||||
|
#
|
||||||
|
|
||||||
|
# RCSid:
|
||||||
|
# $Id: stage-install.sh,v 1.5 2013/04/19 16:32:24 sjg Exp $
|
||||||
|
#
|
||||||
|
# @(#) Copyright (c) 2013, Simon J. Gerraty
|
||||||
|
#
|
||||||
|
# This file is provided in the hope that it will
|
||||||
|
# be of use. There is absolutely NO WARRANTY.
|
||||||
|
# Permission to copy, redistribute or otherwise
|
||||||
|
# use this file is hereby granted provided that
|
||||||
|
# the above copyright notice and this notice are
|
||||||
|
# left intact.
|
||||||
|
#
|
||||||
|
# Please send copies of changes and bug-fixes to:
|
||||||
|
# sjg@crufty.net
|
||||||
|
#
|
||||||
|
|
||||||
|
INSTALL=${REAL_INSTALL:-install}
|
||||||
|
OBJDIR=.
|
||||||
|
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
*=*) eval "$1"; shift;;
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# if .dirdep doesn't exist, just run install and be done
|
||||||
|
_DIRDEP=${_DIRDEP:-$OBJDIR/.dirdep}
|
||||||
|
[ -s $_DIRDEP ] && EXEC= || EXEC=exec
|
||||||
|
$EXEC $INSTALL "$@" || exit 1
|
||||||
|
|
||||||
|
# from meta.stage.mk
|
||||||
|
LnCp() {
|
||||||
|
rm -f $2 2> /dev/null
|
||||||
|
ln $1 $2 2> /dev/null || cp -p $1 $2
|
||||||
|
}
|
||||||
|
|
||||||
|
StageDirdep() {
|
||||||
|
t=$1
|
||||||
|
if [ -s $t.dirdep ]; then
|
||||||
|
cmp -s $_DIRDEP $t.dirdep && return
|
||||||
|
echo "ERROR: $t installed by `cat $t.dirdep` not `cat $_DIRDEP`" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
LnCp $_DIRDEP $t.dirdep || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
args="$@"
|
||||||
|
while [ $# -gt 8 ]
|
||||||
|
do
|
||||||
|
shift 8
|
||||||
|
done
|
||||||
|
eval dest=\$$#
|
||||||
|
if [ -f $dest ]; then
|
||||||
|
# a file, there can be only one .dirdep needed
|
||||||
|
StageDirdep $dest
|
||||||
|
elif [ -d $dest ]; then
|
||||||
|
for f in $args
|
||||||
|
do
|
||||||
|
test -f $f || continue
|
||||||
|
StageDirdep $dest/${f##*/}
|
||||||
|
done
|
||||||
|
fi
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $ */
|
/* $NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988, 1989, 1990, 1993
|
* Copyright (c) 1988, 1989, 1990, 1993
|
||||||
@ -69,14 +69,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAKE_NATIVE
|
#ifndef MAKE_NATIVE
|
||||||
static char rcsid[] = "$NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $";
|
static char rcsid[] = "$NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $";
|
||||||
#else
|
#else
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
|
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: suff.c,v 1.69 2011/09/29 23:38:04 sjg Exp $");
|
__RCSID("$NetBSD: suff.c,v 1.70 2013/05/18 13:13:34 sjg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
#endif
|
#endif
|
||||||
@ -2063,118 +2063,119 @@ SuffFindNormalDeps(GNode *gn, Lst slst)
|
|||||||
|
|
||||||
if (!(gn->type & OP_PHONY)) {
|
if (!(gn->type & OP_PHONY)) {
|
||||||
|
|
||||||
while (ln != NULL) {
|
while (ln != NULL) {
|
||||||
/*
|
|
||||||
* Look for next possible suffix...
|
|
||||||
*/
|
|
||||||
ln = Lst_FindFrom(sufflist, ln, &sd, SuffSuffIsSuffixP);
|
|
||||||
|
|
||||||
if (ln != NULL) {
|
|
||||||
int prefLen; /* Length of the prefix */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate a Src structure to which things can be transformed
|
* Look for next possible suffix...
|
||||||
*/
|
*/
|
||||||
|
ln = Lst_FindFrom(sufflist, ln, &sd, SuffSuffIsSuffixP);
|
||||||
|
|
||||||
|
if (ln != NULL) {
|
||||||
|
int prefLen; /* Length of the prefix */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocate a Src structure to which things can be transformed
|
||||||
|
*/
|
||||||
|
targ = bmake_malloc(sizeof(Src));
|
||||||
|
targ->file = bmake_strdup(gn->name);
|
||||||
|
targ->suff = (Suff *)Lst_Datum(ln);
|
||||||
|
targ->suff->refCount++;
|
||||||
|
targ->node = gn;
|
||||||
|
targ->parent = NULL;
|
||||||
|
targ->children = 0;
|
||||||
|
#ifdef DEBUG_SRC
|
||||||
|
targ->cp = Lst_Init(FALSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocate room for the prefix, whose end is found by
|
||||||
|
* subtracting the length of the suffix from
|
||||||
|
* the end of the name.
|
||||||
|
*/
|
||||||
|
prefLen = (eoname - targ->suff->nameLen) - sopref;
|
||||||
|
targ->pref = bmake_malloc(prefLen + 1);
|
||||||
|
memcpy(targ->pref, sopref, prefLen);
|
||||||
|
targ->pref[prefLen] = '\0';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add nodes from which the target can be made
|
||||||
|
*/
|
||||||
|
SuffAddLevel(srcs, targ);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Record the target so we can nuke it
|
||||||
|
*/
|
||||||
|
(void)Lst_AtEnd(targs, targ);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Search from this suffix's successor...
|
||||||
|
*/
|
||||||
|
ln = Lst_Succ(ln);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handle target of unknown suffix...
|
||||||
|
*/
|
||||||
|
if (Lst_IsEmpty(targs) && suffNull != NULL) {
|
||||||
|
if (DEBUG(SUFF)) {
|
||||||
|
fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name);
|
||||||
|
}
|
||||||
|
|
||||||
targ = bmake_malloc(sizeof(Src));
|
targ = bmake_malloc(sizeof(Src));
|
||||||
targ->file = bmake_strdup(gn->name);
|
targ->file = bmake_strdup(gn->name);
|
||||||
targ->suff = (Suff *)Lst_Datum(ln);
|
targ->suff = suffNull;
|
||||||
targ->suff->refCount++;
|
targ->suff->refCount++;
|
||||||
targ->node = gn;
|
targ->node = gn;
|
||||||
targ->parent = NULL;
|
targ->parent = NULL;
|
||||||
targ->children = 0;
|
targ->children = 0;
|
||||||
|
targ->pref = bmake_strdup(sopref);
|
||||||
#ifdef DEBUG_SRC
|
#ifdef DEBUG_SRC
|
||||||
targ->cp = Lst_Init(FALSE);
|
targ->cp = Lst_Init(FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate room for the prefix, whose end is found by subtracting
|
* Only use the default suffix rules if we don't have commands
|
||||||
* the length of the suffix from the end of the name.
|
* defined for this gnode; traditional make programs used to
|
||||||
|
* not define suffix rules if the gnode had children but we
|
||||||
|
* don't do this anymore.
|
||||||
*/
|
*/
|
||||||
prefLen = (eoname - targ->suff->nameLen) - sopref;
|
if (Lst_IsEmpty(gn->commands))
|
||||||
targ->pref = bmake_malloc(prefLen + 1);
|
SuffAddLevel(srcs, targ);
|
||||||
memcpy(targ->pref, sopref, prefLen);
|
else {
|
||||||
targ->pref[prefLen] = '\0';
|
if (DEBUG(SUFF))
|
||||||
|
fprintf(debug_file, "not ");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Add nodes from which the target can be made
|
|
||||||
*/
|
|
||||||
SuffAddLevel(srcs, targ);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Record the target so we can nuke it
|
|
||||||
*/
|
|
||||||
(void)Lst_AtEnd(targs, targ);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Search from this suffix's successor...
|
|
||||||
*/
|
|
||||||
ln = Lst_Succ(ln);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Handle target of unknown suffix...
|
|
||||||
*/
|
|
||||||
if (Lst_IsEmpty(targs) && suffNull != NULL) {
|
|
||||||
if (DEBUG(SUFF)) {
|
|
||||||
fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
targ = bmake_malloc(sizeof(Src));
|
|
||||||
targ->file = bmake_strdup(gn->name);
|
|
||||||
targ->suff = suffNull;
|
|
||||||
targ->suff->refCount++;
|
|
||||||
targ->node = gn;
|
|
||||||
targ->parent = NULL;
|
|
||||||
targ->children = 0;
|
|
||||||
targ->pref = bmake_strdup(sopref);
|
|
||||||
#ifdef DEBUG_SRC
|
|
||||||
targ->cp = Lst_Init(FALSE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Only use the default suffix rules if we don't have commands
|
|
||||||
* defined for this gnode; traditional make programs used to
|
|
||||||
* not define suffix rules if the gnode had children but we
|
|
||||||
* don't do this anymore.
|
|
||||||
*/
|
|
||||||
if (Lst_IsEmpty(gn->commands))
|
|
||||||
SuffAddLevel(srcs, targ);
|
|
||||||
else {
|
|
||||||
if (DEBUG(SUFF))
|
if (DEBUG(SUFF))
|
||||||
fprintf(debug_file, "not ");
|
fprintf(debug_file, "adding suffix rules\n");
|
||||||
|
|
||||||
|
(void)Lst_AtEnd(targs, targ);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DEBUG(SUFF))
|
|
||||||
fprintf(debug_file, "adding suffix rules\n");
|
|
||||||
|
|
||||||
(void)Lst_AtEnd(targs, targ);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Using the list of possible sources built up from the target suffix(es),
|
|
||||||
* try and find an existing file/target that matches.
|
|
||||||
*/
|
|
||||||
bottom = SuffFindThem(srcs, slst);
|
|
||||||
|
|
||||||
if (bottom == NULL) {
|
|
||||||
/*
|
/*
|
||||||
* No known transformations -- use the first suffix found for setting
|
* Using the list of possible sources built up from the target
|
||||||
* the local variables.
|
* suffix(es), try and find an existing file/target that matches.
|
||||||
*/
|
*/
|
||||||
if (!Lst_IsEmpty(targs)) {
|
bottom = SuffFindThem(srcs, slst);
|
||||||
targ = (Src *)Lst_Datum(Lst_First(targs));
|
|
||||||
|
if (bottom == NULL) {
|
||||||
|
/*
|
||||||
|
* No known transformations -- use the first suffix found
|
||||||
|
* for setting the local variables.
|
||||||
|
*/
|
||||||
|
if (!Lst_IsEmpty(targs)) {
|
||||||
|
targ = (Src *)Lst_Datum(Lst_First(targs));
|
||||||
|
} else {
|
||||||
|
targ = NULL;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
targ = NULL;
|
/*
|
||||||
|
* Work up the transformation path to find the suffix of the
|
||||||
|
* target to which the transformation was made.
|
||||||
|
*/
|
||||||
|
for (targ = bottom; targ->parent != NULL; targ = targ->parent)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* Work up the transformation path to find the suffix of the
|
|
||||||
* target to which the transformation was made.
|
|
||||||
*/
|
|
||||||
for (targ = bottom; targ->parent != NULL; targ = targ->parent)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Var_Set(TARGET, gn->path ? gn->path : gn->name, gn, 0);
|
Var_Set(TARGET, gn->path ? gn->path : gn->name, gn, 0);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: var.c,v 1.173 2013/02/24 19:43:37 christos Exp $ */
|
/* $NetBSD: var.c,v 1.174 2013/05/18 13:12:45 sjg Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988, 1989, 1990, 1993
|
* Copyright (c) 1988, 1989, 1990, 1993
|
||||||
@ -69,14 +69,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAKE_NATIVE
|
#ifndef MAKE_NATIVE
|
||||||
static char rcsid[] = "$NetBSD: var.c,v 1.173 2013/02/24 19:43:37 christos Exp $";
|
static char rcsid[] = "$NetBSD: var.c,v 1.174 2013/05/18 13:12:45 sjg Exp $";
|
||||||
#else
|
#else
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
|
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: var.c,v 1.173 2013/02/24 19:43:37 christos Exp $");
|
__RCSID("$NetBSD: var.c,v 1.174 2013/05/18 13:12:45 sjg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
#endif
|
#endif
|
||||||
|
@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR}
|
|||||||
CLEANDIRS+= FreeBSD
|
CLEANDIRS+= FreeBSD
|
||||||
CLEANFILES+= bootstrap
|
CLEANFILES+= bootstrap
|
||||||
|
|
||||||
# $Id: Makefile,v 1.10 2013/03/31 05:57:19 sjg Exp $
|
# $Id: Makefile,v 1.12 2013/05/20 16:05:10 sjg Exp $
|
||||||
|
|
||||||
# Base version on src date
|
# Base version on src date
|
||||||
MAKE_VERSION= 20130330
|
MAKE_VERSION= 20130520
|
||||||
|
|
||||||
PROG?= ${.CURDIR:T}
|
PROG?= ${.CURDIR:T}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user