mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
Update to bmake-20251111
Merge commit '638c66de4a0faa4c2e815e81cd4021c2387c7e0f'
(cherry picked from commit c60f6422ff)
This commit is contained in:
parent
06366a2188
commit
c95f96dea3
93 changed files with 690 additions and 698 deletions
|
|
@ -1,3 +1,40 @@
|
|||
2025-11-15 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* boot-strap: unset more things from env and save a copy
|
||||
to env.out for debugging.
|
||||
|
||||
2025-11-12 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* VERSION (_MAKE_VERSION): 20251111
|
||||
Merge with NetBSD make, pick up
|
||||
o var.c: add :sh1 which only evaluates command on first reference.
|
||||
|
||||
2025-11-11 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* configure.in: Force filemon=no for Cygwin and MINGW64_NT
|
||||
|
||||
2025-11-10 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* unit-tests/Makefile: handle MINGW64_NT
|
||||
mark some tests broken, filter others as per Cygwin.
|
||||
|
||||
2025-10-23 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* make.1: document MAKE_VERSION.
|
||||
|
||||
2025-10-22 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* VERSION (_MAKE_VERSION): 20251022
|
||||
|
||||
* configure.in: Add a check that lua is version 5.2 or later
|
||||
if not we want to skip running check-expect.lua
|
||||
|
||||
2025-09-16 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* VERSION (_MAKE_VERSION): 20250916
|
||||
Merge with NetBSD make, pick up
|
||||
o var.c: avoid compiler warning from hexdigits
|
||||
|
||||
2025-08-04 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* VERSION (_MAKE_VERSION): 20250804
|
||||
|
|
|
|||
|
|
@ -760,6 +760,8 @@ unit-tests/varmod-subst.exp
|
|||
unit-tests/varmod-subst.mk
|
||||
unit-tests/varmod-sun-shell.exp
|
||||
unit-tests/varmod-sun-shell.mk
|
||||
unit-tests/varmod-sun-shell1.exp
|
||||
unit-tests/varmod-sun-shell1.mk
|
||||
unit-tests/varmod-sysv.exp
|
||||
unit-tests/varmod-sysv.mk
|
||||
unit-tests/varmod-tail.exp
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ The individual files in this distribution are copyright their
|
|||
original contributors or assignees.
|
||||
Including:
|
||||
|
||||
Copyright (c) 1993-2021, Simon J Gerraty
|
||||
Copyright (c) 2020, Roland Illig <rillig@NetBSD.org>
|
||||
Copyright (c) 1993-2025, Simon J Gerraty
|
||||
Copyright (c) 2020-2021, Roland Illig <rillig@NetBSD.org>
|
||||
Copyright (c) 2009-2016, Juniper Networks, Inc.
|
||||
Copyright (c) 2009, John Birrell.
|
||||
Copyright (c) 1997-2021 The NetBSD Foundation, Inc.
|
||||
Copyright (c) 1997-2025 The NetBSD Foundation, Inc.
|
||||
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
Copyright (c) 1989 by Berkeley Softworks
|
||||
Copyright (c) 1988, 1989, 1990, 1992, 1993
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
# keep this compatible with sh and make
|
||||
_MAKE_VERSION=20250804
|
||||
_MAKE_VERSION=20251111
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: make.1,v 1.387 2025/07/02 17:11:56 rillig Exp $
|
||||
.\" $NetBSD: make.1,v 1.388 2025/11/12 22:14:07 sjg Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1990, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
.\"
|
||||
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
|
||||
.\"
|
||||
.Dd July 2, 2025
|
||||
.Dd November 11, 2025
|
||||
.Dt BMAKE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -945,6 +945,11 @@ include additional unexpanded variable references) are shown.
|
|||
.It Va .MAKE.EXPORTED
|
||||
The list of variables exported by
|
||||
.Nm .
|
||||
.It Va MAKE_VERSION
|
||||
This variable indicates the version of
|
||||
.Nm .
|
||||
It is typically the date of last import from NetBSD.
|
||||
It is useful for checking whether certain features are available.
|
||||
.It Va MAKEFILE
|
||||
The top-level makefile that is currently read,
|
||||
as given in the command line.
|
||||
|
|
@ -1881,6 +1886,10 @@ The output of running
|
|||
is the value.
|
||||
.It Cm \&:sh
|
||||
The value is run as a command, and the output becomes the new value.
|
||||
.It Cm \&:sh1
|
||||
The value is run as a command, for the first reference only, and
|
||||
the output is cached for subsequent references.
|
||||
This modifier is useful when the result is not expected to change.
|
||||
.It Cm \&::= Ns Ar str
|
||||
The variable is assigned the value
|
||||
.Ar str
|
||||
|
|
|
|||
|
|
@ -607,6 +607,11 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
|
|||
_._M_A_K_E_._E_X_P_O_R_T_E_D
|
||||
The list of variables exported by bbmmaakkee.
|
||||
|
||||
_M_A_K_E___V_E_R_S_I_O_N
|
||||
This variable indicates the version of bbmmaakkee. It is typically
|
||||
the date of last import from NetBSD. It is useful for checking
|
||||
whether certain features are available.
|
||||
|
||||
_M_A_K_E_F_I_L_E
|
||||
The top-level makefile that is currently read, as given in the
|
||||
command line.
|
||||
|
|
@ -1190,6 +1195,11 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
|
|||
|
||||
::sshh The value is run as a command, and the output becomes the new value.
|
||||
|
||||
::sshh11
|
||||
The value is run as a command, for the first reference only, and the
|
||||
output is cached for subsequent references. This modifier is useful
|
||||
when the result is not expected to change.
|
||||
|
||||
::::==_s_t_r
|
||||
The variable is assigned the value _s_t_r after substitution. This
|
||||
modifier and its variations are useful in obscure situations such as
|
||||
|
|
@ -1864,4 +1874,4 @@ BBUUGGSS
|
|||
attempt to suppress a cascade of unnecessary errors, can result in a
|
||||
seemingly unexplained `*** Error code 6'
|
||||
|
||||
FreeBSD 14.2-RELEASE-p1 July 2, 2025 FreeBSD 14.2-RELEASE-p1
|
||||
FreeBSD 14.3-RELEASE-p3 November 11, 2025 FreeBSD 14.3-RELEASE-p3
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 95 KiB |
|
|
@ -133,7 +133,7 @@
|
|||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
|
||||
# RCSid:
|
||||
# $Id: boot-strap,v 1.61 2024/03/10 17:51:10 sjg Exp $
|
||||
# $Id: boot-strap,v 1.62 2025/11/15 16:53:14 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2001 Simon J. Gerraty
|
||||
#
|
||||
|
|
@ -179,12 +179,25 @@ source_rc() {
|
|||
done
|
||||
}
|
||||
|
||||
have() {
|
||||
case `(type "$1") 2>&1` in
|
||||
*" found") return 1;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
Env() {
|
||||
have env && env || set
|
||||
}
|
||||
|
||||
cmd_args="$@"
|
||||
|
||||
# clear some things from the environment that we care about
|
||||
unset MAKEOBJDIR MAKEOBJDIRPREFIX
|
||||
# or that might be incompatible
|
||||
unset MAKE MAKEFLAGS
|
||||
# any variable starting with any of these prefixes will be unset
|
||||
for p in MAKE OBJ SB WITH
|
||||
do
|
||||
unset ENV `Env | sed -n "/^$p/s,=.*,,p"`
|
||||
done
|
||||
|
||||
# --install[-host-target] will set this
|
||||
INSTALL_PREFIX=
|
||||
|
|
@ -381,6 +394,8 @@ objdir="${objdir:-$OBJROOT$HOST_TARGET}"
|
|||
cd "$objdir" || exit 1
|
||||
# make it absolute
|
||||
objdir=`'pwd'`
|
||||
# save a copy of our env for debugging
|
||||
Env > env.out
|
||||
|
||||
ShareDir() {
|
||||
case "/$1" in
|
||||
|
|
|
|||
53
contrib/bmake/configure
vendored
53
contrib/bmake/configure
vendored
|
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.72 for bmake 20240711.
|
||||
# Generated by GNU Autoconf 2.72 for bmake 20251111.
|
||||
#
|
||||
# Report bugs to <sjg@NetBSD.org>.
|
||||
#
|
||||
|
|
@ -603,8 +603,8 @@ MAKEFLAGS=
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='bmake'
|
||||
PACKAGE_TARNAME='bmake'
|
||||
PACKAGE_VERSION='20240711'
|
||||
PACKAGE_STRING='bmake 20240711'
|
||||
PACKAGE_VERSION='20251111'
|
||||
PACKAGE_STRING='bmake 20251111'
|
||||
PACKAGE_BUGREPORT='sjg@NetBSD.org'
|
||||
PACKAGE_URL=''
|
||||
|
||||
|
|
@ -644,6 +644,7 @@ ac_func_c_list=
|
|||
ac_subst_vars='LTLIBOBJS
|
||||
UTC_1
|
||||
_MAKE_VERSION
|
||||
lua
|
||||
filemon_h
|
||||
use_filemon
|
||||
use_meta
|
||||
|
|
@ -720,6 +721,7 @@ with_makefile
|
|||
with_meta
|
||||
with_filemon
|
||||
with_bmake_strftime
|
||||
with_lua
|
||||
with_machine
|
||||
with_force_machine
|
||||
with_force_machine_arch
|
||||
|
|
@ -1286,7 +1288,7 @@ if test "$ac_init_help" = "long"; then
|
|||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
'configure' configures bmake 20240711 to adapt to many kinds of systems.
|
||||
'configure' configures bmake 20251111 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
|
@ -1348,7 +1350,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bmake 20240711:";;
|
||||
short | recursive ) echo "Configuration of bmake 20251111:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
|
@ -1371,6 +1373,7 @@ Optional Packages:
|
|||
--without-meta disable use of meta-mode
|
||||
--with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev
|
||||
--with-bmake-strftime force use of bmake strftime
|
||||
--without-lua do not use check-expect.lua
|
||||
--with-machine=MACHINE explicitly set MACHINE
|
||||
--with-force-machine=MACHINE set FORCE_MACHINE
|
||||
--with-force-machine-arch=MACHINE set FORCE_MACHINE_ARCH
|
||||
|
|
@ -1458,7 +1461,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bmake configure 20240711
|
||||
bmake configure 20251111
|
||||
generated by GNU Autoconf 2.72
|
||||
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
|
|
@ -1981,7 +1984,7 @@ cat >config.log <<_ACEOF
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by bmake $as_me 20240711, which was
|
||||
It was created by bmake $as_me 20251111, which was
|
||||
generated by GNU Autoconf 2.72. Invocation command line was
|
||||
|
||||
$ $0$ac_configure_args_raw
|
||||
|
|
@ -2772,6 +2775,13 @@ esac
|
|||
. $srcdir/VERSION
|
||||
OS=`uname -s`
|
||||
|
||||
have() {
|
||||
case `(type "$1") 2>&1` in
|
||||
*" found") return 1;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
use_defshell() {
|
||||
case "$defshell_path$DEFSHELL_INDEX" in
|
||||
"") ;;
|
||||
|
|
@ -2867,6 +2877,7 @@ esac
|
|||
else case e in #(
|
||||
e)
|
||||
case "$OS" in
|
||||
Cygwin*|MINGW*) use_filemon=no;;
|
||||
NetBSD) filemon_h=no use_filemon=ktrace;;
|
||||
*)
|
||||
for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon"
|
||||
|
|
@ -2943,6 +2954,29 @@ do
|
|||
PATH=$PATH:$d
|
||||
done
|
||||
export PATH
|
||||
lua=$LUA
|
||||
|
||||
# Check whether --with-lua was given.
|
||||
if test ${with_lua+y}
|
||||
then :
|
||||
withval=$with_lua; case "${withval}" in
|
||||
no) lua=:;;
|
||||
yes) lua= ;;
|
||||
/*lua*) lua=$withval;;
|
||||
*) as_fn_error $? "bad value ${withval} given for lua" "$LINENO" 5;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$lua" != x:; then
|
||||
if have lua; then
|
||||
lua_version=`${lua:-lua} -v | sed 's/Lua //;s/ *Copy.*//;'`
|
||||
echo $ECHO_N "checking whether lua version ($lua_version) > 5.2... $ECHO_C" >&6
|
||||
case "$lua_version" in
|
||||
4.*|5.1.*) lua=:; echo no >&6;;
|
||||
*) echo yes >&6;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
|
@ -7277,6 +7311,7 @@ esac
|
|||
|
||||
|
||||
|
||||
|
||||
bm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh"
|
||||
if test $use_makefile = yes; then
|
||||
bm_outfiles="makefile $bm_outfiles"
|
||||
|
|
@ -7798,7 +7833,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by bmake $as_me 20240711, which was
|
||||
This file was extended by bmake $as_me 20251111, which was
|
||||
generated by GNU Autoconf 2.72. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
|
@ -7862,7 +7897,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
|||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config='$ac_cs_config_escaped'
|
||||
ac_cs_version="\\
|
||||
bmake config.status 20240711
|
||||
bmake config.status 20251111
|
||||
configured by $0, generated by GNU Autoconf 2.72,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
dnl
|
||||
dnl RCSid:
|
||||
dnl $Id: configure.in,v 1.108 2024/07/13 15:27:00 sjg Exp $
|
||||
dnl $Id: configure.in,v 1.111 2025/11/11 18:43:59 sjg Exp $
|
||||
dnl
|
||||
dnl Process this file with autoconf to produce a configure script
|
||||
dnl
|
||||
AC_PREREQ([2.71])
|
||||
AC_INIT([bmake],[20240711],[sjg@NetBSD.org])
|
||||
AC_INIT([bmake],[20251111],[sjg@NetBSD.org])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
dnl make srcdir absolute
|
||||
|
|
@ -18,6 +18,14 @@ dnl get _MAKE_VERSION
|
|||
. $srcdir/VERSION
|
||||
OS=`uname -s`
|
||||
|
||||
dnl do not trust return from type
|
||||
have() {
|
||||
case `(type "$1") 2>&1` in
|
||||
*" found") return 1;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
dnl function to set DEFSHELL_INDEX
|
||||
use_defshell() {
|
||||
case "$defshell_path$DEFSHELL_INDEX" in
|
||||
|
|
@ -107,6 +115,7 @@ esac
|
|||
],
|
||||
[
|
||||
case "$OS" in
|
||||
Cygwin*|MINGW*) use_filemon=no;;
|
||||
NetBSD) filemon_h=no use_filemon=ktrace;;
|
||||
*)
|
||||
for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon"
|
||||
|
|
@ -187,6 +196,28 @@ do
|
|||
PATH=$PATH:$d
|
||||
done
|
||||
export PATH
|
||||
dnl
|
||||
dnl if lua is available check it is version 5.2 or later
|
||||
lua=$LUA
|
||||
AC_ARG_WITH(lua,
|
||||
[ --without-lua do not use check-expect.lua],
|
||||
[case "${withval}" in
|
||||
no) lua=:;;
|
||||
yes) lua= ;;
|
||||
/*lua*) lua=$withval;;
|
||||
*) AC_MSG_ERROR(bad value ${withval} given for lua);;
|
||||
esac])
|
||||
if test "x$lua" != x:; then
|
||||
if have lua; then
|
||||
lua_version=`${lua:-lua} -v | sed 's/Lua //;s/ *Copy.*//;'`
|
||||
echo $ECHO_N "checking whether lua version ($lua_version) > 5.2... $ECHO_C" >&6
|
||||
case "$lua_version" in
|
||||
4.*|5.1.*) lua=:; echo no >&6;;
|
||||
*) echo yes >&6;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
dnl
|
||||
dnl Solaris's signal.h only privides sigset_t etc if one of
|
||||
dnl _EXTENSIONS_ _POSIX_C_SOURCE or _XOPEN_SOURCE are defined.
|
||||
dnl The later two seem to cause more problems than they solve so if we
|
||||
|
|
@ -580,6 +611,7 @@ AC_SUBST(diff_u)
|
|||
AC_SUBST(use_meta)
|
||||
AC_SUBST(use_filemon)
|
||||
AC_SUBST(filemon_h)
|
||||
AC_SUBST(lua)
|
||||
AC_SUBST(_MAKE_VERSION)
|
||||
AC_SUBST(UTC_1)
|
||||
bm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh"
|
||||
|
|
|
|||
|
|
@ -53,19 +53,12 @@
|
|||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
#
|
||||
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: install-sh,v 1.26 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: install-sh,v 1.27 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1993-2023 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: main.c,v 1.661 2025/07/06 07:11:31 rillig Exp $ */
|
||||
/* $NetBSD: main.c,v 1.662 2025/08/09 23:13:28 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
#include "trace.h"
|
||||
|
||||
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
|
||||
MAKE_RCSID("$NetBSD: main.c,v 1.661 2025/07/06 07:11:31 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: main.c,v 1.662 2025/08/09 23:13:28 rillig Exp $");
|
||||
#if defined(MAKE_NATIVE)
|
||||
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
|
||||
"The Regents of the University of California. "
|
||||
|
|
@ -390,8 +390,8 @@ MainParseArgJobsInternal(const char *argvalue)
|
|||
progname, argvalue, curdir);
|
||||
exit(2);
|
||||
}
|
||||
if ((fcntl(tokenPoolReader, F_GETFD, 0) < 0) ||
|
||||
(fcntl(tokenPoolWriter, F_GETFD, 0) < 0)) {
|
||||
if (fcntl(tokenPoolReader, F_GETFD, 0) < 0 ||
|
||||
fcntl(tokenPoolWriter, F_GETFD, 0) < 0) {
|
||||
tokenPoolReader = -1;
|
||||
tokenPoolWriter = -1;
|
||||
bogusJflag = true;
|
||||
|
|
@ -601,7 +601,7 @@ MainParseArgs(int argc, char **argv)
|
|||
bool inOption, dashDash = false;
|
||||
|
||||
const char *optspecs = "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstv:w";
|
||||
/* Can't actually use getopt(3) because rescanning is not portable */
|
||||
/* Can't actually use getopt(3) because rescanning is not portable */
|
||||
|
||||
rearg:
|
||||
inOption = false;
|
||||
|
|
@ -1709,7 +1709,7 @@ ReadMakefile(const char *fname)
|
|||
* placement of the setting here means it gets set to the last
|
||||
* makefile specified, as it is set by SysV make.
|
||||
*/
|
||||
found:
|
||||
found:
|
||||
if (!doing_depend)
|
||||
Var_Set(SCOPE_INTERNAL, "MAKEFILE", fname);
|
||||
Parse_File(fname, fd);
|
||||
|
|
@ -1802,7 +1802,6 @@ Cmd_Exec(const char *cmd, char **error)
|
|||
|
||||
(void)execv(shellPath, UNCONST(args));
|
||||
_exit(1);
|
||||
/* NOTREACHED */
|
||||
|
||||
case -1:
|
||||
*error = str_concat3("Couldn't exec \"", cmd, "\"");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: make.1,v 1.387 2025/07/02 17:11:56 rillig Exp $
|
||||
.\" $NetBSD: make.1,v 1.388 2025/11/12 22:14:07 sjg Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1990, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
.\"
|
||||
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
|
||||
.\"
|
||||
.Dd July 2, 2025
|
||||
.Dd November 11, 2025
|
||||
.Dt MAKE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -956,6 +956,11 @@ include additional unexpanded variable references) are shown.
|
|||
.It Va .MAKE.EXPORTED
|
||||
The list of variables exported by
|
||||
.Nm .
|
||||
.It Va MAKE_VERSION
|
||||
This variable indicates the version of
|
||||
.Nm .
|
||||
It is typically the date of last import from NetBSD.
|
||||
It is useful for checking whether certain features are available.
|
||||
.It Va MAKEFILE
|
||||
The top-level makefile that is currently read,
|
||||
as given in the command line.
|
||||
|
|
@ -1892,6 +1897,10 @@ The output of running
|
|||
is the value.
|
||||
.It Cm \&:sh
|
||||
The value is run as a command, and the output becomes the new value.
|
||||
.It Cm \&:sh1
|
||||
The value is run as a command, for the first reference only, and
|
||||
the output is cached for subsequent references.
|
||||
This modifier is useful when the result is not expected to change.
|
||||
.It Cm \&::= Ns Ar str
|
||||
The variable is assigned the value
|
||||
.Ar str
|
||||
|
|
|
|||
|
|
@ -1,3 +1,52 @@
|
|||
2025-11-18 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* sys.vars.mk: set MAKE_POSIX_SHELL to 1 if .SHELL is POSIX, 0 if not.
|
||||
set isPOSIX_SHELL for use in target scripts.
|
||||
|
||||
* meta.stage.mk: set MAKE_POSIX_SHELL if needed.
|
||||
|
||||
* install-new.mk: use ${isPOSIX_SHELL:Ufalse} to see if we can
|
||||
avoid running 'expr'.
|
||||
|
||||
* install-new.mk: Allow use of cp or mv - controlled by CPMV_OP
|
||||
(default mv).
|
||||
|
||||
2025-11-13 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* sys.vars.mk: add M_sh1 so we can handle older bmake that does
|
||||
not support :sh1
|
||||
|
||||
2025-11-11 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20251111
|
||||
|
||||
* meta2deps.sh: reset some vars for each new meta file
|
||||
set meta_file to path of meta file.
|
||||
If meta2deps appears in DEBUG_SH set -x.
|
||||
|
||||
2025-09-16 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* options.mk: Add OPTIONS_DEFAULT_DEPENDENT_REQUIRED of the form
|
||||
OPTION/REQUIRED[/VALUE]
|
||||
if OPTION is $VALUE (default is "yes"), then REQUIRED must be too.
|
||||
We add OPTIONS_DEFAULT_DEPENDENT_REQUIRED (sans any /{yes,no}) to
|
||||
OPTIONS_DEFAULT_DEPENDENT so DEPENDENT/REQUIRED follow the same
|
||||
processing.
|
||||
|
||||
Also add OPTIONS_FORCED_VALUES of the form OPTION/{yes,no}
|
||||
we add any OPTIONS_FORCED_NO and OPTIONS_FORCED_YES before
|
||||
processing.
|
||||
|
||||
Simplify the processing of OPTIONS_DEFAULT_VALUES and
|
||||
OPTIONS_DEFAULT_DEPENDENT by splitting the tuples and use two
|
||||
iterator variables in the .for loops.
|
||||
|
||||
2025-08-09 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20250808
|
||||
|
||||
* replace sjg license with just BSD-2-Clause SPDX tag
|
||||
|
||||
2025-07-24 Simon J Gerraty <sjg@beast.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20250724
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: auto.dep.mk,v 1.12 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: auto.dep.mk,v 1.13 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2010-2021, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: auto.obj.mk,v 1.20 2025/05/17 15:29:55 sjg Exp $
|
||||
# $Id: auto.obj.mk,v 1.21 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2004-2025, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: autoconf.mk,v 1.20 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: autoconf.mk,v 1.21 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1996-2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: autodep.mk,v 1.43 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: autodep.mk,v 1.44 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1999-2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: cc-wrap.mk,v 1.7 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: cc-wrap.mk,v 1.8 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2022, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: ccm.dep.mk,v 1.3 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: ccm.dep.mk,v 1.4 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: compiler.mk,v 1.14 2024/02/19 00:05:50 sjg Exp $
|
||||
# $Id: compiler.mk,v 1.15 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2019, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: cython.mk,v 1.10 2024/09/20 06:16:41 sjg Exp $
|
||||
# $Id: cython.mk,v 1.11 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2014-2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: dirdeps-cache-update.mk,v 1.23 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: dirdeps-cache-update.mk,v 1.24 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2020, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: dirdeps-options.mk,v 1.22 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: dirdeps-options.mk,v 1.23 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2018-2022, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,19 +1,11 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
# $Id: dirdeps-targets.mk,v 1.29 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: dirdeps-targets.mk,v 1.28 2024/10/19 00:47:38 sjg Exp $
|
||||
# @(#) Copyright (c) 2019-2020 Simon J. Gerraty
|
||||
#
|
||||
# @(#) Copyright (c) 2019-2020 Simon J. Gerraty
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# 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
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
#
|
||||
|
||||
##
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: dpadd.mk,v 1.33 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: dpadd.mk,v 1.34 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2004-2023, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: files.mk,v 1.8 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: files.mk,v 1.9 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2017, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: gendirdeps.mk,v 1.53 2025/05/20 17:42:49 sjg Exp $
|
||||
# $Id: gendirdeps.mk,v 1.54 2025/08/12 21:36:43 sjg Exp $
|
||||
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
|
|
@ -298,7 +298,8 @@ M2D_OBJROOTS := ${M2D_OBJROOTS:O:u:[-1..1]}
|
|||
# anything we use from an object dir other than ours
|
||||
# needs to be qualified with its .<machine> suffix
|
||||
# (we used the pseudo machine "host" for the HOST_TARGET).
|
||||
skip_ql= ${SRCTOP}* ${_objtops:@o@$o*@}
|
||||
skip_ql = ${SRCTOP}* ${_objtops:@o@$o*@}
|
||||
M_ListToSkip ?= O:u:S,^,N,:ts:
|
||||
.for o in ${M2D_OBJROOTS:${skip_ql:${M_ListToSkip}}}
|
||||
# we need := so only skip_ql to this point applies
|
||||
ql.$o := ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: genfiles.mk,v 1.4 2025/04/18 00:04:41 sjg Exp $
|
||||
# $Id: genfiles.mk,v 1.5 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2024-2025, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: host-target.mk,v 1.20 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: host-target.mk,v 1.21 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2007-2023 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
# $Id: host.libnames.mk,v 1.5 2020/08/19 17:51:53 sjg Exp $
|
||||
# $Id: host.libnames.mk,v 1.6 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2007-2009, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: inc.mk,v 1.9 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: inc.mk,v 1.10 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2008, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: init.mk,v 1.41 2025/04/18 20:49:54 sjg Exp $
|
||||
# $Id: init.mk,v 1.42 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2002-2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
11
contrib/bmake/mk/install-mk
Executable file → Normal file
11
contrib/bmake/mk/install-mk
Executable file → Normal file
|
|
@ -59,22 +59,17 @@
|
|||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
|
||||
# RCSid:
|
||||
# $Id: install-mk,v 1.268 2025/07/24 15:55:48 sjg Exp $
|
||||
# $Id: install-mk,v 1.271 2025/11/11 18:08:02 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1994-2025 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
#
|
||||
|
||||
MK_VERSION=20250724
|
||||
MK_VERSION=20251111
|
||||
OWNER=
|
||||
GROUP=
|
||||
MODE=444
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: install-new.mk,v 1.5 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: install-new.mk,v 1.9 2025/11/19 17:44:15 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2009, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
@ -17,25 +10,32 @@
|
|||
|
||||
.if !defined(InstallNew)
|
||||
|
||||
# copy if src and target are different making a backup if desired
|
||||
CmpCp= CmpCp() { \
|
||||
# How do we want CmpCpMv to do the final operation?
|
||||
# the backup (if any) will use the opposite.
|
||||
CPMV_OP ?= mv
|
||||
# clear this if not supported
|
||||
CPMV_f ?= -f
|
||||
|
||||
# copy/move if src and target are different making a backup if desired
|
||||
CmpCpMv= CmpCpMv() { \
|
||||
src=$$1 target=$$2 _bak=$$3; \
|
||||
if ! test -s $$target || ! cmp -s $$target $$src; then \
|
||||
trap "" 1 2 3 15; \
|
||||
case "/${CPMV_OP}" in */cp) bop=mv;; */mv) bop=cp;; esac; \
|
||||
if test -s $$target; then \
|
||||
if test "x$$_bak" != x; then \
|
||||
rm -f $$target$$_bak; \
|
||||
mv $$target $$target$$_bak; \
|
||||
$$bop ${CPMV_f} $$target $$target$$_bak; \
|
||||
else \
|
||||
rm -f $$target; \
|
||||
fi; \
|
||||
fi; \
|
||||
cp $$src $$target; \
|
||||
${CPMV_OP} ${CPMV_f} $$src $$target; \
|
||||
fi; }
|
||||
|
||||
# If the .new file is different, we want it.
|
||||
# Note: this function will work as is for *.new$RANDOM"
|
||||
InstallNew= ${CmpCp}; InstallNew() { \
|
||||
InstallNew= ${CmpCpMv}; InstallNew() { \
|
||||
_t=-e; _bak=; \
|
||||
while :; do \
|
||||
case "$$1" in \
|
||||
|
|
@ -46,8 +46,12 @@ InstallNew= ${CmpCp}; InstallNew() { \
|
|||
done; \
|
||||
for new in "$$@"; do \
|
||||
if test $$_t $$new; then \
|
||||
target=`expr $$new : '\(.*\).new'`; \
|
||||
CmpCp $$new $$target $$_bak; \
|
||||
if ${isPOSIX_SHELL:Ufalse}; then \
|
||||
target=$${new%.new}; \
|
||||
else \
|
||||
target=`expr $$new : '\(.*\).new'`; \
|
||||
fi; \
|
||||
CmpCpMv $$new $$target $$_bak; \
|
||||
fi; \
|
||||
rm -f $$new; \
|
||||
done; :; }
|
||||
|
|
|
|||
|
|
@ -53,19 +53,12 @@
|
|||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
#
|
||||
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: install-sh,v 1.26 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: install-sh,v 1.27 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1993-2023 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
# $Id: java.mk,v 1.18 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: java.mk,v 1.17 2024/02/17 17:26:57 sjg Exp $
|
||||
|
||||
# @(#) Copyright (c) 1998-2001, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: jobs.mk,v 1.19 2025/02/03 21:18:44 sjg Exp $
|
||||
# $Id: jobs.mk,v 1.20 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2012-2025, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: ldorder.mk,v 1.27 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: ldorder.mk,v 1.28 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2015, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: libnames.mk,v 1.10 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: libnames.mk,v 1.11 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2007-2009, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: libs.mk,v 1.8 2025/05/19 19:15:22 sjg Exp $
|
||||
# $Id: libs.mk,v 1.9 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2006, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: links.mk,v 1.10 2024/08/23 21:24:27 sjg Exp $
|
||||
# $Id: links.mk,v 1.11 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2005-2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: manifest.mk,v 1.4 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: manifest.mk,v 1.5 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2014, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: meta.autodep.mk,v 1.70 2025/05/28 20:03:00 sjg Exp $
|
||||
|
||||
# $Id: meta.autodep.mk,v 1.71 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2010-2025, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: meta.stage.mk,v 1.71 2025/03/14 20:28:42 sjg Exp $
|
||||
# $Id: meta.stage.mk,v 1.74 2025/11/19 17:44:15 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2011-2025, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
@ -38,14 +31,19 @@ CLEANFILES+= .dirdep
|
|||
@echo '${_dirdep}' > $@
|
||||
.endif
|
||||
|
||||
.if defined(NO_POSIX_SHELL) || ${type printf:L:sh:Mbuiltin} == ""
|
||||
_stage_file_basename = `basename $$f`
|
||||
_stage_file_dirname = `dirname $$f`
|
||||
_stage_target_dirname = `dirname $$t`
|
||||
.else
|
||||
.ifndef MAKE_POSIX_SHELL
|
||||
MAKE_POSIX_SHELL != (echo $${PATH%:*}) > /dev/null 2>&1 && echo 1 || echo 0
|
||||
.export MAKE_POSIX_SHELL
|
||||
.endif
|
||||
|
||||
.if ${MAKE_POSIX_SHELL}
|
||||
_stage_file_basename = $${f\#\#*/}
|
||||
_stage_file_dirname = $${f%/*}
|
||||
_stage_target_dirname = $${t%/*}
|
||||
.else
|
||||
_stage_file_basename = `basename $$f`
|
||||
_stage_file_dirname = `dirname $$f`
|
||||
_stage_target_dirname = `dirname $$t`
|
||||
.endif
|
||||
|
||||
_OBJROOT ?= ${OBJROOT:U${OBJTOP:H}}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: meta.subdir.mk,v 1.15 2024/04/19 15:10:22 sjg Exp $
|
||||
|
||||
# $Id: meta.subdir.mk,v 1.16 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2010, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: meta.sys.mk,v 1.56 2024/11/22 23:51:48 sjg Exp $
|
||||
|
||||
# $Id: meta.sys.mk,v 1.57 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2010-2023, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
|
||||
# RCSid:
|
||||
# $Id: meta2deps.sh,v 1.24 2025/07/24 15:55:48 sjg Exp $
|
||||
# $Id: meta2deps.sh,v 1.25 2025/11/11 18:08:02 sjg Exp $
|
||||
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
|
|
@ -104,6 +104,10 @@
|
|||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
case ",$DEBUG_SH," in
|
||||
*,meta2deps*) set -x;;
|
||||
esac
|
||||
|
||||
meta2src() {
|
||||
cat /dev/null "$@" |
|
||||
sed -n '/^R .*\.[chyl]$/s,^..[0-9]* ,,p' |
|
||||
|
|
@ -257,7 +261,14 @@ meta2deps() {
|
|||
# first a sanity check - filemon on Linux is not very reliable
|
||||
# path2 should only be non-empty for op L or M
|
||||
# and it should not contain spaces.
|
||||
# It will also be non-empty for # Meta line
|
||||
# which tells us which meta_file we are processing
|
||||
case "$op,$path2" in
|
||||
\#*,*.meta) # new file, reset some vars
|
||||
version=no epids= xpids= eof_token=no lpid=
|
||||
meta_file=`set -- $path2; echo $2`
|
||||
continue
|
||||
;;
|
||||
\#*) ;; # ok
|
||||
[LM],) error "missing path2 in: '$op $pid $path'";;
|
||||
[LMX],*" "*) error "wrong number of words in: '$op $pid $path $path2'";;
|
||||
|
|
@ -266,6 +277,7 @@ meta2deps() {
|
|||
esac
|
||||
# we track cwd and ldir (of interest) per pid
|
||||
# CWD is bmake's cwd
|
||||
: lpid=$lpid,pid=$pid
|
||||
case "$lpid,$pid" in
|
||||
,C) CWD=$path cwd=$path ldir=$path
|
||||
if [ -z "$SB" ]; then
|
||||
|
|
@ -274,13 +286,13 @@ meta2deps() {
|
|||
SRCTOP=${SRCTOP:-$SB/src}
|
||||
case "$verion" in
|
||||
no) ;; # ignore
|
||||
0) error "no filemon data";;
|
||||
0) error "no filemon data: $meta_file";;
|
||||
*) ;;
|
||||
esac
|
||||
version=0
|
||||
case "$eof_token" in
|
||||
no) ;; # ignore
|
||||
0) error "truncated filemon data";;
|
||||
0) error "truncated filemon data: $meta_file";;
|
||||
esac
|
||||
eof_token=0
|
||||
continue
|
||||
|
|
@ -422,18 +434,18 @@ meta2deps() {
|
|||
done > $tf.dirdep
|
||||
: version=$version
|
||||
case "$version" in
|
||||
0) error "no filemon data";;
|
||||
0) error "no filemon data: $meta_file";;
|
||||
esac
|
||||
: eof_token=$eof_token
|
||||
case "$eof_token" in
|
||||
0) error "truncated filemon data";;
|
||||
0) error "truncated filemon data: $meta_file";;
|
||||
esac
|
||||
for p in $epids
|
||||
do
|
||||
: p=$p
|
||||
case " $xpids " in
|
||||
*" $p "*) ;;
|
||||
*) error "missing eXit for pid $p";;
|
||||
*) error "missing eXit for pid $p: $meta_file";;
|
||||
esac
|
||||
done ) || exit 1
|
||||
_nl=echo
|
||||
|
|
|
|||
|
|
@ -1,17 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: mkopt.sh,v 1.17 2025/05/22 22:35:14 sjg Exp $
|
||||
# $Id: mkopt.sh,v 1.18 2025/08/07 21:59:54 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2014-2025, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -81,18 +81,11 @@
|
|||
#
|
||||
|
||||
# RCSid:
|
||||
# $Id: newlog.sh,v 1.30 2025/06/01 05:07:48 sjg Exp $
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
# $Id: newlog.sh,v 1.31 2025/08/07 22:07:13 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1993-2025 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: obj.mk,v 1.19 2024/02/19 00:06:19 sjg Exp $
|
||||
# $Id: obj.mk,v 1.20 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1999-2010, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
# $Id: options.mk,v 1.25 2025/09/18 05:11:59 sjg Exp $
|
||||
#
|
||||
# $Id: options.mk,v 1.22 2024/10/27 17:33:03 sjg Exp $
|
||||
# @(#) Copyright (c) 2012-2025, Simon J. Gerraty
|
||||
#
|
||||
# @(#) Copyright (c) 2012, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
@ -17,6 +10,31 @@
|
|||
|
||||
# Inspired by FreeBSD bsd.own.mk, but intentionally simpler and more flexible.
|
||||
|
||||
OPTION_PREFIX ?= MK_
|
||||
|
||||
# Options to be forced either "yes" or "no"
|
||||
OPTIONS_FORCED_VALUES += \
|
||||
${OPTIONS_BROKEN:U:O:u:S,$,/no,:N/no} \
|
||||
${OPTIONS_FORCED_NO:U:O:u:S,$,/no,:N/no} \
|
||||
${OPTIONS_FORCED_YES:U:O:u:S,$,/yes,:N/yes} \
|
||||
${OPTIONS_REQUIRED:U:O:u:S,$,/yes,:N/yes} \
|
||||
|
||||
.for o v in ${OPTIONS_FORCED_VALUES:M*/*:S,/, ,g}
|
||||
.if !make(show-options)
|
||||
.if ${v:tl} == "yes"
|
||||
.if defined(WITHOUT_$o)
|
||||
.warning WITHOUT_$o ignored
|
||||
.endif
|
||||
.elif defined(WITH_$o)
|
||||
.warning WITH_$o ignored
|
||||
.endif
|
||||
.endif
|
||||
${OPTION_PREFIX}$o := ${v:tl}
|
||||
.if defined(DEBUG_OPTIONS) && ${DEBUG_OPTIONS:@x@${o:M$x}@} != ""
|
||||
.info ${.INCLUDEDFROMFILE}: ${OPTION_PREFIX}$o=${${OPTION_PREFIX}$o}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
# Options are normally listed in either OPTIONS_DEFAULT_{YES,NO}
|
||||
# We convert these to ${OPTION}/{yes,no} in OPTIONS_DEFAULT_VALUES.
|
||||
# We add the OPTIONS_DEFAULT_NO first so they take precedence.
|
||||
|
|
@ -28,72 +46,104 @@
|
|||
# User sets WITH_* and WITHOUT_* to indicate what they want.
|
||||
# We set ${OPTION_PREFIX:UMK_}* which is then all we need care about.
|
||||
OPTIONS_DEFAULT_VALUES += \
|
||||
${OPTIONS_DEFAULT_NO:U:O:u:S,$,/no,} \
|
||||
${OPTIONS_DEFAULT_YES:U:O:u:S,$,/yes,}
|
||||
|
||||
OPTION_PREFIX ?= MK_
|
||||
${OPTIONS_DEFAULT_NO:U:O:u:S,$,/no,:N/no} \
|
||||
${OPTIONS_DEFAULT_YES:U:O:u:S,$,/yes,:N/yes} \
|
||||
|
||||
# NO_* takes precedence
|
||||
# If both WITH_* and WITHOUT_* are defined, WITHOUT_ wins unless
|
||||
# DOMINANT_* is set to "yes"
|
||||
# OPTION_DOMINANT_* is set to "yes"
|
||||
# Otherwise WITH_* and WITHOUT_* override the default.
|
||||
.for o in ${OPTIONS_DEFAULT_VALUES:M*/*}
|
||||
.if defined(WITH_${o:H}) && ${WITH_${o:H}} == "no"
|
||||
.for o v in ${OPTIONS_DEFAULT_VALUES:M*/*:S,/, ,}
|
||||
.if defined(WITH_$o) && ${WITH_$o:tl} == "no"
|
||||
# a common miss-use - point out correct usage
|
||||
.warning use WITHOUT_${o:H}=1 not WITH_${o:H}=no
|
||||
.warning use WITHOUT_$o=1 not WITH_$o=no
|
||||
WITHOUT_$o = 1
|
||||
.endif
|
||||
.if defined(NO_${o:H}) || defined(NO${o:H})
|
||||
.if defined(NO_$o) || defined(NO$o)
|
||||
# we cannot do it
|
||||
${OPTION_PREFIX}${o:H} ?= no
|
||||
.elif defined(WITH_${o:H}) && defined(WITHOUT_${o:H})
|
||||
${OPTION_PREFIX}$o ?= no
|
||||
.elif defined(WITH_$o) && defined(WITHOUT_$o)
|
||||
# normally WITHOUT_ wins
|
||||
DOMINANT_${o:H} ?= no
|
||||
${OPTION_PREFIX}${o:H} ?= ${DOMINANT_${o:H}}
|
||||
.elif ${o:T:tl} == "no"
|
||||
.if defined(WITH_${o:H})
|
||||
${OPTION_PREFIX}${o:H} ?= yes
|
||||
OPTION_DOMINANT_$o ?= no
|
||||
${OPTION_PREFIX}$o ?= ${OPTION_DOMINANT_$o}
|
||||
.elif ${v:tl} == "no"
|
||||
.if defined(WITH_$o)
|
||||
${OPTION_PREFIX}$o ?= yes
|
||||
.else
|
||||
${OPTION_PREFIX}${o:H} ?= no
|
||||
${OPTION_PREFIX}$o ?= no
|
||||
.endif
|
||||
.else
|
||||
.if defined(WITHOUT_${o:H})
|
||||
${OPTION_PREFIX}${o:H} ?= no
|
||||
.if defined(WITHOUT_$o)
|
||||
${OPTION_PREFIX}$o ?= no
|
||||
.else
|
||||
${OPTION_PREFIX}${o:H} ?= yes
|
||||
${OPTION_PREFIX}$o ?= yes
|
||||
.endif
|
||||
.endif
|
||||
.if defined(DEBUG_OPTIONS) && ${DEBUG_OPTIONS:@x@${o:H:M$x}@} != ""
|
||||
.info ${.INCLUDEDFROMFILE}: ${OPTION_PREFIX}${o:H}=${${OPTION_PREFIX}${o:H}}
|
||||
.if defined(DEBUG_OPTIONS) && ${DEBUG_OPTIONS:@x@${o:M$x}@} != ""
|
||||
.info ${.INCLUDEDFROMFILE}: ${OPTION_PREFIX}$o=${${OPTION_PREFIX}$o}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
# OPTIONS_DEFAULT_DEPENDENT += FOO_UTILS/FOO
|
||||
# If neither WITH[OUT]_FOO_UTILS is set, (see rules above)
|
||||
# use the value of ${OPTION_PREFIX}FOO
|
||||
.for o in ${OPTIONS_DEFAULT_DEPENDENT:M*/*:O:u}
|
||||
.if defined(NO_${o:H}) || defined(NO${o:H})
|
||||
# Add OPTIONS_DEFAULT_DEPENDENT_REQUIRED (sans any trailing /{yes,no})
|
||||
# to OPTIONS_DEFAULT_DEPENDENT to avoid the need to duplicate entries
|
||||
OPTIONS_DEFAULT_DEPENDENT += ${OPTIONS_DEFAULT_DEPENDENT_REQUIRED:U:S,/yes$,,:S,/no$,,}
|
||||
|
||||
.for o d in ${OPTIONS_DEFAULT_DEPENDENT:M*/*:S,/, ,}
|
||||
.if defined(NO_$o) || defined(NO$o)
|
||||
# we cannot do it
|
||||
${OPTION_PREFIX}${o:H} ?= no
|
||||
.elif defined(WITH_${o:H}) && defined(WITHOUT_${o:H})
|
||||
${OPTION_PREFIX}$o ?= no
|
||||
.elif defined(WITH_$o) && defined(WITHOUT_$o)
|
||||
# normally WITHOUT_ wins
|
||||
DOMINANT_${o:H} ?= no
|
||||
${OPTION_PREFIX}${o:H} ?= ${DOMINANT_${o:H}}
|
||||
.elif defined(WITH_${o:H})
|
||||
${OPTION_PREFIX}${o:H} ?= yes
|
||||
.elif defined(WITHOUT_${o:H})
|
||||
${OPTION_PREFIX}${o:H} ?= no
|
||||
OPTION_DOMINANT_$o ?= no
|
||||
${OPTION_PREFIX}$o ?= ${OPTION_DOMINANT_$o}
|
||||
.elif defined(WITH_$o)
|
||||
${OPTION_PREFIX}$o ?= yes
|
||||
.elif defined(WITHOUT_$o)
|
||||
${OPTION_PREFIX}$o ?= no
|
||||
.else
|
||||
${OPTION_PREFIX}${o:H} ?= ${${OPTION_PREFIX}${o:T}}
|
||||
${OPTION_PREFIX}$o ?= ${${OPTION_PREFIX}$d}
|
||||
.endif
|
||||
.if defined(DEBUG_OPTIONS) && ${DEBUG_OPTIONS:@x@${o:H:M$x}@} != ""
|
||||
.info ${.INCLUDEDFROMFILE}: ${OPTION_PREFIX}${o:H}=${${OPTION_PREFIX}${o:H}} (${OPTION_PREFIX}${o:T}=${${OPTION_PREFIX}${o:T}})
|
||||
.if defined(DEBUG_OPTIONS) && ${DEBUG_OPTIONS:@x@${o:M$x}@} != ""
|
||||
.info ${.INCLUDEDFROMFILE}: ${OPTION_PREFIX}$o=${${OPTION_PREFIX}$o} (${OPTION_PREFIX}$d=${${OPTION_PREFIX}$d})
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
# OPTIONS_DEFAULT_DEPENDENT_REQUIRED += FOO_UTILS/FOO[/{yes,no}]
|
||||
# first processed with OPTIONS_DEFAULT_DEPENDENT above,
|
||||
# but if ${OPTION_PREFIX}${o:H:H} is ${o:T},
|
||||
# then ${OPTION_PREFIX}${o:H:T} must be too
|
||||
.for o in ${OPTIONS_DEFAULT_DEPENDENT_REQUIRED:M*/*:O:u}
|
||||
# This dance allows /{yes,no} to be optional
|
||||
.if ${o:T:tl:Nno:Nyes} == ""
|
||||
$o.H := ${o:H:H}
|
||||
$o.R := ${o:T}
|
||||
$o.T := ${o:H:T}
|
||||
.else
|
||||
$o.H := ${o:H}
|
||||
$o.R := ${OPTION_REQUIRED_${o:H}:Uyes}
|
||||
$o.T := ${o:T}
|
||||
.endif
|
||||
.if defined(DEBUG_OPTIONS) && ${DEBUG_OPTIONS:@x@${$o.H:M$x}@} != ""
|
||||
.info ${.INCLUDEDFROMFILE}: ${OPTION_PREFIX}${$o.H}=${${OPTION_PREFIX}${$o.H}} (${OPTION_PREFIX}${$o.T}=${${OPTION_PREFIX}${$o.T}} require=${$o.R})
|
||||
.endif
|
||||
.if ${${OPTION_PREFIX}${$o.H}} != ${${OPTION_PREFIX}${$o.T}}
|
||||
.if ${${OPTION_PREFIX}${$o.H}} == ${$o.R}
|
||||
.error ${OPTION_PREFIX}${$o.H}=${${OPTION_PREFIX}${$o.H}} requires ${OPTION_PREFIX}${$o.T}=${${OPTION_PREFIX}${$o.H}}
|
||||
.endif
|
||||
.endif
|
||||
.undef $o.H
|
||||
.undef $o.R
|
||||
.undef $o.T
|
||||
.endfor
|
||||
|
||||
# allow displaying/describing set options
|
||||
.set_options := ${.set_options} \
|
||||
${OPTIONS_DEFAULT_VALUES:H:N.} \
|
||||
${OPTIONS_DEFAULT_VALUES:U:H:N.} \
|
||||
${OPTIONS_DEFAULT_DEPENDENT:U:H:N.} \
|
||||
${OPTIONS_FORCED_VALUES:U:H:N.} \
|
||||
|
||||
# this can be used in .info as well as target below
|
||||
OPTIONS_SHOW ?= ${.set_options:O:u:@o@${OPTION_PREFIX}$o=${${OPTION_PREFIX}$o}@}
|
||||
|
|
@ -114,7 +164,13 @@ describe-options: .NOTMAIN .PHONY
|
|||
.endif
|
||||
|
||||
# we expect to be included more than once
|
||||
.undef OPTIONS_BROKEN
|
||||
.undef OPTIONS_DEFAULT_DEPENDENT
|
||||
.undef OPTIONS_DEFAULT_DEPENDENT_REQUIRED
|
||||
.undef OPTIONS_DEFAULT_NO
|
||||
.undef OPTIONS_DEFAULT_VALUES
|
||||
.undef OPTIONS_DEFAULT_YES
|
||||
.undef OPTIONS_FORCED_NO
|
||||
.undef OPTIONS_FORCED_VALUES
|
||||
.undef OPTIONS_FORCED_YES
|
||||
.undef OPTIONS_REQUIRED
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: posix.mk,v 1.3 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: posix.mk,v 1.4 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2022, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: prlist.mk,v 1.6 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: prlist.mk,v 1.7 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2006, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: progs.mk,v 1.19 2025/05/19 19:15:22 sjg Exp $
|
||||
# $Id: progs.mk,v 1.20 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2006, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: rst2htm.mk,v 1.16 2025/04/16 00:42:07 sjg Exp $
|
||||
# $Id: rst2htm.mk,v 1.17 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2009, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: rust.mk,v 1.37 2025/01/11 03:17:36 sjg Exp $
|
||||
# $Id: rust.mk,v 1.38 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: scripts.mk,v 1.5 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: scripts.mk,v 1.6 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2006, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -50,16 +50,11 @@
|
|||
#
|
||||
|
||||
# RCSid:
|
||||
# $Id: setopts.sh,v 1.15 2025/06/01 02:10:31 sjg Exp $
|
||||
# $Id: setopts.sh,v 1.16 2025/08/07 21:59:54 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1995-2025 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: srctop.mk,v 1.5 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: srctop.mk,v 1.6 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2012, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -37,18 +37,13 @@
|
|||
#
|
||||
|
||||
# RCSid:
|
||||
# $Id: stage-install.sh,v 1.11 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: stage-install.sh,v 1.12 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# @(#) Copyright (c) 2013-2020, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: subdir.mk,v 1.27 2024/09/01 05:02:43 sjg Exp $
|
||||
# $Id: subdir.mk,v 1.28 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2002-2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: suffixes.mk,v 1.3 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: suffixes.mk,v 1.4 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2024, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: sys.clean-env.mk,v 1.26 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: sys.clean-env.mk,v 1.27 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2009, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: sys.debug.mk,v 1.3 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: sys.debug.mk,v 1.4 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2009, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: sys.dependfile.mk,v 1.11 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: sys.dependfile.mk,v 1.12 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2012-2023, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: sys.dirdeps.mk,v 1.15 2024/04/18 17:18:31 sjg Exp $
|
||||
# $Id: sys.dirdeps.mk,v 1.16 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2012-2023, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: sys.mk,v 1.62 2025/05/19 19:15:22 sjg Exp $
|
||||
# $Id: sys.mk,v 1.66 2025/11/19 03:38:20 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2003-2023, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: sys.vars.mk,v 1.18 2025/03/09 02:47:59 sjg Exp $
|
||||
# $Id: sys.vars.mk,v 1.24 2025/11/19 17:44:15 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2003-2023, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
@ -37,6 +30,22 @@ _this = ${.PARSEDIR}/${.PARSEFILE}
|
|||
_this = ${.PARSEDIR:tA}/${.PARSEFILE}
|
||||
.endif
|
||||
|
||||
# This is a boolean we can use in makefiles as below
|
||||
.ifndef MAKE_POSIX_SHELL
|
||||
MAKE_POSIX_SHELL != (echo $${PATH%:*}) > /dev/null 2>&1 && echo 1 || echo 0
|
||||
.export MAKE_POSIX_SHELL
|
||||
.endif
|
||||
|
||||
# This is a boolean we can use in target scripts
|
||||
.ifndef isPOSIX_SHELL
|
||||
.if ${MAKE_POSIX_SHELL}
|
||||
isPOSIX_SHELL = :
|
||||
.else
|
||||
isPOSIX_SHELL = false
|
||||
.endif
|
||||
.export isPOSIX_SHELL
|
||||
.endif
|
||||
|
||||
# some useful modifiers
|
||||
|
||||
# A useful trick for testing multiple :M's against something
|
||||
|
|
@ -56,8 +65,15 @@ M_ListToSkip= O:u:S,^,N,:ts:
|
|||
_type_sh = which
|
||||
.endif
|
||||
|
||||
# :sh1 evaluates command only once and caches the result.
|
||||
.if ${MAKE_VERSION} < 20251111
|
||||
M_sh1 = sh
|
||||
.else
|
||||
M_sh1 = sh1
|
||||
.endif
|
||||
|
||||
# AUTOCONF := ${autoconf:L:${M_whence}}
|
||||
M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g
|
||||
M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:${M_sh1:Ush}:[0]:N* found*:[@]:C,[()],,g
|
||||
M_whence = ${M_type}:M/*:[1]
|
||||
|
||||
# produce similar output to jot(1) or seq(1)
|
||||
|
|
|
|||
|
|
@ -34,21 +34,12 @@
|
|||
#
|
||||
# Only works with a make(1) that does nested evaluation correctly.
|
||||
|
||||
|
||||
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: target-flags.mk,v 1.11 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: target-flags.mk,v 1.12 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1998-2002, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# RCSid:
|
||||
# $Id: warnings.mk,v 1.18 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: warnings.mk,v 1.19 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2002-2023, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: whats.mk,v 1.12 2024/02/17 17:26:57 sjg Exp $
|
||||
# $Id: whats.mk,v 1.13 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2014-2020, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# $Id: yacc.mk,v 1.9 2024/02/17 17:26:57 sjg Exp $
|
||||
|
||||
# $Id: yacc.mk,v 1.10 2025/08/09 22:42:24 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1999-2011, 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -17,16 +17,11 @@
|
|||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
|
||||
# RCSid:
|
||||
# $Id: os.sh,v 1.67 2025/02/13 21:04:34 sjg Exp $
|
||||
# $Id: os.sh,v 1.68 2025/08/07 21:59:54 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1994 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.
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Please send copies of changes and bug-fixes to:
|
||||
# sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -104,24 +104,16 @@
|
|||
* Simon J. Gerraty <sjg@crufty.net>
|
||||
*/
|
||||
/* COPYRIGHT:
|
||||
* @(#)Copyright (c) 1992-2021, Simon J. Gerraty
|
||||
* @(#)Copyright (c) 1992-2025, Simon J. Gerraty
|
||||
*
|
||||
* This is free software. It comes with NO WARRANTY.
|
||||
* Permission to use, modify and distribute this source code
|
||||
* is granted subject to the following conditions.
|
||||
* 1/ that that the above copyright notice and this notice
|
||||
* are preserved in all copies and that due credit be given
|
||||
* to the author.
|
||||
* 2/ that any changes to this code are clearly commented
|
||||
* as such so that the author does get blamed for bugs
|
||||
* other than his own.
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Please send copies of changes and bug-fixes to:
|
||||
* sjg@crufty.net
|
||||
*
|
||||
*/
|
||||
#ifndef lint
|
||||
static char *RCSid = "$Id: sigact.c,v 1.8 2021/10/14 19:39:17 sjg Exp $";
|
||||
static char *RCSid = "$Id: sigact.c,v 1.9 2025/08/09 22:11:45 sjg Exp $";
|
||||
#endif
|
||||
|
||||
#undef _ANSI_SOURCE /* causes problems */
|
||||
|
|
|
|||
|
|
@ -37,17 +37,9 @@
|
|||
* Simon J. Gerraty <sjg@crufty.net>
|
||||
*/
|
||||
/*
|
||||
* @(#)Copyright (c) 1994, Simon J. Gerraty.
|
||||
* @(#)Copyright (c) 1994-2025, Simon J. Gerraty.
|
||||
*
|
||||
* This is free software. It comes with NO WARRANTY.
|
||||
* Permission to use, modify and distribute this source code
|
||||
* is granted subject to the following conditions.
|
||||
* 1/ that the above copyright notice and this notice
|
||||
* are preserved in all copies and that due credit be given
|
||||
* to the author.
|
||||
* 2/ that any changes to this code are clearly commented
|
||||
* as such so that the author does not get blamed for bugs
|
||||
* other than his own.
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Please send copies of changes and bug-fixes to:
|
||||
* sjg@crufty.net
|
||||
|
|
@ -104,7 +96,7 @@
|
|||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/*static char *sccsid = "from: @(#)sigcompat.c 5.3 (Berkeley) 2/24/91";*/
|
||||
static char *rcsid = "$Id: sigcompat.c,v 1.24 2022/09/26 17:38:10 sjg Exp $";
|
||||
static char *rcsid = "$Id: sigcompat.c,v 1.25 2025/08/09 22:11:45 sjg Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#undef signal
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# $Id: Makefile,v 1.245 2025/08/05 16:18:07 sjg Exp $
|
||||
# $Id: Makefile,v 1.251 2025/11/15 17:17:18 sjg Exp $
|
||||
#
|
||||
# $NetBSD: Makefile,v 1.372 2025/08/04 22:44:49 sjg Exp $
|
||||
# $NetBSD: Makefile,v 1.373 2025/11/12 22:14:08 sjg Exp $
|
||||
#
|
||||
# Unit tests for make(1)
|
||||
#
|
||||
|
|
@ -403,6 +403,7 @@ TESTS+= varmod-shell
|
|||
TESTS+= varmod-subst
|
||||
TESTS+= varmod-subst-regex
|
||||
TESTS+= varmod-sun-shell
|
||||
TESTS+= varmod-sun-shell1
|
||||
TESTS+= varmod-sysv
|
||||
TESTS+= varmod-tail
|
||||
TESTS+= varmod-to-abs
|
||||
|
|
@ -519,6 +520,14 @@ BROKEN_TESTS+= \
|
|||
|
||||
.endif
|
||||
|
||||
.if ${.MAKE.OS:NMINGW*} == ""
|
||||
BROKEN_TESTS+= \
|
||||
cmdline \
|
||||
objdir-writable \
|
||||
varname-dot-make-level \
|
||||
|
||||
.endif
|
||||
|
||||
.if ${.MAKE.OS} == "SCO_SV"
|
||||
BROKEN_TESTS+= \
|
||||
opt-debug-graph[23] \
|
||||
|
|
@ -594,8 +603,12 @@ SED_CMDS.directive-include-guard= \
|
|||
-e '/^ParseEOF:/d'
|
||||
SED_CMDS.export= -e '/^[^=_A-Za-z0-9]*=/d'
|
||||
SED_CMDS.export+= -e '/^DIFF/d'
|
||||
.if ${.MAKE.OS:NCygwin} == ""
|
||||
SED_CMDS.export+= -e '/^WINDIR=/d' -e '/^SYSTEMROOT=/d'
|
||||
.if ${.MAKE.OS:NCygwin:NMINGW*} == ""
|
||||
SED_CMDS.export+= \
|
||||
-e '/MSYSTEM=/d' \
|
||||
-e '/^SYSTEMROOT=/d' \
|
||||
-e '/^WINDIR=/d' \
|
||||
|
||||
.endif
|
||||
SED_CMDS.export-all= ${SED_CMDS.export}
|
||||
SED_CMDS.export-env= ${SED_CMDS.export}
|
||||
|
|
@ -847,6 +860,12 @@ _SED_CMDS+= -e 's,${.CURDIR},<curdir>,g'
|
|||
# which we get depending on how MAKEOBJDIR is set.
|
||||
_SED_CMDS+= -e 's,${.OBJDIR},<curdir>,g' -e 's,${.OBJDIR:tA},<curdir>,g'
|
||||
.endif
|
||||
|
||||
# At the end, make sure we cleanup any dregs...
|
||||
.for d in ${MAKEOBJDIRPREFIX:S,/$,,} /usr/obj
|
||||
_SED_CMDS_LAST+= -e 's,$d,,'
|
||||
.endfor
|
||||
|
||||
# always pretend .MAKE was called 'make'
|
||||
_SED_CMDS+= -e 's,^${TEST_MAKE:T:S,.,\\.,g}[][0-9]*:,make:,'
|
||||
_SED_CMDS+= -e 's,${TEST_MAKE:S,.,\\.,g},make,'
|
||||
|
|
@ -868,7 +887,7 @@ SED_CMDS.opt-debug-jobs+= -e 's,Command: <shell> -v,Command: <shell>,'
|
|||
.endif
|
||||
|
||||
.rawout.out:
|
||||
@${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \
|
||||
@${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} ${_SED_CMDS_LAST} \
|
||||
< ${.IMPSRC} > ${.TARGET}.tmp
|
||||
@${POSTPROC.${.PREFIX:T}:D \
|
||||
${POSTPROC.${.PREFIX:T}} < ${.TARGET}.tmp > ${.TARGET}.post \
|
||||
|
|
@ -895,7 +914,7 @@ test: ${OUTFILES} .PHONY
|
|||
echo "Failed tests: $${failed}" ; false ; \
|
||||
else \
|
||||
echo "All tests passed" ; \
|
||||
lua=${LUA:Ulua} ; \
|
||||
lua=${LUA} ; lua=$${lua:-lua}; \
|
||||
have_lua=$$("$$lua" -e 'print "yes"' 2>&1) ; \
|
||||
if [ "$$have_lua" = "yes" -a -s ${.CURDIR}/check-expect.lua ]; then \
|
||||
(cd ${.CURDIR} && "$$lua" ./check-expect.lua *.mk); \
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# $Id: Makefile.config.in,v 1.4 2022/09/09 18:44:56 sjg Exp $
|
||||
# $Id: Makefile.config.in,v 1.5 2025/10/22 23:20:41 sjg Exp $
|
||||
|
||||
srcdir= @srcdir@
|
||||
EGREP= @egrep@
|
||||
TOOL_DIFF?= @diff@
|
||||
DIFF_FLAGS?= @diff_u@
|
||||
EGREP= @egrep@
|
||||
LUA?= @lua@
|
||||
TOOL_DIFF?= @diff@
|
||||
UTC_1= @UTC_1@
|
||||
srcdir= @srcdir@
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# Errors that are not related to opening the file are still reported.
|
||||
# expect: make: directive-dinclude-error.inc:1: Invalid line "syntax error"
|
||||
_!= echo 'syntax error' > directive-dinclude-error.inc
|
||||
.dinclude "${.CURDIR}/directive-dinclude-error.inc"
|
||||
.dinclude "${.OBJDIR}/directive-dinclude-error.inc"
|
||||
_!= rm directive-dinclude-error.inc
|
||||
|
||||
all: .PHONY
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
# Errors that are not related to opening the file are still reported.
|
||||
# expect: make: directive-hyphen-include-error.inc:1: Invalid line "syntax error"
|
||||
_!= echo 'syntax error' > directive-hyphen-include-error.inc
|
||||
.-include "${.CURDIR}/directive-hyphen-include-error.inc"
|
||||
.-include "${.OBJDIR}/directive-hyphen-include-error.inc"
|
||||
_!= rm directive-hyphen-include-error.inc
|
||||
|
||||
all: .PHONY
|
||||
|
|
|
|||
|
|
@ -636,9 +636,9 @@ LINES.multiline= \
|
|||
_:= ${fname:H:N.:@dir@${:!mkdir -p ${dir}!}@}
|
||||
_!= printf '%s\n' ${LINES.$i} > ${fname}
|
||||
.MAKEFLAGS: -dp
|
||||
.include "${.CURDIR}/${fname}"
|
||||
.include "${.OBJDIR}/${fname}"
|
||||
.undef ${UNDEF_BETWEEN.$i:U}
|
||||
.include "${.CURDIR}/${fname}"
|
||||
.include "${.OBJDIR}/${fname}"
|
||||
.MAKEFLAGS: -d0
|
||||
_!= rm ${fname}
|
||||
_:= ${fname:H:N.:@dir@${:!rmdir ${dir}!}@}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ include
|
|||
# Buf_InitSize, which assumes that bmake_malloc never returns NULL, just like
|
||||
# all other places in the code.
|
||||
_!= > directive-include-empty
|
||||
.include "${.CURDIR}/directive-include-empty"
|
||||
.include "${.OBJDIR}/directive-include-empty"
|
||||
_!= rm directive-include-empty
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
# Errors that are not related to opening the file are still reported.
|
||||
# expect: make: directive-include-error.inc:1: Invalid line "syntax error"
|
||||
_!= echo 'syntax error' > directive-include-error.inc
|
||||
.sinclude "${.CURDIR}/directive-include-error.inc"
|
||||
.sinclude "${.OBJDIR}/directive-include-error.inc"
|
||||
_!= rm directive-include-error.inc
|
||||
|
||||
all: .PHONY
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
make: opt-debug-file.mk:54: This goes to stderr only, once.
|
||||
make: opt-debug-file.mk:54: This goes to stdout only, once.
|
||||
make: opt-debug-file.mk:57: This goes to stderr only, once.
|
||||
make: opt-debug-file.mk:60: This goes to stderr, and in addition to the debug log.
|
||||
CondParser_Eval: ${:!cat opt-debug-file.debuglog!:Maddition:[#]} != 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: opt-debug-file.mk,v 1.12 2025/07/06 08:48:34 rillig Exp $
|
||||
# $NetBSD: opt-debug-file.mk,v 1.13 2025/08/09 23:09:55 rillig Exp $
|
||||
#
|
||||
# Tests for the -dF command line option, which redirects the debug log
|
||||
# to a file instead of writing it to stderr.
|
||||
|
|
@ -50,8 +50,8 @@ DEBUG_OUTPUT:= ${:!cat opt-debug-file.debuglog!:S,\$,\$\$,g}
|
|||
|
||||
# See Parse_Error.
|
||||
.MAKEFLAGS: -dFstdout
|
||||
# expect+1: This goes to stderr only, once.
|
||||
. info This goes to stderr only, once.
|
||||
# expect+1: This goes to stdout only, once.
|
||||
. info This goes to stdout only, once.
|
||||
.MAKEFLAGS: -dFstderr
|
||||
# expect+1: This goes to stderr only, once.
|
||||
. info This goes to stderr only, once.
|
||||
|
|
|
|||
14
contrib/bmake/unit-tests/varmod-sun-shell1.exp
Normal file
14
contrib/bmake/unit-tests/varmod-sun-shell1.exp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Global: _ = # (empty)
|
||||
Var_Parse: ${THE_ANSWER} (eval-keep-dollar-and-undefined)
|
||||
Var_Parse: ${ANSWER:sh1} (eval-keep-dollar-and-undefined)
|
||||
Evaluating modifier ${ANSWER:s...} on value "echo 42; (exit 13)" (eval-keep-dollar-and-undefined, regular)
|
||||
Capturing the output of command "echo 42; (exit 13)"
|
||||
Global: ignoring delete '.SHELL' as it is not found
|
||||
Command: .SHELL = /bin/sh
|
||||
make: varmod-sun-shell1.mk:17: warning: Command "echo 42; (exit 13)" exited with status 13
|
||||
Global: .MAKE.SH1.ANSWER = 42
|
||||
Result of ${ANSWER:sh1} is "42" (eval-keep-dollar-and-undefined, regular)
|
||||
Global: _ = 42
|
||||
Global: .MAKEFLAGS = -r -k -d v -d
|
||||
Global: .MAKEFLAGS = -r -k -d v -d 0
|
||||
exit status 0
|
||||
25
contrib/bmake/unit-tests/varmod-sun-shell1.mk
Normal file
25
contrib/bmake/unit-tests/varmod-sun-shell1.mk
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# $NetBSD: varmod-sun-shell1.mk,v 1.1 2025/11/12 22:14:08 sjg Exp $
|
||||
#
|
||||
# Tests for the :sh1 variable modifier, which runs the shell command
|
||||
# given by the variable value only on first reference and caches its output.
|
||||
#
|
||||
# This modifier has been added on 2025-11-11
|
||||
#
|
||||
# See also:
|
||||
# ApplyModifier_SunShell1
|
||||
|
||||
ANSWER= echo 42; (exit 13)
|
||||
THE_ANSWER= ${ANSWER:sh1}
|
||||
|
||||
# first reference will warn
|
||||
.MAKEFLAGS: -dv # to see the "Capturing" debug output
|
||||
# expect+1: warning: Command "echo 42; (exit 13)" exited with status 13
|
||||
_:= ${THE_ANSWER}
|
||||
.MAKEFLAGS: -d0
|
||||
|
||||
# subsequent references will not, since we do not execute a command
|
||||
.if ${THE_ANSWER} != "42"
|
||||
. error
|
||||
.endif
|
||||
|
||||
all:
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
# $NetBSD: varname-circumflex.mk,v 1.1 2025/06/27 20:20:56 rillig Exp $
|
||||
# $NetBSD: varname-circumflex.mk,v 1.2 2025/08/09 23:13:29 rillig Exp $
|
||||
#
|
||||
# Tests for the target-local variable "^", which is required by POSIX 2024
|
||||
# and provided by GNU make.
|
||||
#
|
||||
# https://gnats.netbsd.org/59018
|
||||
|
||||
# TODO: Support $^.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: var.c,v 1.1171 2025/06/29 11:02:17 rillig Exp $ */
|
||||
/* $NetBSD: var.c,v 1.1173 2025/11/12 22:14:07 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
#endif
|
||||
|
||||
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
|
||||
MAKE_RCSID("$NetBSD: var.c,v 1.1171 2025/06/29 11:02:17 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: var.c,v 1.1173 2025/11/12 22:14:07 sjg Exp $");
|
||||
|
||||
/*
|
||||
* Variables are defined using one of the VAR=value assignments. Their
|
||||
|
|
@ -1866,7 +1866,7 @@ QuoteShell(const char *str, bool quoteDollar, LazyBuf *buf)
|
|||
static char *
|
||||
Hash(const char *str)
|
||||
{
|
||||
static const char hexdigits[16] = "0123456789abcdef";
|
||||
static const char hexdigits[] = "0123456789abcdef";
|
||||
const unsigned char *ustr = (const unsigned char *)str;
|
||||
|
||||
uint32_t h = 0x971e137bU;
|
||||
|
|
@ -3810,6 +3810,44 @@ ApplyModifier_SunShell(const char **pp, ModChain *ch)
|
|||
return AMR_OK;
|
||||
}
|
||||
|
||||
/* :sh1 */
|
||||
static ApplyModifierResult
|
||||
ApplyModifier_SunShell1(const char **pp, ModChain *ch)
|
||||
{
|
||||
Expr *expr = ch->expr;
|
||||
const char *p = *pp;
|
||||
|
||||
if (!(p[1] == 'h' && p[2] == '1' && IsDelimiter(p[3], ch)))
|
||||
return AMR_UNKNOWN;
|
||||
*pp = p + 3;
|
||||
|
||||
if (Expr_ShouldEval(expr)) {
|
||||
char *cache_varname;
|
||||
Var *v;
|
||||
|
||||
cache_varname = str_concat2(".MAKE.SH1.", expr->name);
|
||||
v = VarFind(cache_varname, SCOPE_GLOBAL, false);
|
||||
if (v == NULL) {
|
||||
char *output, *error;
|
||||
|
||||
output = Cmd_Exec(Expr_Str(expr), &error);
|
||||
if (error != NULL) {
|
||||
Parse_Error(PARSE_WARNING, "%s", error);
|
||||
free(error);
|
||||
}
|
||||
Var_SetWithFlags(SCOPE_GLOBAL, cache_varname, output,
|
||||
VAR_SET_NO_EXPORT);
|
||||
Expr_SetValueOwn(expr, output);
|
||||
} else {
|
||||
Expr_SetValueRefer(expr, v->val.data);
|
||||
}
|
||||
free(cache_varname);
|
||||
}
|
||||
|
||||
return AMR_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* In cases where the evaluation mode and the definedness are the "standard"
|
||||
* ones, don't log them, to keep the logs readable.
|
||||
|
|
@ -3925,6 +3963,8 @@ ApplyModifier(const char **pp, ModChain *ch)
|
|||
case 'S':
|
||||
return ApplyModifier_Subst(pp, ch);
|
||||
case 's':
|
||||
if ((*pp)[1] == 'h' && (*pp)[2] == '1')
|
||||
return ApplyModifier_SunShell1(pp, ch);
|
||||
return ApplyModifier_SunShell(pp, ch);
|
||||
case 'T':
|
||||
return ApplyModifier_WordFunc(pp, ch, ModifyWord_Tail);
|
||||
|
|
|
|||
|
|
@ -6,19 +6,11 @@
|
|||
*/
|
||||
/*
|
||||
* RCSid:
|
||||
* $Id: wait.h,v 1.6 2002/11/26 07:53:06 sjg Exp $
|
||||
* $Id: wait.h,v 1.7 2025/08/09 22:11:45 sjg Exp $
|
||||
*
|
||||
* @(#)Copyright (c) 1994, Simon J. Gerraty.
|
||||
* @(#)Copyright (c) 1994-2025, Simon J. Gerraty.
|
||||
*
|
||||
* This is free software. It comes with NO WARRANTY.
|
||||
* Permission to use, modify and distribute this source code
|
||||
* is granted subject to the following conditions.
|
||||
* 1/ that the above copyright notice and this notice
|
||||
* are preserved in all copies and that due credit be given
|
||||
* to the author.
|
||||
* 2/ that any changes to this code are clearly commented
|
||||
* as such so that the author does not get blamed for bugs
|
||||
* other than his own.
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Please send copies of changes and bug-fixes to:
|
||||
* sjg@crufty.net
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ SRCTOP?= ${.CURDIR:H:H}
|
|||
|
||||
# things set by configure
|
||||
|
||||
_MAKE_VERSION?=20250804
|
||||
_MAKE_VERSION?=20251111
|
||||
|
||||
prefix?= /usr
|
||||
srcdir= ${SRCTOP}/contrib/bmake
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@
|
|||
#define PACKAGE_NAME "bmake"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "bmake 20240711"
|
||||
#define PACKAGE_STRING "bmake 20251111"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "bmake"
|
||||
|
|
@ -288,7 +288,7 @@
|
|||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "20240711"
|
||||
#define PACKAGE_VERSION "20251111"
|
||||
|
||||
/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This is a generated file, do NOT edit!
|
||||
# See contrib/bmake/bsd.after-import.mk
|
||||
#
|
||||
# $Id: Makefile,v 1.245 2025/08/05 16:18:07 sjg Exp $
|
||||
# $Id: Makefile,v 1.251 2025/11/15 17:17:18 sjg Exp $
|
||||
#
|
||||
# $NetBSD: Makefile,v 1.372 2025/08/04 22:44:49 sjg Exp $
|
||||
# $NetBSD: Makefile,v 1.373 2025/11/12 22:14:08 sjg Exp $
|
||||
#
|
||||
# Unit tests for make(1)
|
||||
#
|
||||
|
|
@ -406,6 +406,7 @@ TESTS+= varmod-shell
|
|||
TESTS+= varmod-subst
|
||||
TESTS+= varmod-subst-regex
|
||||
TESTS+= varmod-sun-shell
|
||||
TESTS+= varmod-sun-shell1
|
||||
TESTS+= varmod-sysv
|
||||
TESTS+= varmod-tail
|
||||
TESTS+= varmod-to-abs
|
||||
|
|
@ -522,6 +523,14 @@ BROKEN_TESTS+= \
|
|||
|
||||
.endif
|
||||
|
||||
.if ${.MAKE.OS:NMINGW*} == ""
|
||||
BROKEN_TESTS+= \
|
||||
cmdline \
|
||||
objdir-writable \
|
||||
varname-dot-make-level \
|
||||
|
||||
.endif
|
||||
|
||||
.if ${.MAKE.OS} == "SCO_SV"
|
||||
BROKEN_TESTS+= \
|
||||
opt-debug-graph[23] \
|
||||
|
|
@ -597,8 +606,12 @@ SED_CMDS.directive-include-guard= \
|
|||
-e '/^ParseEOF:/d'
|
||||
SED_CMDS.export= -e '/^[^=_A-Za-z0-9]*=/d'
|
||||
SED_CMDS.export+= -e '/^DIFF/d'
|
||||
.if ${.MAKE.OS:NCygwin} == ""
|
||||
SED_CMDS.export+= -e '/^WINDIR=/d' -e '/^SYSTEMROOT=/d'
|
||||
.if ${.MAKE.OS:NCygwin:NMINGW*} == ""
|
||||
SED_CMDS.export+= \
|
||||
-e '/MSYSTEM=/d' \
|
||||
-e '/^SYSTEMROOT=/d' \
|
||||
-e '/^WINDIR=/d' \
|
||||
|
||||
.endif
|
||||
SED_CMDS.export-all= ${SED_CMDS.export}
|
||||
SED_CMDS.export-env= ${SED_CMDS.export}
|
||||
|
|
@ -850,6 +863,12 @@ _SED_CMDS+= -e 's,${.CURDIR},<curdir>,g'
|
|||
# which we get depending on how MAKEOBJDIR is set.
|
||||
_SED_CMDS+= -e 's,${.OBJDIR},<curdir>,g' -e 's,${.OBJDIR:tA},<curdir>,g'
|
||||
.endif
|
||||
|
||||
# At the end, make sure we cleanup any dregs...
|
||||
.for d in ${MAKEOBJDIRPREFIX:S,/$,,} /usr/obj
|
||||
_SED_CMDS_LAST+= -e 's,$d,,'
|
||||
.endfor
|
||||
|
||||
# always pretend .MAKE was called 'make'
|
||||
_SED_CMDS+= -e 's,^${TEST_MAKE:T:S,.,\\.,g}[][0-9]*:,make:,'
|
||||
_SED_CMDS+= -e 's,${TEST_MAKE:S,.,\\.,g},make,'
|
||||
|
|
@ -871,7 +890,7 @@ SED_CMDS.opt-debug-jobs+= -e 's,Command: <shell> -v,Command: <shell>,'
|
|||
.endif
|
||||
|
||||
.rawout.out:
|
||||
@${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \
|
||||
@${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} ${_SED_CMDS_LAST} \
|
||||
< ${.IMPSRC} > ${.TARGET}.tmp
|
||||
@${POSTPROC.${.PREFIX:T}:D \
|
||||
${POSTPROC.${.PREFIX:T}} < ${.TARGET}.tmp > ${.TARGET}.post \
|
||||
|
|
@ -898,7 +917,7 @@ test: ${OUTFILES} .PHONY
|
|||
echo "Failed tests: $${failed}" ; false ; \
|
||||
else \
|
||||
echo "All tests passed" ; \
|
||||
lua=${LUA:Ulua} ; \
|
||||
lua=${LUA} ; lua=$${lua:-lua}; \
|
||||
have_lua=$$("$$lua" -e 'print "yes"' 2>&1) ; \
|
||||
if [ "$$have_lua" = "yes" -a -s ${.CURDIR}/check-expect.lua ]; then \
|
||||
(cd ${.CURDIR} && "$$lua" ./check-expect.lua *.mk); \
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
|
||||
SRCTOP?= ${.CURDIR:H:H:H}
|
||||
|
||||
# $Id: Makefile.config.in,v 1.4 2022/09/09 18:44:56 sjg Exp $
|
||||
# $Id: Makefile.config.in,v 1.5 2025/10/22 23:20:41 sjg Exp $
|
||||
|
||||
srcdir= ${SRCTOP}/contrib/bmake/unit-tests
|
||||
EGREP= egrep
|
||||
TOOL_DIFF?= diff
|
||||
DIFF_FLAGS?= -u
|
||||
EGREP= egrep
|
||||
LUA?=
|
||||
TOOL_DIFF?= diff
|
||||
UTC_1= Europe/Berlin
|
||||
srcdir= ${SRCTOP}/contrib/bmake/unit-tests
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue