Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
/* $NetBSD: make.h,v 1.339 2024/06/15 20:02:45 rillig Exp $ */
|
2012-06-08 21:57:36 +00:00
|
|
|
|
1996-10-06 15:57:15 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1988, 1989, 1990, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
2012-06-08 21:57:36 +00:00
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Adam de Boor.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* from: @(#)make.h 8.3 (Berkeley) 6/13/95
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
1996-10-06 15:57:15 +00:00
|
|
|
* Copyright (c) 1989 by Berkeley Softworks
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Adam de Boor.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
2012-06-08 21:57:36 +00:00
|
|
|
* from: @(#)make.h 8.3 (Berkeley) 6/13/95
|
1996-10-06 15:57:15 +00:00
|
|
|
*/
|
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
/*
|
1996-10-06 15:57:15 +00:00
|
|
|
* make.h --
|
2022-02-05 20:03:50 +00:00
|
|
|
* The global definitions for make
|
1996-10-06 15:57:15 +00:00
|
|
|
*/
|
|
|
|
|
2020-09-05 16:11:04 +00:00
|
|
|
#ifndef MAKE_MAKE_H
|
|
|
|
#define MAKE_MAKE_H
|
1996-10-06 15:57:15 +00:00
|
|
|
|
2012-06-08 21:57:36 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
1996-10-06 15:57:15 +00:00
|
|
|
#include <sys/types.h>
|
2012-06-08 21:57:36 +00:00
|
|
|
#include <sys/param.h>
|
2020-09-05 16:11:04 +00:00
|
|
|
#include <sys/stat.h>
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2020-09-05 16:11:04 +00:00
|
|
|
#include <assert.h>
|
2012-06-08 21:57:36 +00:00
|
|
|
#include <ctype.h>
|
2016-03-11 00:37:02 +00:00
|
|
|
#include <fcntl.h>
|
2020-11-07 19:39:21 +00:00
|
|
|
#include <stdarg.h>
|
1996-10-06 15:57:15 +00:00
|
|
|
#include <stdio.h>
|
2012-06-08 21:57:36 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#ifdef HAVE_STRING_H
|
1996-10-06 15:57:15 +00:00
|
|
|
#include <string.h>
|
|
|
|
#else
|
2012-06-08 21:57:36 +00:00
|
|
|
#include <strings.h>
|
|
|
|
#endif
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
2016-03-11 00:37:02 +00:00
|
|
|
#ifndef FD_CLOEXEC
|
|
|
|
#define FD_CLOEXEC 1
|
|
|
|
#endif
|
|
|
|
|
2012-06-08 21:57:36 +00:00
|
|
|
#if defined(__GNUC__)
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKE_GNUC_PREREQ(x, y) \
|
2012-06-08 21:57:36 +00:00
|
|
|
((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
|
|
|
|
(__GNUC__ > (x)))
|
2022-02-05 20:03:50 +00:00
|
|
|
#else
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKE_GNUC_PREREQ(x, y) 0
|
2022-02-05 20:03:50 +00:00
|
|
|
#endif
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2012-06-25 22:20:51 +00:00
|
|
|
#if MAKE_GNUC_PREREQ(2, 7)
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKE_ATTR_UNUSED __attribute__((__unused__))
|
1996-10-06 15:57:15 +00:00
|
|
|
#else
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKE_ATTR_UNUSED /* delete */
|
1996-10-06 15:57:15 +00:00
|
|
|
#endif
|
2012-06-25 22:20:51 +00:00
|
|
|
|
|
|
|
#if MAKE_GNUC_PREREQ(2, 5)
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKE_ATTR_DEAD __attribute__((__noreturn__))
|
2012-06-25 22:20:51 +00:00
|
|
|
#elif defined(__GNUC__)
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKE_ATTR_DEAD __volatile
|
2012-06-25 22:20:51 +00:00
|
|
|
#else
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKE_ATTR_DEAD /* delete */
|
1996-10-06 15:57:15 +00:00
|
|
|
#endif
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2012-06-25 22:20:51 +00:00
|
|
|
#if MAKE_GNUC_PREREQ(2, 7)
|
|
|
|
#define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) \
|
|
|
|
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
|
|
|
|
#else
|
|
|
|
#define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) /* delete */
|
1996-10-06 15:57:15 +00:00
|
|
|
#endif
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
#if MAKE_GNUC_PREREQ(4, 0)
|
|
|
|
#define MAKE_ATTR_USE __attribute__((__warn_unused_result__))
|
|
|
|
#else
|
|
|
|
#define MAKE_ATTR_USE /* delete */
|
|
|
|
#endif
|
|
|
|
|
Import bmake-20240430
Intersting/relevant changes since bmake-20240309
ChangeLog since bmake-20240309
2024-04-30 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240430
Merge with NetBSD make, pick up
o main.c: ensure '.include <makefile>' respects MAKESYSPATH.
Dir_FindFile will search .CURDIR first unless ".DOTLAST" is seen.
2024-04-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240428
Merge with NetBSD make, pick up
o simplify freeing of lists
o arch.c: trim pointless comments
o var.c: delay variable assignments until actually needed
don't reallocate memory after evaluating an expression, result is
almost always short-lived.
2024-04-26 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240426
Merge with NetBSD make, pick up
o job.c: in debug output, print the directory in which a job
failed at same time as failed target so it is more easily found in
build log.
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240424
Merge with NetBSD make, pick up
o clean up comments, code and tests
2024-04-23 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240422
Merge with NetBSD make, pick up
o var.c: avoid LazyBuf for :*time modifiers.
LazyBuf's are not nul terminated so not suitable for passing to
functions that expect that. These modifiers are used sparingly so
an extra allocation is not a problem.
2024-04-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240420
Merge with NetBSD make, pick up
o provide more context information for parse/evaluate errors
2024-04-14 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240414
Merge with NetBSD make, pick up
o parse.c: print -dp debug info earlier so we see which
.if or .for line is being parsed.
2024-04-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240404
Merge with NetBSD make, pick up
o fix some unit tests for Cygwin
o parse.c: exit immediately after reading a null byte from a makefile
* fix generation of bmake.cat1
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240314
Add/Improve support for Cygwin
o uname -s output isn't useful so allow configure to
set FORCE_MAKE_OS - to force the value of .MAKE.OS
and use Cygwin which matches uname -o
o fix some unit-tests for Cygwin
* configure.in: use_makefile=no for Cygwin et al.
NOTE: bmake does not support Cygwin and likely never will,
mk/ChangeLog since bmake-20240309
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* meta.autodep.mk: do not override start_utc
2024-04-18 Simon J Gerraty <sjg@beast.crufty.net>
* sys.dirdeps.mk: set defaults for DEP_* at level 0 too.
These help when first include of Makefile.depend happens in a leaf
dir.
* install-mk (MK_VERSION): 20240414
2024-04-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240408
* init.mk: allow for _ as well as . to join V
and Q from QUALIFIED_VAR_LIST and VAR_QUALIFIER_LIST.
* progs.mk: avoid overlap between PROG_VARS and
init.mk's QUALIFIED_VAR_LIST since PROG would also
match its VAR_QUALIFIER_LIST,
libs.mk does not have the same issue.
* subdir.mk: _SUBDIRUSE for realinstall should run install
remove include of ${.CURDIR}/Makefile.inc that can be done via
local.subdir.mk where needed
* own.mk: do not conflict with man.mk
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240314
* add sys/Cygwin.mk from Christian Franke
2024-05-03 22:43:12 +00:00
|
|
|
#if MAKE_GNUC_PREREQ(8, 0)
|
|
|
|
#define MAKE_ATTR_NOINLINE __attribute__((__noinline__))
|
|
|
|
#else
|
|
|
|
#define MAKE_ATTR_NOINLINE /* delete */
|
|
|
|
#endif
|
|
|
|
|
2022-04-03 19:52:08 +00:00
|
|
|
#if __STDC_VERSION__ >= 199901L || defined(lint)
|
2020-11-20 03:54:37 +00:00
|
|
|
#define MAKE_INLINE static inline MAKE_ATTR_UNUSED
|
2022-02-05 20:03:50 +00:00
|
|
|
#else
|
|
|
|
#define MAKE_INLINE static MAKE_ATTR_UNUSED
|
|
|
|
#endif
|
2021-12-18 07:27:22 +00:00
|
|
|
|
|
|
|
/* MAKE_STATIC marks a function that may or may not be inlined. */
|
|
|
|
#if defined(lint)
|
|
|
|
/* As of 2021-07-31, NetBSD lint ignores __attribute__((unused)). */
|
|
|
|
#define MAKE_STATIC MAKE_INLINE
|
|
|
|
#else
|
2021-06-25 18:16:24 +00:00
|
|
|
#define MAKE_STATIC static MAKE_ATTR_UNUSED
|
2021-12-18 07:27:22 +00:00
|
|
|
#endif
|
2020-11-20 03:54:37 +00:00
|
|
|
|
2021-06-25 18:16:24 +00:00
|
|
|
#if __STDC_VERSION__ >= 199901L || defined(lint) || defined(USE_C99_BOOLEAN)
|
2021-01-14 01:24:34 +00:00
|
|
|
#include <stdbool.h>
|
2021-12-18 07:27:22 +00:00
|
|
|
#elif defined(__bool_true_false_are_defined)
|
|
|
|
/*
|
|
|
|
* All files of make must be compiled with the same definition of bool.
|
|
|
|
* Since one of the files includes <stdbool.h>, that means the header is
|
|
|
|
* available on this platform. Recompile everything with -DUSE_C99_BOOLEAN.
|
|
|
|
*/
|
|
|
|
#error "<stdbool.h> is included in pre-C99 mode"
|
|
|
|
#elif defined(bool) || defined(true) || defined(false)
|
|
|
|
/*
|
|
|
|
* In pre-C99 mode, make does not expect that bool is already defined.
|
|
|
|
* You need to ensure that all translation units use the same definition for
|
|
|
|
* bool.
|
|
|
|
*/
|
|
|
|
#error "bool/true/false is defined in pre-C99 mode"
|
2020-09-05 16:11:04 +00:00
|
|
|
#else
|
2021-12-18 07:27:22 +00:00
|
|
|
typedef unsigned char bool;
|
2021-06-25 18:16:24 +00:00
|
|
|
#define true 1
|
|
|
|
#define false 0
|
2020-11-07 19:39:21 +00:00
|
|
|
#endif
|
2020-09-05 16:11:04 +00:00
|
|
|
|
1996-10-06 15:57:15 +00:00
|
|
|
#include "lst.h"
|
2021-06-25 18:16:24 +00:00
|
|
|
#include "make_malloc.h"
|
|
|
|
#include "str.h"
|
2012-06-08 21:57:36 +00:00
|
|
|
#include "hash.h"
|
|
|
|
#include "make-conf.h"
|
1996-10-06 15:57:15 +00:00
|
|
|
#include "buf.h"
|
2012-06-08 21:57:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* some vendors don't have this --sjg
|
|
|
|
*/
|
|
|
|
#if defined(S_IFDIR) && !defined(S_ISDIR)
|
|
|
|
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
|
2021-01-14 01:24:34 +00:00
|
|
|
# define POSIX_SIGNALS
|
2012-06-08 21:57:36 +00:00
|
|
|
#endif
|
1996-10-06 15:57:15 +00:00
|
|
|
|
Import bmake-20230909
Update import.sh to generate below
ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230909
Merge with NetBSD make, pick up
o main.c: allow -j to compute a multiple of ncpu
If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating
point number or ends in 'C' compute .MAKE.JOBS as a multiple of
_SC_NPROCESSORS_ONLN
.MAKE.JOBS.C will be "yes" if -jC is supported
2023-08-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230820
Merge with NetBSD make, pick up
o make.1: note that :localtime is better for %s
o parse.c: improve error messages for invalid input.
o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get
correct result, it is still better to use %s:L:localtime.
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230818
Merge with NetBSD make, pick up
o meta.c: meta_ignore - check raw path against metaIgnorePaths
to potentially skip call to realpath.
o var.c: be strict when parsing the argument of the ':mtime' modifier
o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}'
should be used to get an equivalent value to time(3).
2023-08-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230816
Merge with NetBSD make, pick up
o cond.c: clean up multiple-inclusion guards
2023-07-25 Simon J Gerraty <sjg@beast.crufty.net>
* unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS
if configure cannot work out how to control TZ.
Remove varmod-localtime from BROKEN_TESTS for IRIX*
2023-07-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230723
* configure.in: fix the test for wether TZ=Europe/Berlin works.
Depending on the time of year, if run between 22:00 and 00:00 UTC
the check in configure would fail incorrectly.
Take the day into account as well.
2023-07-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
Merge with NetBSD make, pick up
o make.1: clean up wording, clarify scope of '!' in conditions
2023-07-15 Simon J Gerraty <sjg@beast.crufty.net>
* make-bootstrap.sh.in: set prefix
If configure is run using ksh we get unexpanded ${prefix} in
DEFAULT_SYS_PATH, by ensuring prefix is set we should still get
correct result.
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
bump version for IRIX tweaks
* make.h: undef OP_NONE if defined
* unit-tests/Makefile: set BROKEN_TESTS for IRIX
* configure.in: override INSTALL on IRIX
2023-06-27 Simon J Gerraty <sjg@beast.crufty.net>
* boot-strap op_test: ensure we set TEST_MAKE as we want it.
mk/ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* jobs.mk (JOB_MAX): use -jC if we can
we actually use JOB_MAX_C which defaults to 1.33C
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* now_utc: %s only works with :localtime
2023-07-14 Simon J Gerraty <sjg@beast.crufty.net>
* install-sh: ignore -c as claimed and only insist on
a directory for destination when more than one file to copy.
* sys.mk: when looking for SYS_OS_MK try ${.MAKE.OS} and
${.MAKE.OS:S,64,,} early (so we find sys/IRIX.mk for IRIX64)
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230711
* sys.mk: set SYS_MK and INSTALL_SH for systems with incompatible
install(1)
* sys/IRIX.mk: when setting ROOT_GROUP only match the first :0:
set INSTALL to install-sh rather than pathname that may not exist
(yet).
2023-07-07 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: pass DIRDEP_TARGETS to DIRDEP_MAKE
normally this is empty - for the default target, but there are
use-cases where we might set it to something else.
2023-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230704
* dirdeps.mk: apply DEBUG_DIRDEPS_LIST_FILTER to lists we output
when DEBUG_DIRDEPS is in effect.
Eg. DEBUG_DIRDEPS_LIST_FILTER=ts\n
can greatly improve readability.
2023-09-17 17:03:11 +00:00
|
|
|
/*
|
|
|
|
* IRIX defines OP_NONE in sys/fcntl.h
|
|
|
|
*/
|
|
|
|
#if defined(OP_NONE)
|
|
|
|
# undef OP_NONE
|
|
|
|
#endif
|
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/*
|
|
|
|
* The typical flow of states is:
|
|
|
|
*
|
|
|
|
* The direct successful path:
|
|
|
|
* UNMADE -> BEINGMADE -> MADE.
|
|
|
|
*
|
|
|
|
* The direct error path:
|
|
|
|
* UNMADE -> BEINGMADE -> ERROR.
|
|
|
|
*
|
|
|
|
* The successful path when dependencies need to be made first:
|
|
|
|
* UNMADE -> DEFERRED -> REQUESTED -> BEINGMADE -> MADE.
|
|
|
|
*
|
|
|
|
* A node that has dependencies, and one of the dependencies cannot be made:
|
|
|
|
* UNMADE -> DEFERRED -> ABORTED.
|
|
|
|
*
|
|
|
|
* A node that turns out to be up-to-date:
|
|
|
|
* UNMADE -> BEINGMADE -> UPTODATE.
|
|
|
|
*/
|
2020-11-20 03:54:37 +00:00
|
|
|
typedef enum GNodeMade {
|
2021-01-14 01:24:34 +00:00
|
|
|
/* Not examined yet. */
|
|
|
|
UNMADE,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The node has been examined but is not yet ready since its
|
|
|
|
* dependencies have to be made first.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
DEFERRED,
|
|
|
|
|
|
|
|
/* The node is on the toBeMade list. */
|
|
|
|
REQUESTED,
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The node is already being made. Trying to build a node in this
|
|
|
|
* state indicates a cycle in the graph.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
BEINGMADE,
|
|
|
|
|
|
|
|
/* Was out-of-date and has been made. */
|
|
|
|
MADE,
|
|
|
|
/* Was already up-to-date, does not need to be made. */
|
|
|
|
UPTODATE,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* An error occurred while it was being made. Used only in compat
|
|
|
|
* mode.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
ERROR,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The target was aborted due to an error making a dependency. Used
|
|
|
|
* only in compat mode.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
ABORTED
|
2020-09-05 16:11:04 +00:00
|
|
|
} GNodeMade;
|
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/*
|
|
|
|
* The OP_ constants are used when parsing a dependency line as a way of
|
2020-09-05 16:11:04 +00:00
|
|
|
* communicating to other parts of the program the way in which a target
|
|
|
|
* should be made.
|
|
|
|
*
|
2021-01-14 01:24:34 +00:00
|
|
|
* Some of the OP_ constants can be combined, others cannot.
|
2021-06-25 18:16:24 +00:00
|
|
|
*
|
|
|
|
* See the tests depsrc-*.mk and deptgt-*.mk.
|
2021-01-14 01:24:34 +00:00
|
|
|
*/
|
2020-11-07 19:39:21 +00:00
|
|
|
typedef enum GNodeType {
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_NONE = 0,
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The dependency operator ':' is the most common one. The commands
|
|
|
|
* of this node are executed if any child is out-of-date.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_DEPENDS = 1 << 0,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The dependency operator '!' always executes its commands, even if
|
|
|
|
* its children are up-to-date.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_FORCE = 1 << 1,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The dependency operator '::' behaves like ':', except that it
|
2021-01-14 01:24:34 +00:00
|
|
|
* allows multiple dependency groups to be defined. Each of these
|
2022-02-05 20:03:50 +00:00
|
|
|
* groups is executed on its own, independently from the others. Each
|
|
|
|
* individual dependency group is called a cohort.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_DOUBLEDEP = 1 << 2,
|
|
|
|
|
|
|
|
/* Matches the dependency operators ':', '!' and '::'. */
|
|
|
|
OP_OPMASK = OP_DEPENDS | OP_FORCE | OP_DOUBLEDEP,
|
|
|
|
|
|
|
|
/* Don't care if the target doesn't exist and can't be created. */
|
|
|
|
OP_OPTIONAL = 1 << 3,
|
|
|
|
/* Use associated commands for parents. */
|
|
|
|
OP_USE = 1 << 4,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Target is never out of date, but always execute commands anyway.
|
|
|
|
* Its time doesn't matter, so it has none...sort of.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_EXEC = 1 << 5,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Ignore non-zero exit status from shell commands when creating the
|
|
|
|
* node.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_IGNORE = 1 << 6,
|
|
|
|
/* Don't remove the target when interrupted. */
|
|
|
|
OP_PRECIOUS = 1 << 7,
|
|
|
|
/* Don't echo commands when executed. */
|
|
|
|
OP_SILENT = 1 << 8,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Target is a recursive make so its commands should always be
|
|
|
|
* executed when it is out of date, regardless of the state of the -n
|
|
|
|
* or -t flags.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_MAKE = 1 << 9,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Target is out-of-date only if any of its children was out-of-date.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_JOIN = 1 << 10,
|
|
|
|
/* Assume the children of the node have been already made. */
|
|
|
|
OP_MADE = 1 << 11,
|
|
|
|
/* Special .BEGIN, .END or .INTERRUPT. */
|
|
|
|
OP_SPECIAL = 1 << 12,
|
|
|
|
/* Like .USE, only prepend commands. */
|
|
|
|
OP_USEBEFORE = 1 << 13,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The node is invisible to its parents. I.e. it doesn't show up in
|
|
|
|
* the parents' local variables (.IMPSRC, .ALLSRC).
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_INVISIBLE = 1 << 14,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The node does not become the main target, even if it is the first
|
|
|
|
* target in the first makefile.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_NOTMAIN = 1 << 15,
|
|
|
|
/* Not a file target; run always. */
|
|
|
|
OP_PHONY = 1 << 16,
|
|
|
|
/* Don't search for the file in the path. */
|
|
|
|
OP_NOPATH = 1 << 17,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* In a dependency line "target: source1 .WAIT source2", source1 is
|
2021-01-14 01:24:34 +00:00
|
|
|
* made first, including its children. Once that is finished,
|
|
|
|
* source2 is made, including its children. The .WAIT keyword may
|
2022-02-05 20:03:50 +00:00
|
|
|
* appear more than once in a single dependency declaration.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_WAIT = 1 << 18,
|
|
|
|
/* .NOMETA do not create a .meta file */
|
|
|
|
OP_NOMETA = 1 << 19,
|
|
|
|
/* .META we _do_ want a .meta file */
|
|
|
|
OP_META = 1 << 20,
|
|
|
|
/* Do not compare commands in .meta file */
|
|
|
|
OP_NOMETA_CMP = 1 << 21,
|
|
|
|
/* Possibly a submake node */
|
|
|
|
OP_SUBMAKE = 1 << 22,
|
|
|
|
|
|
|
|
/* Attributes applied by PMake */
|
|
|
|
|
|
|
|
/* The node is a transformation rule, such as ".c.o". */
|
|
|
|
OP_TRANSFORM = 1 << 30,
|
|
|
|
/* Target is a member of an archive */
|
|
|
|
/* XXX: How does this differ from OP_ARCHV? */
|
|
|
|
OP_MEMBER = 1 << 29,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The node is a library, its name has the form "-l<libname>".
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_LIB = 1 << 28,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The node is an archive member, its name has the form
|
|
|
|
* "archive(member)".
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
/* XXX: How does this differ from OP_MEMBER? */
|
|
|
|
OP_ARCHV = 1 << 27,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Target has all the commands it should. Used when parsing to catch
|
2021-01-14 01:24:34 +00:00
|
|
|
* multiple command groups for a target. Only applies to the
|
2022-02-05 20:03:50 +00:00
|
|
|
* dependency operators ':' and '!', but not to '::'.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_HAS_COMMANDS = 1 << 26,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The special command "..." has been seen. All further commands from
|
|
|
|
* this node will be saved on the .END node instead, to be executed
|
|
|
|
* at the very end.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_SAVE_CMDS = 1 << 25,
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Already processed by Suff_FindDeps, to find dependencies from
|
|
|
|
* suffix transformation rules.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
OP_DEPS_FOUND = 1 << 24,
|
|
|
|
/* Node found while expanding .ALLSRC */
|
2022-02-05 20:03:50 +00:00
|
|
|
OP_MARK = 1 << 23
|
2020-09-05 16:11:04 +00:00
|
|
|
} GNodeType;
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
typedef struct GNodeFlags {
|
2021-01-14 01:24:34 +00:00
|
|
|
/* this target needs to be (re)made */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool remake:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* children of this target were made */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool childMade:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* children don't exist, and we pretend made */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool force:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* Set by Make_ProcessWait() */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool doneWait:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* Build requested by .ORDER processing */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool doneOrder:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* Node created from .depend */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool fromDepend:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* We do it once only */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool doneAllsrc:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* Used by MakePrintStatus */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool cycle:1;
|
2021-01-14 01:24:34 +00:00
|
|
|
/* Used by MakePrintStatus */
|
2021-12-18 07:27:22 +00:00
|
|
|
bool doneCycle:1;
|
2020-09-05 16:11:04 +00:00
|
|
|
} GNodeFlags;
|
|
|
|
|
2020-11-07 19:39:21 +00:00
|
|
|
typedef struct List StringList;
|
|
|
|
typedef struct ListNode StringListNode;
|
|
|
|
|
|
|
|
typedef struct List GNodeList;
|
|
|
|
typedef struct ListNode GNodeListNode;
|
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
typedef struct SearchPath {
|
|
|
|
List /* of CachedDir */ dirs;
|
|
|
|
} SearchPath;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/*
|
|
|
|
* A graph node represents a target that can possibly be made, including its
|
Import bmake-20240430
Intersting/relevant changes since bmake-20240309
ChangeLog since bmake-20240309
2024-04-30 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240430
Merge with NetBSD make, pick up
o main.c: ensure '.include <makefile>' respects MAKESYSPATH.
Dir_FindFile will search .CURDIR first unless ".DOTLAST" is seen.
2024-04-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240428
Merge with NetBSD make, pick up
o simplify freeing of lists
o arch.c: trim pointless comments
o var.c: delay variable assignments until actually needed
don't reallocate memory after evaluating an expression, result is
almost always short-lived.
2024-04-26 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240426
Merge with NetBSD make, pick up
o job.c: in debug output, print the directory in which a job
failed at same time as failed target so it is more easily found in
build log.
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240424
Merge with NetBSD make, pick up
o clean up comments, code and tests
2024-04-23 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240422
Merge with NetBSD make, pick up
o var.c: avoid LazyBuf for :*time modifiers.
LazyBuf's are not nul terminated so not suitable for passing to
functions that expect that. These modifiers are used sparingly so
an extra allocation is not a problem.
2024-04-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240420
Merge with NetBSD make, pick up
o provide more context information for parse/evaluate errors
2024-04-14 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240414
Merge with NetBSD make, pick up
o parse.c: print -dp debug info earlier so we see which
.if or .for line is being parsed.
2024-04-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240404
Merge with NetBSD make, pick up
o fix some unit tests for Cygwin
o parse.c: exit immediately after reading a null byte from a makefile
* fix generation of bmake.cat1
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240314
Add/Improve support for Cygwin
o uname -s output isn't useful so allow configure to
set FORCE_MAKE_OS - to force the value of .MAKE.OS
and use Cygwin which matches uname -o
o fix some unit-tests for Cygwin
* configure.in: use_makefile=no for Cygwin et al.
NOTE: bmake does not support Cygwin and likely never will,
mk/ChangeLog since bmake-20240309
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* meta.autodep.mk: do not override start_utc
2024-04-18 Simon J Gerraty <sjg@beast.crufty.net>
* sys.dirdeps.mk: set defaults for DEP_* at level 0 too.
These help when first include of Makefile.depend happens in a leaf
dir.
* install-mk (MK_VERSION): 20240414
2024-04-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240408
* init.mk: allow for _ as well as . to join V
and Q from QUALIFIED_VAR_LIST and VAR_QUALIFIER_LIST.
* progs.mk: avoid overlap between PROG_VARS and
init.mk's QUALIFIED_VAR_LIST since PROG would also
match its VAR_QUALIFIER_LIST,
libs.mk does not have the same issue.
* subdir.mk: _SUBDIRUSE for realinstall should run install
remove include of ${.CURDIR}/Makefile.inc that can be done via
local.subdir.mk where needed
* own.mk: do not conflict with man.mk
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240314
* add sys/Cygwin.mk from Christian Franke
2024-05-03 22:43:12 +00:00
|
|
|
* relation to other targets.
|
2021-01-14 01:24:34 +00:00
|
|
|
*/
|
1996-10-06 15:57:15 +00:00
|
|
|
typedef struct GNode {
|
2021-01-14 01:24:34 +00:00
|
|
|
/* The target's name, such as "clean" or "make.c" */
|
|
|
|
char *name;
|
|
|
|
/* The unexpanded name of a .USE node */
|
|
|
|
char *uname;
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The full pathname of the file belonging to the target.
|
|
|
|
*
|
2021-01-14 01:24:34 +00:00
|
|
|
* XXX: What about .PHONY targets? These don't have an associated
|
2022-02-05 20:03:50 +00:00
|
|
|
* path.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
char *path;
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The type of operator used to define the sources (see the OP flags
|
2021-01-14 01:24:34 +00:00
|
|
|
* below).
|
2022-02-05 20:03:50 +00:00
|
|
|
*
|
|
|
|
* XXX: This looks like a wild mixture of type and flags.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
GNodeType type;
|
|
|
|
GNodeFlags flags;
|
|
|
|
|
|
|
|
/* The state of processing on this node */
|
|
|
|
GNodeMade made;
|
|
|
|
/* The number of unmade children */
|
|
|
|
int unmade;
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The modification time; 0 means the node does not have a
|
|
|
|
* corresponding file; see GNode_IsOODate.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
time_t mtime;
|
|
|
|
struct GNode *youngestChild;
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The GNodes for which this node is an implied source. May be empty.
|
|
|
|
* For example, when there is an inference rule for .c.o, the node
|
|
|
|
* for file.c has the node for file.o in this list.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
GNodeList implicitParents;
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The nodes that depend on this one, or in other words, the nodes
|
|
|
|
* for which this is a source.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
GNodeList parents;
|
|
|
|
/* The nodes on which this one depends. */
|
|
|
|
GNodeList children;
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* .ORDER nodes we need made. The nodes that must be made (if they're
|
2021-01-14 01:24:34 +00:00
|
|
|
* made) before this node can be made, but that do not enter into the
|
2022-02-05 20:03:50 +00:00
|
|
|
* datedness of this node.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
GNodeList order_pred;
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* .ORDER nodes who need us. The nodes that must be made (if they're
|
2021-01-14 01:24:34 +00:00
|
|
|
* made at all) after this node is made, but that do not depend on
|
2022-02-05 20:03:50 +00:00
|
|
|
* this node, in the normal sense.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
GNodeList order_succ;
|
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
/*
|
|
|
|
* Other nodes of the same name, for targets that were defined using
|
|
|
|
* the '::' dependency operator (OP_DOUBLEDEP).
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
GNodeList cohorts;
|
|
|
|
/* The "#n" suffix for this cohort, or "" for other nodes */
|
|
|
|
char cohort_num[8];
|
|
|
|
/* The number of unmade instances on the cohorts list */
|
|
|
|
int unmade_cohorts;
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Pointer to the first instance of a '::' node; only set when on a
|
|
|
|
* cohorts list
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
struct GNode *centurion;
|
|
|
|
|
|
|
|
/* Last time (sequence number) we tried to make this node */
|
|
|
|
unsigned int checked_seqno;
|
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
/*
|
|
|
|
* The "local" variables that are specific to this target and this
|
2021-01-14 01:24:34 +00:00
|
|
|
* target only, such as $@, $<, $?.
|
|
|
|
*
|
2021-02-11 01:51:11 +00:00
|
|
|
* Also used for the global variable scopes SCOPE_GLOBAL,
|
|
|
|
* SCOPE_CMDLINE, SCOPE_INTERNAL, which contain variables with
|
|
|
|
* arbitrary names.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
HashTable /* of Var pointer */ vars;
|
|
|
|
|
|
|
|
/* The commands to be given to a shell to create this target. */
|
|
|
|
StringList commands;
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Suffix for the node (determined by Suff_FindDeps and opaque to
|
|
|
|
* everyone but the Suff module)
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
struct Suffix *suffix;
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/* Filename where the GNode got defined, unlimited lifetime */
|
2021-01-14 01:24:34 +00:00
|
|
|
const char *fname;
|
2022-02-05 20:03:50 +00:00
|
|
|
/* Line number where the GNode got defined, 1-based */
|
|
|
|
unsigned lineno;
|
Import bmake-20240309
Intersting/relevant changes since bmake-20240108
ChangeLog since bmake-20240108
2024-03-10 Simon J Gerraty <sjg@beast.crufty.net>
* boot-strap: tests can take a long time; use a cookie to
skip them if bmake has not been updated since tests last
ran successfully.
* Makefile: Cygwin handles MANTARGET man
* unit-tests/Makefile: set BROKEN_TESTS for Cygwin
2024-03-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240309
Merge with NetBSD make, pick up
o set .ERROR_EXIT to the exit status of .ERROR_TARGET
this allows a .ERROR target to ignore the case of
.ERROR_EXIT==6 which just means that the build actually
failed somewhere else.
2024-03-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240303
* var.c: on IRIX we need both inttypes.h and stdint.h
2024-03-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240301
Merge with NetBSD make, pick up
o export variables with value from target scope
when appropriate.
2024-02-12 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240212
Merge with NetBSD make, pick up
o remove unneeded conditional-compilation toggles
INCLUDES, LIBRARIES, POSIX, SYSVINCLUDE, SYSVVARSUB,
GMAKEEXPORT NO_REGEX and SUNSHCMD
* configure.in: add check for regex.h
* var.c: replace use of NO_REGEX with HAVE_REGEX_H
2024-02-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240204
Merge with NetBSD make, pick up
o var.c: fix some lint (-dL) mode parsing issues
2024-02-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION: (_MAKE_VERSION): 20240202
Merge with NetBSD make, pick up
o make.1: note that arg to :D and :U can be empty
o var.c: $$ is not a parse error when .MAKE.SAVE_DOLLARS=no
mk/ChangeLog since bmake-20240108
2024-03-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240309
* meta.sys.mk: _metaError: if .ERROR_EXIT == 6, we do not
want to save the .ERROR_META_FILE
2024-02-20 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240220
* sys.dirdeps.mk, dirdeps-targets.mk, init.mk:
do not set .MAIN: dirdeps in sys.dirdeps.mk
dirdeps-targets.mk will do that for top-level builds
and init.mk will do it for others.
This allows a Makefile which has no need of 'dirdeps' to
set .MAIN for itself and "just work".
2024-02-18 Simon J Gerraty <sjg@beast.crufty.net>
* bsd.*.mk: for makefiles that get a bsd. symlink,
use _this in multiple inclusion tags since .PARSEFILE will not
DTRT when such a makefile is included directly by Makefile and
automatically (without bsd. prefix).
Since we cannot guarantee that our sys.mk will be used, we provide
a default _this in each makefile that gets a bsd. prefix such that
the value is the same regardless of bsd. prefix.
* subdir.mk: drop the !target guard on $SUBDIR_TARGETS
2024-02-12 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240212
* SPDX-License-Identifier: BSD-2-Clause
Add SPDX-License-Identifier to inidicate that I consider
my copyright on any of these makefiles equivalent to BSD-2-Clause
* autoconf.mk: allow for configure.ac as currently recommended
* subdir.mk: support @auto
which is replaced with each subdir that
has a [Mm]akefile.
* subdir.mk: include local.subdir.mk if it exists.
* subdir.mk: rework to handle .WAIT
2024-02-11 Simon J Gerraty <sjg@beast.crufty.net>
* subdir.mk: _SUBDIRUSE report the target we are entering subdirs for.
2024-02-10 Simon J Gerraty <sjg@beast.crufty.net>
* prog.mk: treat empty SRCS the same as undefined
2024-02-02 Simon J Gerraty <sjg@beast.crufty.net>
* Avoid undefined errors in lint (-dL) mode
* man.mk (CMT2DOC_FLAGS): note that -mm does mdoc(7)
2024-01-28 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240128
* FILES: add ccm.dep.mk for C++ modules
add suffixes.mk for common location for generic SUFFIX rules.
* auto.dep.mk autodep.mk meta.autodep.mk: include ccm.dep.mk
replace OBJ_EXTENSIONS with OBJ_SUFFIXES
* autodep.mk: leverage CXX_SUFFIXES for __depsrcs
and update style (spaces around = etc)
* init.mk: add OBJS_SRCS_FILTER to filter SRCS when
setting OBJS
* meta2deps.py: handle multiple ./ embedded in path better.
2024-03-14 02:14:41 +00:00
|
|
|
int exit_status;
|
1996-10-06 15:57:15 +00:00
|
|
|
} GNode;
|
|
|
|
|
2022-04-22 20:34:55 +00:00
|
|
|
/*
|
|
|
|
* Keep track of whether to include <posix.mk> when parsing the line
|
|
|
|
* '.POSIX:'.
|
|
|
|
*/
|
|
|
|
extern enum PosixState {
|
|
|
|
PS_NOT_YET,
|
|
|
|
PS_MAYBE_NEXT_LINE,
|
|
|
|
PS_NOW_OR_NEVER,
|
|
|
|
PS_TOO_LATE
|
|
|
|
} posix_state;
|
|
|
|
|
2020-11-20 03:54:37 +00:00
|
|
|
/* Error levels for diagnostics during parsing. */
|
2020-11-07 19:39:21 +00:00
|
|
|
typedef enum ParseErrorLevel {
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* Exit when the current top-level makefile has been parsed
|
|
|
|
* completely.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
PARSE_FATAL = 1,
|
|
|
|
/* Print "warning"; may be upgraded to fatal by the -w option. */
|
|
|
|
PARSE_WARNING,
|
|
|
|
/* Informational, mainly used during development of makefiles. */
|
|
|
|
PARSE_INFO
|
2020-11-07 19:39:21 +00:00
|
|
|
} ParseErrorLevel;
|
1996-10-06 15:57:15 +00:00
|
|
|
|
|
|
|
/*
|
2020-11-07 19:39:21 +00:00
|
|
|
* Values returned by Cond_EvalLine and Cond_EvalCondition.
|
1996-10-06 15:57:15 +00:00
|
|
|
*/
|
2022-02-05 20:03:50 +00:00
|
|
|
typedef enum CondResult {
|
|
|
|
CR_TRUE, /* Parse the next lines */
|
|
|
|
CR_FALSE, /* Skip the next lines */
|
|
|
|
CR_ERROR /* Unknown directive or parse error */
|
|
|
|
} CondResult;
|
1996-10-06 15:57:15 +00:00
|
|
|
|
2023-06-27 20:29:43 +00:00
|
|
|
typedef struct {
|
|
|
|
enum GuardKind {
|
|
|
|
GK_VARIABLE,
|
|
|
|
GK_TARGET
|
|
|
|
} kind;
|
|
|
|
char *name;
|
|
|
|
} Guard;
|
|
|
|
|
2020-11-20 03:54:37 +00:00
|
|
|
/* Names of the variables that are "local" to a specific target. */
|
2022-02-05 20:03:50 +00:00
|
|
|
#define TARGET "@" /* Target of dependency */
|
|
|
|
#define OODATE "?" /* All out-of-date sources */
|
|
|
|
#define ALLSRC ">" /* All sources */
|
|
|
|
#define IMPSRC "<" /* Source implied by transformation */
|
|
|
|
#define PREFIX "*" /* Common prefix */
|
|
|
|
#define ARCHIVE "!" /* Archive in "archive(member)" syntax */
|
|
|
|
#define MEMBER "%" /* Member in "archive(member)" syntax */
|
2020-11-07 19:39:21 +00:00
|
|
|
|
1996-10-06 15:57:15 +00:00
|
|
|
/*
|
2012-06-08 21:57:36 +00:00
|
|
|
* Global Variables
|
1996-10-06 15:57:15 +00:00
|
|
|
*/
|
|
|
|
|
2020-11-20 03:54:37 +00:00
|
|
|
/* True if every target is precious */
|
2021-06-25 18:16:24 +00:00
|
|
|
extern bool allPrecious;
|
2020-11-20 03:54:37 +00:00
|
|
|
/* True if failed targets should be deleted */
|
2021-06-25 18:16:24 +00:00
|
|
|
extern bool deleteOnError;
|
|
|
|
/* true while processing .depend */
|
|
|
|
extern bool doing_depend;
|
2020-11-20 03:54:37 +00:00
|
|
|
/* .DEFAULT rule */
|
|
|
|
extern GNode *defaultNode;
|
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/*
|
|
|
|
* Variables defined internally by make which should not override those set
|
|
|
|
* by makefiles.
|
|
|
|
*/
|
2021-02-11 01:51:11 +00:00
|
|
|
extern GNode *SCOPE_INTERNAL;
|
|
|
|
/* Variables defined in a global scope, e.g in the makefile itself. */
|
|
|
|
extern GNode *SCOPE_GLOBAL;
|
2020-11-20 03:54:37 +00:00
|
|
|
/* Variables defined on the command line. */
|
2021-02-11 01:51:11 +00:00
|
|
|
extern GNode *SCOPE_CMDLINE;
|
2020-11-20 03:54:37 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/*
|
Import bmake-20240430
Intersting/relevant changes since bmake-20240309
ChangeLog since bmake-20240309
2024-04-30 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240430
Merge with NetBSD make, pick up
o main.c: ensure '.include <makefile>' respects MAKESYSPATH.
Dir_FindFile will search .CURDIR first unless ".DOTLAST" is seen.
2024-04-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240428
Merge with NetBSD make, pick up
o simplify freeing of lists
o arch.c: trim pointless comments
o var.c: delay variable assignments until actually needed
don't reallocate memory after evaluating an expression, result is
almost always short-lived.
2024-04-26 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240426
Merge with NetBSD make, pick up
o job.c: in debug output, print the directory in which a job
failed at same time as failed target so it is more easily found in
build log.
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240424
Merge with NetBSD make, pick up
o clean up comments, code and tests
2024-04-23 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240422
Merge with NetBSD make, pick up
o var.c: avoid LazyBuf for :*time modifiers.
LazyBuf's are not nul terminated so not suitable for passing to
functions that expect that. These modifiers are used sparingly so
an extra allocation is not a problem.
2024-04-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240420
Merge with NetBSD make, pick up
o provide more context information for parse/evaluate errors
2024-04-14 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240414
Merge with NetBSD make, pick up
o parse.c: print -dp debug info earlier so we see which
.if or .for line is being parsed.
2024-04-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240404
Merge with NetBSD make, pick up
o fix some unit tests for Cygwin
o parse.c: exit immediately after reading a null byte from a makefile
* fix generation of bmake.cat1
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240314
Add/Improve support for Cygwin
o uname -s output isn't useful so allow configure to
set FORCE_MAKE_OS - to force the value of .MAKE.OS
and use Cygwin which matches uname -o
o fix some unit-tests for Cygwin
* configure.in: use_makefile=no for Cygwin et al.
NOTE: bmake does not support Cygwin and likely never will,
mk/ChangeLog since bmake-20240309
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* meta.autodep.mk: do not override start_utc
2024-04-18 Simon J Gerraty <sjg@beast.crufty.net>
* sys.dirdeps.mk: set defaults for DEP_* at level 0 too.
These help when first include of Makefile.depend happens in a leaf
dir.
* install-mk (MK_VERSION): 20240414
2024-04-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240408
* init.mk: allow for _ as well as . to join V
and Q from QUALIFIED_VAR_LIST and VAR_QUALIFIER_LIST.
* progs.mk: avoid overlap between PROG_VARS and
init.mk's QUALIFIED_VAR_LIST since PROG would also
match its VAR_QUALIFIER_LIST,
libs.mk does not have the same issue.
* subdir.mk: _SUBDIRUSE for realinstall should run install
remove include of ${.CURDIR}/Makefile.inc that can be done via
local.subdir.mk where needed
* own.mk: do not conflict with man.mk
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240314
* add sys/Cygwin.mk from Christian Franke
2024-05-03 22:43:12 +00:00
|
|
|
* Value returned by Var_Parse when an error is encountered. It points to an
|
|
|
|
* empty string, so naive callers needn't worry about it.
|
2021-01-14 01:24:34 +00:00
|
|
|
*/
|
2020-11-20 03:54:37 +00:00
|
|
|
extern char var_Error[];
|
|
|
|
|
|
|
|
/* The time at the start of this whole process */
|
|
|
|
extern time_t now;
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2020-11-20 03:54:37 +00:00
|
|
|
/*
|
2021-01-14 01:24:34 +00:00
|
|
|
* The list of directories to search when looking for targets (set by the
|
|
|
|
* special target .PATH).
|
2020-11-20 03:54:37 +00:00
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
extern SearchPath dirSearchPath;
|
2020-11-20 03:54:37 +00:00
|
|
|
/* Used for .include "...". */
|
|
|
|
extern SearchPath *parseIncPath;
|
2021-01-14 01:24:34 +00:00
|
|
|
/*
|
2021-02-11 01:51:11 +00:00
|
|
|
* Used for .include <...>, for the built-in sys.mk and for makefiles from
|
|
|
|
* the command line arguments.
|
2021-01-14 01:24:34 +00:00
|
|
|
*/
|
2020-11-20 03:54:37 +00:00
|
|
|
extern SearchPath *sysIncPath;
|
|
|
|
/* The default for sysIncPath. */
|
|
|
|
extern SearchPath *defSysIncPath;
|
|
|
|
|
|
|
|
/* Startup directory */
|
|
|
|
extern char curdir[];
|
|
|
|
/* The basename of the program name, suffixed with [n] for sub-makes. */
|
2021-01-14 01:24:34 +00:00
|
|
|
extern const char *progname;
|
2021-02-11 01:51:11 +00:00
|
|
|
extern int makelevel;
|
2020-11-20 03:54:37 +00:00
|
|
|
/* Name of the .depend makefile */
|
|
|
|
extern char *makeDependfile;
|
|
|
|
/* If we replaced environ, this will be non-NULL. */
|
|
|
|
extern char **savedEnv;
|
2022-02-05 20:03:50 +00:00
|
|
|
extern GNode *mainNode;
|
2020-11-20 03:54:37 +00:00
|
|
|
|
|
|
|
extern pid_t myPid;
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
#define MAKEFLAGS ".MAKEFLAGS"
|
2013-08-02 05:23:57 +00:00
|
|
|
#ifndef MAKE_LEVEL_ENV
|
|
|
|
# define MAKE_LEVEL_ENV "MAKELEVEL"
|
2012-06-08 21:57:36 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
typedef struct DebugFlags {
|
|
|
|
bool DEBUG_ARCH:1;
|
|
|
|
bool DEBUG_COND:1;
|
|
|
|
bool DEBUG_CWD:1;
|
|
|
|
bool DEBUG_DIR:1;
|
|
|
|
bool DEBUG_ERROR:1;
|
|
|
|
bool DEBUG_FOR:1;
|
|
|
|
bool DEBUG_GRAPH1:1;
|
|
|
|
bool DEBUG_GRAPH2:1;
|
|
|
|
bool DEBUG_GRAPH3:1;
|
|
|
|
bool DEBUG_HASH:1;
|
|
|
|
bool DEBUG_JOB:1;
|
|
|
|
bool DEBUG_LOUD:1;
|
|
|
|
bool DEBUG_MAKE:1;
|
|
|
|
bool DEBUG_META:1;
|
|
|
|
bool DEBUG_PARSE:1;
|
|
|
|
bool DEBUG_SCRIPT:1;
|
|
|
|
bool DEBUG_SHELL:1;
|
|
|
|
bool DEBUG_SUFF:1;
|
|
|
|
bool DEBUG_TARG:1;
|
|
|
|
bool DEBUG_VAR:1;
|
2020-11-07 19:39:21 +00:00
|
|
|
} DebugFlags;
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
#define CONCAT(a, b) a##b
|
1996-10-06 15:57:15 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
#define DEBUG(module) (opts.debug.CONCAT(DEBUG_, module))
|
2020-11-07 19:39:21 +00:00
|
|
|
|
|
|
|
void debug_printf(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
|
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
#define DEBUG_IMPL(module, args) \
|
|
|
|
do { \
|
|
|
|
if (DEBUG(module)) \
|
|
|
|
debug_printf args; \
|
2021-12-18 07:27:22 +00:00
|
|
|
} while (false)
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
#define DEBUG0(module, fmt) \
|
|
|
|
DEBUG_IMPL(module, (fmt))
|
2020-11-07 19:39:21 +00:00
|
|
|
#define DEBUG1(module, fmt, arg1) \
|
2021-01-14 01:24:34 +00:00
|
|
|
DEBUG_IMPL(module, (fmt, arg1))
|
2020-11-07 19:39:21 +00:00
|
|
|
#define DEBUG2(module, fmt, arg1, arg2) \
|
2021-01-14 01:24:34 +00:00
|
|
|
DEBUG_IMPL(module, (fmt, arg1, arg2))
|
2020-11-07 19:39:21 +00:00
|
|
|
#define DEBUG3(module, fmt, arg1, arg2, arg3) \
|
2021-01-14 01:24:34 +00:00
|
|
|
DEBUG_IMPL(module, (fmt, arg1, arg2, arg3))
|
2020-11-07 19:39:21 +00:00
|
|
|
#define DEBUG4(module, fmt, arg1, arg2, arg3, arg4) \
|
2021-01-14 01:24:34 +00:00
|
|
|
DEBUG_IMPL(module, (fmt, arg1, arg2, arg3, arg4))
|
2020-11-07 19:39:21 +00:00
|
|
|
#define DEBUG5(module, fmt, arg1, arg2, arg3, arg4, arg5) \
|
2021-01-14 01:24:34 +00:00
|
|
|
DEBUG_IMPL(module, (fmt, arg1, arg2, arg3, arg4, arg5))
|
2020-11-07 19:39:21 +00:00
|
|
|
|
|
|
|
typedef enum PrintVarsMode {
|
2021-01-14 01:24:34 +00:00
|
|
|
PVM_NONE,
|
|
|
|
PVM_UNEXPANDED,
|
|
|
|
PVM_EXPANDED
|
2020-11-07 19:39:21 +00:00
|
|
|
} PrintVarsMode;
|
|
|
|
|
|
|
|
/* Command line options */
|
|
|
|
typedef struct CmdOpts {
|
Import bmake-20240430
Intersting/relevant changes since bmake-20240309
ChangeLog since bmake-20240309
2024-04-30 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240430
Merge with NetBSD make, pick up
o main.c: ensure '.include <makefile>' respects MAKESYSPATH.
Dir_FindFile will search .CURDIR first unless ".DOTLAST" is seen.
2024-04-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240428
Merge with NetBSD make, pick up
o simplify freeing of lists
o arch.c: trim pointless comments
o var.c: delay variable assignments until actually needed
don't reallocate memory after evaluating an expression, result is
almost always short-lived.
2024-04-26 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240426
Merge with NetBSD make, pick up
o job.c: in debug output, print the directory in which a job
failed at same time as failed target so it is more easily found in
build log.
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240424
Merge with NetBSD make, pick up
o clean up comments, code and tests
2024-04-23 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240422
Merge with NetBSD make, pick up
o var.c: avoid LazyBuf for :*time modifiers.
LazyBuf's are not nul terminated so not suitable for passing to
functions that expect that. These modifiers are used sparingly so
an extra allocation is not a problem.
2024-04-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240420
Merge with NetBSD make, pick up
o provide more context information for parse/evaluate errors
2024-04-14 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240414
Merge with NetBSD make, pick up
o parse.c: print -dp debug info earlier so we see which
.if or .for line is being parsed.
2024-04-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240404
Merge with NetBSD make, pick up
o fix some unit tests for Cygwin
o parse.c: exit immediately after reading a null byte from a makefile
* fix generation of bmake.cat1
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240314
Add/Improve support for Cygwin
o uname -s output isn't useful so allow configure to
set FORCE_MAKE_OS - to force the value of .MAKE.OS
and use Cygwin which matches uname -o
o fix some unit-tests for Cygwin
* configure.in: use_makefile=no for Cygwin et al.
NOTE: bmake does not support Cygwin and likely never will,
mk/ChangeLog since bmake-20240309
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* meta.autodep.mk: do not override start_utc
2024-04-18 Simon J Gerraty <sjg@beast.crufty.net>
* sys.dirdeps.mk: set defaults for DEP_* at level 0 too.
These help when first include of Makefile.depend happens in a leaf
dir.
* install-mk (MK_VERSION): 20240414
2024-04-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240408
* init.mk: allow for _ as well as . to join V
and Q from QUALIFIED_VAR_LIST and VAR_QUALIFIER_LIST.
* progs.mk: avoid overlap between PROG_VARS and
init.mk's QUALIFIED_VAR_LIST since PROG would also
match its VAR_QUALIFIER_LIST,
libs.mk does not have the same issue.
* subdir.mk: _SUBDIRUSE for realinstall should run install
remove include of ${.CURDIR}/Makefile.inc that can be done via
local.subdir.mk where needed
* own.mk: do not conflict with man.mk
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240314
* add sys/Cygwin.mk from Christian Franke
2024-05-03 22:43:12 +00:00
|
|
|
/* -B: whether to be compatible to traditional make */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool compatMake;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
Import bmake-20240430
Intersting/relevant changes since bmake-20240309
ChangeLog since bmake-20240309
2024-04-30 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240430
Merge with NetBSD make, pick up
o main.c: ensure '.include <makefile>' respects MAKESYSPATH.
Dir_FindFile will search .CURDIR first unless ".DOTLAST" is seen.
2024-04-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240428
Merge with NetBSD make, pick up
o simplify freeing of lists
o arch.c: trim pointless comments
o var.c: delay variable assignments until actually needed
don't reallocate memory after evaluating an expression, result is
almost always short-lived.
2024-04-26 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240426
Merge with NetBSD make, pick up
o job.c: in debug output, print the directory in which a job
failed at same time as failed target so it is more easily found in
build log.
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240424
Merge with NetBSD make, pick up
o clean up comments, code and tests
2024-04-23 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240422
Merge with NetBSD make, pick up
o var.c: avoid LazyBuf for :*time modifiers.
LazyBuf's are not nul terminated so not suitable for passing to
functions that expect that. These modifiers are used sparingly so
an extra allocation is not a problem.
2024-04-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240420
Merge with NetBSD make, pick up
o provide more context information for parse/evaluate errors
2024-04-14 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240414
Merge with NetBSD make, pick up
o parse.c: print -dp debug info earlier so we see which
.if or .for line is being parsed.
2024-04-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240404
Merge with NetBSD make, pick up
o fix some unit tests for Cygwin
o parse.c: exit immediately after reading a null byte from a makefile
* fix generation of bmake.cat1
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240314
Add/Improve support for Cygwin
o uname -s output isn't useful so allow configure to
set FORCE_MAKE_OS - to force the value of .MAKE.OS
and use Cygwin which matches uname -o
o fix some unit-tests for Cygwin
* configure.in: use_makefile=no for Cygwin et al.
NOTE: bmake does not support Cygwin and likely never will,
mk/ChangeLog since bmake-20240309
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* meta.autodep.mk: do not override start_utc
2024-04-18 Simon J Gerraty <sjg@beast.crufty.net>
* sys.dirdeps.mk: set defaults for DEP_* at level 0 too.
These help when first include of Makefile.depend happens in a leaf
dir.
* install-mk (MK_VERSION): 20240414
2024-04-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240408
* init.mk: allow for _ as well as . to join V
and Q from QUALIFIED_VAR_LIST and VAR_QUALIFIER_LIST.
* progs.mk: avoid overlap between PROG_VARS and
init.mk's QUALIFIED_VAR_LIST since PROG would also
match its VAR_QUALIFIER_LIST,
libs.mk does not have the same issue.
* subdir.mk: _SUBDIRUSE for realinstall should run install
remove include of ${.CURDIR}/Makefile.inc that can be done via
local.subdir.mk where needed
* own.mk: do not conflict with man.mk
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240314
* add sys/Cygwin.mk from Christian Franke
2024-05-03 22:43:12 +00:00
|
|
|
* -d: debug control: There is one flag per module. It is up to the
|
2022-02-05 20:03:50 +00:00
|
|
|
* module what debug information to print.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
DebugFlags debug;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -df: debug output is written here - default stderr */
|
|
|
|
FILE *debug_file;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* -dL: lint mode
|
2021-01-14 01:24:34 +00:00
|
|
|
*
|
|
|
|
* Runs make in strict mode, with additional checks and better error
|
2022-02-05 20:03:50 +00:00
|
|
|
* handling.
|
|
|
|
*/
|
2021-06-25 18:16:24 +00:00
|
|
|
bool strict;
|
2020-11-20 03:54:37 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -dV: for the -V option, print unexpanded variable values */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool debugVflag;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -e: check environment variables before global variables */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool checkEnvFirst;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -f: the makefiles to read */
|
|
|
|
StringList makefiles;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -i: if true, ignore all errors from shell commands */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool ignoreErrors;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* -j: the maximum number of jobs that can run in parallel; this is
|
|
|
|
* coordinated with the submakes
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
int maxJobs;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* -k: if true and an error occurs while making a node, continue
|
|
|
|
* making nodes that do not depend on the erroneous node
|
|
|
|
*/
|
2021-06-25 18:16:24 +00:00
|
|
|
bool keepgoing;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -N: execute no commands from the targets */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool noRecursiveExecute;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -n: execute almost no commands from the targets */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool noExecute;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
/*
|
|
|
|
* -q: if true, do not really make anything, just see if the targets
|
|
|
|
* are out-of-date
|
|
|
|
*/
|
2022-02-05 20:03:50 +00:00
|
|
|
bool query;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
/* -r: raw mode, do not load the builtin rules. */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool noBuiltins;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -s: don't echo the shell commands before executing them */
|
2022-02-05 20:03:50 +00:00
|
|
|
bool silent;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* -t: touch the targets if they are out-of-date, but don't actually
|
|
|
|
* make them
|
|
|
|
*/
|
|
|
|
bool touch;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -[Vv]: print expanded or unexpanded selected variables */
|
|
|
|
PrintVarsMode printVars;
|
|
|
|
/* -[Vv]: the variables to print */
|
|
|
|
StringList variables;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
/* -W: if true, makefile parsing warnings are treated as errors */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool parseWarnFatal;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
/* -w: print 'Entering' and 'Leaving' for submakes */
|
2021-06-25 18:16:24 +00:00
|
|
|
bool enterFlag;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* -X: if true, do not export variables set on the command line to
|
|
|
|
* the environment.
|
|
|
|
*/
|
2021-06-25 18:16:24 +00:00
|
|
|
bool varNoExportEnv;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/*
|
|
|
|
* The target names specified on the command line. Used to resolve
|
|
|
|
* .if make(...) statements.
|
|
|
|
*/
|
2021-01-14 01:24:34 +00:00
|
|
|
StringList create;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-07-26 15:52:53 +00:00
|
|
|
/*
|
|
|
|
* Randomize the order in which the targets from toBeMade are made,
|
|
|
|
* to catch undeclared dependencies.
|
|
|
|
*/
|
|
|
|
bool randomizeTargets;
|
2020-11-07 19:39:21 +00:00
|
|
|
} CmdOpts;
|
|
|
|
|
|
|
|
extern CmdOpts opts;
|
2023-04-24 23:44:30 +00:00
|
|
|
extern bool forceJobs;
|
|
|
|
extern char **environ;
|
1996-10-06 15:57:15 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/* arch.c */
|
|
|
|
void Arch_Init(void);
|
|
|
|
void Arch_End(void);
|
|
|
|
|
|
|
|
bool Arch_ParseArchive(char **, GNodeList *, GNode *);
|
|
|
|
void Arch_Touch(GNode *);
|
|
|
|
void Arch_TouchLib(GNode *);
|
2023-06-27 20:29:43 +00:00
|
|
|
void Arch_UpdateMTime(GNode *);
|
|
|
|
void Arch_UpdateMemberMTime(GNode *);
|
2022-02-05 20:03:50 +00:00
|
|
|
void Arch_FindLib(GNode *, SearchPath *);
|
|
|
|
bool Arch_LibOODate(GNode *) MAKE_ATTR_USE;
|
|
|
|
bool Arch_IsLib(GNode *) MAKE_ATTR_USE;
|
|
|
|
|
|
|
|
/* compat.c */
|
|
|
|
bool Compat_RunCommand(const char *, GNode *, StringListNode *);
|
2022-07-26 15:52:53 +00:00
|
|
|
void Compat_MakeAll(GNodeList *);
|
2022-02-05 20:03:50 +00:00
|
|
|
void Compat_Make(GNode *, GNode *);
|
|
|
|
|
|
|
|
/* cond.c */
|
2023-01-28 00:23:54 +00:00
|
|
|
extern unsigned int cond_depth;
|
2022-02-05 20:03:50 +00:00
|
|
|
CondResult Cond_EvalCondition(const char *) MAKE_ATTR_USE;
|
|
|
|
CondResult Cond_EvalLine(const char *) MAKE_ATTR_USE;
|
2023-06-27 20:29:43 +00:00
|
|
|
Guard *Cond_ExtractGuard(const char *) MAKE_ATTR_USE;
|
2023-01-28 00:23:54 +00:00
|
|
|
void Cond_EndFile(void);
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
/* dir.c; see also dir.h */
|
|
|
|
|
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
|
|
|
str_basename(const char *pathname)
|
|
|
|
{
|
|
|
|
const char *lastSlash = strrchr(pathname, '/');
|
|
|
|
return lastSlash != NULL ? lastSlash + 1 : pathname;
|
|
|
|
}
|
|
|
|
|
|
|
|
MAKE_INLINE SearchPath * MAKE_ATTR_USE
|
|
|
|
SearchPath_New(void)
|
|
|
|
{
|
|
|
|
SearchPath *path = bmake_malloc(sizeof *path);
|
|
|
|
Lst_Init(&path->dirs);
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SearchPath_Free(SearchPath *);
|
|
|
|
|
|
|
|
/* for.c */
|
|
|
|
struct ForLoop;
|
|
|
|
int For_Eval(const char *) MAKE_ATTR_USE;
|
|
|
|
bool For_Accum(const char *, int *) MAKE_ATTR_USE;
|
|
|
|
void For_Run(unsigned, unsigned);
|
|
|
|
bool For_NextIteration(struct ForLoop *, Buffer *);
|
2023-06-27 20:29:43 +00:00
|
|
|
char *ForLoop_Details(const struct ForLoop *);
|
2022-02-05 20:03:50 +00:00
|
|
|
void ForLoop_Free(struct ForLoop *);
|
2023-01-28 00:23:54 +00:00
|
|
|
void For_Break(struct ForLoop *);
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
/* job.c */
|
|
|
|
void JobReapChild(pid_t, int, bool);
|
|
|
|
|
|
|
|
/* main.c */
|
|
|
|
void Main_ParseArgLine(const char *);
|
|
|
|
char *Cmd_Exec(const char *, char **) MAKE_ATTR_USE;
|
|
|
|
void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
|
|
|
|
void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
|
|
|
|
void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
|
|
|
|
void DieHorribly(void) MAKE_ATTR_DEAD;
|
|
|
|
void Finish(int) MAKE_ATTR_DEAD;
|
2023-01-28 00:23:54 +00:00
|
|
|
int unlink_file(const char *) MAKE_ATTR_USE;
|
2022-02-05 20:03:50 +00:00
|
|
|
void execDie(const char *, const char *);
|
|
|
|
char *getTmpdir(void) MAKE_ATTR_USE;
|
|
|
|
bool ParseBoolean(const char *, bool) MAKE_ATTR_USE;
|
|
|
|
const char *cached_realpath(const char *, char *);
|
|
|
|
bool GetBooleanExpr(const char *, bool);
|
|
|
|
|
|
|
|
/* parse.c */
|
|
|
|
void Parse_Init(void);
|
|
|
|
void Parse_End(void);
|
|
|
|
|
2022-07-26 15:52:53 +00:00
|
|
|
void PrintLocation(FILE *, bool, const GNode *);
|
2022-02-05 20:03:50 +00:00
|
|
|
void PrintStackTrace(bool);
|
|
|
|
void Parse_Error(ParseErrorLevel, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
|
|
|
|
bool Parse_VarAssign(const char *, bool, GNode *) MAKE_ATTR_USE;
|
|
|
|
void Parse_File(const char *, int);
|
|
|
|
void Parse_PushInput(const char *, unsigned, unsigned, Buffer,
|
|
|
|
struct ForLoop *);
|
|
|
|
void Parse_MainName(GNodeList *);
|
|
|
|
int Parse_NumErrors(void) MAKE_ATTR_USE;
|
2023-01-28 00:23:54 +00:00
|
|
|
unsigned int CurFile_CondMinDepth(void) MAKE_ATTR_USE;
|
2023-06-27 20:29:43 +00:00
|
|
|
void Parse_GuardElse(void);
|
|
|
|
void Parse_GuardEndif(void);
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* suff.c */
|
|
|
|
void Suff_Init(void);
|
|
|
|
void Suff_End(void);
|
|
|
|
|
|
|
|
void Suff_ClearSuffixes(void);
|
|
|
|
bool Suff_IsTransform(const char *) MAKE_ATTR_USE;
|
|
|
|
GNode *Suff_AddTransform(const char *);
|
|
|
|
void Suff_EndTransform(GNode *);
|
|
|
|
void Suff_AddSuffix(const char *);
|
|
|
|
SearchPath *Suff_GetPath(const char *) MAKE_ATTR_USE;
|
|
|
|
void Suff_ExtendPaths(void);
|
|
|
|
void Suff_AddInclude(const char *);
|
|
|
|
void Suff_AddLib(const char *);
|
|
|
|
void Suff_FindDeps(GNode *);
|
|
|
|
SearchPath *Suff_FindPath(GNode *) MAKE_ATTR_USE;
|
|
|
|
void Suff_SetNull(const char *);
|
|
|
|
void Suff_PrintAll(void);
|
|
|
|
char *Suff_NamesStr(void) MAKE_ATTR_USE;
|
|
|
|
|
|
|
|
/* targ.c */
|
|
|
|
void Targ_Init(void);
|
|
|
|
void Targ_End(void);
|
|
|
|
|
|
|
|
void Targ_Stats(void);
|
|
|
|
GNodeList *Targ_List(void) MAKE_ATTR_USE;
|
|
|
|
GNode *GNode_New(const char *) MAKE_ATTR_USE;
|
|
|
|
GNode *Targ_FindNode(const char *) MAKE_ATTR_USE;
|
|
|
|
GNode *Targ_GetNode(const char *) MAKE_ATTR_USE;
|
|
|
|
GNode *Targ_NewInternalNode(const char *) MAKE_ATTR_USE;
|
|
|
|
GNode *Targ_GetEndNode(void);
|
|
|
|
void Targ_FindList(GNodeList *, StringList *);
|
|
|
|
void Targ_PrintCmds(GNode *);
|
|
|
|
void Targ_PrintNode(GNode *, int);
|
|
|
|
void Targ_PrintNodes(GNodeList *, int);
|
|
|
|
const char *Targ_FmtTime(time_t) MAKE_ATTR_USE;
|
|
|
|
void Targ_PrintType(GNodeType);
|
|
|
|
void Targ_PrintGraph(int);
|
|
|
|
void Targ_Propagate(void);
|
|
|
|
const char *GNodeMade_Name(GNodeMade) MAKE_ATTR_USE;
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
#ifdef CLEANUP
|
|
|
|
void Parse_RegisterCommand(char *);
|
|
|
|
#else
|
|
|
|
/* ARGSUSED */
|
|
|
|
MAKE_INLINE
|
|
|
|
void Parse_RegisterCommand(char *cmd MAKE_ATTR_UNUSED)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
/* var.c */
|
|
|
|
void Var_Init(void);
|
|
|
|
void Var_End(void);
|
|
|
|
|
|
|
|
typedef enum VarEvalMode {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Only parse the expression but don't evaluate any part of it.
|
|
|
|
*
|
|
|
|
* TODO: Document what Var_Parse and Var_Subst return in this mode.
|
|
|
|
* As of 2021-03-15, they return unspecified, inconsistent results.
|
|
|
|
*/
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
VARE_PARSE,
|
2022-02-05 20:03:50 +00:00
|
|
|
|
2023-04-24 23:44:30 +00:00
|
|
|
/*
|
|
|
|
* Parse text in which '${...}' and '$(...)' are not parsed as
|
|
|
|
* subexpressions (with all their individual escaping rules) but
|
|
|
|
* instead simply as text with balanced '${}' or '$()'. Other '$'
|
|
|
|
* are copied verbatim.
|
|
|
|
*/
|
|
|
|
VARE_PARSE_BALANCED,
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/* Parse and evaluate the expression. */
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
VARE_EVAL,
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse and evaluate the expression. It is an error if a
|
|
|
|
* subexpression evaluates to undefined.
|
|
|
|
*/
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
VARE_EVAL_DEFINED,
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse and evaluate the expression. Keep undefined variables as-is
|
|
|
|
* instead of expanding them to an empty string.
|
|
|
|
*
|
|
|
|
* Example for a ':=' assignment:
|
|
|
|
* CFLAGS = $(.INCLUDES)
|
|
|
|
* CFLAGS := -I.. $(CFLAGS)
|
|
|
|
* # If .INCLUDES (an undocumented special variable, by the
|
|
|
|
* # way) is still undefined, the updated CFLAGS becomes
|
|
|
|
* # "-I.. $(.INCLUDES)".
|
|
|
|
*/
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
VARE_EVAL_KEEP_UNDEFINED,
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse and evaluate the expression. Keep '$$' as '$$' and preserve
|
|
|
|
* undefined subexpressions.
|
|
|
|
*/
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
VARE_EVAL_KEEP_DOLLAR_AND_UNDEFINED
|
2022-02-05 20:03:50 +00:00
|
|
|
} VarEvalMode;
|
|
|
|
|
|
|
|
typedef enum VarSetFlags {
|
|
|
|
VAR_SET_NONE = 0,
|
|
|
|
|
|
|
|
/* do not export */
|
|
|
|
VAR_SET_NO_EXPORT = 1 << 0,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Make the variable read-only. No further modification is possible,
|
2023-04-24 23:44:30 +00:00
|
|
|
* except for another call to Var_Set with the same flag. See the
|
|
|
|
* special targets '.NOREADONLY' and '.READONLY'.
|
2022-02-05 20:03:50 +00:00
|
|
|
*/
|
2024-05-14 04:13:22 +00:00
|
|
|
VAR_SET_READONLY = 1 << 1,
|
|
|
|
VAR_SET_INTERNAL = 1 << 2
|
2022-02-05 20:03:50 +00:00
|
|
|
} VarSetFlags;
|
|
|
|
|
|
|
|
typedef enum VarExportMode {
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
/* .export-all */
|
|
|
|
VEM_ALL,
|
2022-02-05 20:03:50 +00:00
|
|
|
/* .export-env */
|
|
|
|
VEM_ENV,
|
|
|
|
/* .export: Initial export or update an already exported variable. */
|
|
|
|
VEM_PLAIN,
|
|
|
|
/* .export-literal: Do not expand the variable value. */
|
|
|
|
VEM_LITERAL
|
|
|
|
} VarExportMode;
|
|
|
|
|
|
|
|
void Var_Delete(GNode *, const char *);
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
#ifdef CLEANUP
|
|
|
|
void Var_DeleteAll(GNode *scope);
|
|
|
|
#endif
|
2022-02-05 20:03:50 +00:00
|
|
|
void Var_Undef(const char *);
|
|
|
|
void Var_Set(GNode *, const char *, const char *);
|
|
|
|
void Var_SetExpand(GNode *, const char *, const char *);
|
|
|
|
void Var_SetWithFlags(GNode *, const char *, const char *, VarSetFlags);
|
|
|
|
void Var_Append(GNode *, const char *, const char *);
|
|
|
|
void Var_AppendExpand(GNode *, const char *, const char *);
|
|
|
|
bool Var_Exists(GNode *, const char *) MAKE_ATTR_USE;
|
|
|
|
bool Var_ExistsExpand(GNode *, const char *) MAKE_ATTR_USE;
|
|
|
|
FStr Var_Value(GNode *, const char *) MAKE_ATTR_USE;
|
|
|
|
const char *GNode_ValueDirect(GNode *, const char *) MAKE_ATTR_USE;
|
2023-04-24 23:44:30 +00:00
|
|
|
FStr Var_Parse(const char **, GNode *, VarEvalMode);
|
|
|
|
char *Var_Subst(const char *, GNode *, VarEvalMode);
|
Import bmake-20240625
Intersting/relevant changes since bmake-20240520
ChangeLog since bmake-20240520
2024-06-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240625
Merge with NetBSD make, pick up
o job.c: ensure shellPath is always duped, avoid upsetting free()
2024-06-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240616
Merge with NetBSD make, pick up
o clean up collection of context information for error messages
o in warnings, move the word "warning" to the front
o var.c: throw an error on attempt to override an internal
read-only variable
2024-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240610
Merge with NetBSD make, pick up
o for.c: remove redundant shortcut for building the .for loop body
2024-06-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240602
Merge with NetBSD make, pick up
o rename some VarEvalMode constants to better match debug names.
o var.c: avoid out-of-bounds read when parsing indirect modifiers.
2024-06-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240601
Merge with NetBSD make, pick up
o add .export-all rather than allow .export with no argument
which can happen accidentally.
o if lua is available, run check-expect.lua after unit-tests
o main.c: use snprintf rather than strncpy
fix memory leak when purging realpath cache.
2024-05-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240528
Merge with NetBSD make, pick up
o fix a number of memory leaks
o replace magic numbers with POSIX FILENO constants
o hash.c: remove dead code from HashTable_DeleteEntry
o main.c: when complaining about unusable .OBJDIR
call PrintOnError if MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is true.
o parse.c: use fewer technical terms in debug message for dependency
mk/ChangeLog since bmake-20240520
2024-06-22 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240616
* dirdeps.mk: apply DEP_DIRDEPS_BUILD_DIR_FILTER after we have
computed build dirs, since some filters cannot be easily expressed via
DEP_DIRDEPS_FILTER.
2024-05-31 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: move reset of DIRDEPS_EXPORT_VARS
until after we a finished with it if building a cache.
2024-06-29 00:16:32 +00:00
|
|
|
char *Var_SubstInTarget(const char *, GNode *);
|
2022-02-05 20:03:50 +00:00
|
|
|
void Var_Expand(FStr *, GNode *, VarEvalMode);
|
|
|
|
void Var_Stats(void);
|
|
|
|
void Var_Dump(GNode *);
|
Import bmake-20240309
Intersting/relevant changes since bmake-20240108
ChangeLog since bmake-20240108
2024-03-10 Simon J Gerraty <sjg@beast.crufty.net>
* boot-strap: tests can take a long time; use a cookie to
skip them if bmake has not been updated since tests last
ran successfully.
* Makefile: Cygwin handles MANTARGET man
* unit-tests/Makefile: set BROKEN_TESTS for Cygwin
2024-03-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240309
Merge with NetBSD make, pick up
o set .ERROR_EXIT to the exit status of .ERROR_TARGET
this allows a .ERROR target to ignore the case of
.ERROR_EXIT==6 which just means that the build actually
failed somewhere else.
2024-03-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240303
* var.c: on IRIX we need both inttypes.h and stdint.h
2024-03-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240301
Merge with NetBSD make, pick up
o export variables with value from target scope
when appropriate.
2024-02-12 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240212
Merge with NetBSD make, pick up
o remove unneeded conditional-compilation toggles
INCLUDES, LIBRARIES, POSIX, SYSVINCLUDE, SYSVVARSUB,
GMAKEEXPORT NO_REGEX and SUNSHCMD
* configure.in: add check for regex.h
* var.c: replace use of NO_REGEX with HAVE_REGEX_H
2024-02-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240204
Merge with NetBSD make, pick up
o var.c: fix some lint (-dL) mode parsing issues
2024-02-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION: (_MAKE_VERSION): 20240202
Merge with NetBSD make, pick up
o make.1: note that arg to :D and :U can be empty
o var.c: $$ is not a parse error when .MAKE.SAVE_DOLLARS=no
mk/ChangeLog since bmake-20240108
2024-03-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240309
* meta.sys.mk: _metaError: if .ERROR_EXIT == 6, we do not
want to save the .ERROR_META_FILE
2024-02-20 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240220
* sys.dirdeps.mk, dirdeps-targets.mk, init.mk:
do not set .MAIN: dirdeps in sys.dirdeps.mk
dirdeps-targets.mk will do that for top-level builds
and init.mk will do it for others.
This allows a Makefile which has no need of 'dirdeps' to
set .MAIN for itself and "just work".
2024-02-18 Simon J Gerraty <sjg@beast.crufty.net>
* bsd.*.mk: for makefiles that get a bsd. symlink,
use _this in multiple inclusion tags since .PARSEFILE will not
DTRT when such a makefile is included directly by Makefile and
automatically (without bsd. prefix).
Since we cannot guarantee that our sys.mk will be used, we provide
a default _this in each makefile that gets a bsd. prefix such that
the value is the same regardless of bsd. prefix.
* subdir.mk: drop the !target guard on $SUBDIR_TARGETS
2024-02-12 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240212
* SPDX-License-Identifier: BSD-2-Clause
Add SPDX-License-Identifier to inidicate that I consider
my copyright on any of these makefiles equivalent to BSD-2-Clause
* autoconf.mk: allow for configure.ac as currently recommended
* subdir.mk: support @auto
which is replaced with each subdir that
has a [Mm]akefile.
* subdir.mk: include local.subdir.mk if it exists.
* subdir.mk: rework to handle .WAIT
2024-02-11 Simon J Gerraty <sjg@beast.crufty.net>
* subdir.mk: _SUBDIRUSE report the target we are entering subdirs for.
2024-02-10 Simon J Gerraty <sjg@beast.crufty.net>
* prog.mk: treat empty SRCS the same as undefined
2024-02-02 Simon J Gerraty <sjg@beast.crufty.net>
* Avoid undefined errors in lint (-dL) mode
* man.mk (CMT2DOC_FLAGS): note that -mm does mdoc(7)
2024-01-28 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240128
* FILES: add ccm.dep.mk for C++ modules
add suffixes.mk for common location for generic SUFFIX rules.
* auto.dep.mk autodep.mk meta.autodep.mk: include ccm.dep.mk
replace OBJ_EXTENSIONS with OBJ_SUFFIXES
* autodep.mk: leverage CXX_SUFFIXES for __depsrcs
and update style (spaces around = etc)
* init.mk: add OBJS_SRCS_FILTER to filter SRCS when
setting OBJS
* meta2deps.py: handle multiple ./ embedded in path better.
2024-03-14 02:14:41 +00:00
|
|
|
void Var_ReexportVars(GNode *);
|
2022-02-05 20:03:50 +00:00
|
|
|
void Var_Export(VarExportMode, const char *);
|
|
|
|
void Var_ExportVars(const char *);
|
|
|
|
void Var_UnExport(bool, const char *);
|
2023-01-28 00:23:54 +00:00
|
|
|
void Var_ReadOnly(const char *, bool);
|
2022-02-05 20:03:50 +00:00
|
|
|
|
|
|
|
void Global_Set(const char *, const char *);
|
|
|
|
void Global_Append(const char *, const char *);
|
|
|
|
void Global_Delete(const char *);
|
2023-01-28 00:23:54 +00:00
|
|
|
void Global_Set_ReadOnly(const char *, const char *);
|
2022-02-05 20:03:50 +00:00
|
|
|
|
Import bmake-20240430
Intersting/relevant changes since bmake-20240309
ChangeLog since bmake-20240309
2024-04-30 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240430
Merge with NetBSD make, pick up
o main.c: ensure '.include <makefile>' respects MAKESYSPATH.
Dir_FindFile will search .CURDIR first unless ".DOTLAST" is seen.
2024-04-28 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240428
Merge with NetBSD make, pick up
o simplify freeing of lists
o arch.c: trim pointless comments
o var.c: delay variable assignments until actually needed
don't reallocate memory after evaluating an expression, result is
almost always short-lived.
2024-04-26 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240426
Merge with NetBSD make, pick up
o job.c: in debug output, print the directory in which a job
failed at same time as failed target so it is more easily found in
build log.
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240424
Merge with NetBSD make, pick up
o clean up comments, code and tests
2024-04-23 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240422
Merge with NetBSD make, pick up
o var.c: avoid LazyBuf for :*time modifiers.
LazyBuf's are not nul terminated so not suitable for passing to
functions that expect that. These modifiers are used sparingly so
an extra allocation is not a problem.
2024-04-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240420
Merge with NetBSD make, pick up
o provide more context information for parse/evaluate errors
2024-04-14 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240414
Merge with NetBSD make, pick up
o parse.c: print -dp debug info earlier so we see which
.if or .for line is being parsed.
2024-04-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240404
Merge with NetBSD make, pick up
o fix some unit tests for Cygwin
o parse.c: exit immediately after reading a null byte from a makefile
* fix generation of bmake.cat1
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240314
Add/Improve support for Cygwin
o uname -s output isn't useful so allow configure to
set FORCE_MAKE_OS - to force the value of .MAKE.OS
and use Cygwin which matches uname -o
o fix some unit-tests for Cygwin
* configure.in: use_makefile=no for Cygwin et al.
NOTE: bmake does not support Cygwin and likely never will,
mk/ChangeLog since bmake-20240309
2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
* meta.autodep.mk: do not override start_utc
2024-04-18 Simon J Gerraty <sjg@beast.crufty.net>
* sys.dirdeps.mk: set defaults for DEP_* at level 0 too.
These help when first include of Makefile.depend happens in a leaf
dir.
* install-mk (MK_VERSION): 20240414
2024-04-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240408
* init.mk: allow for _ as well as . to join V
and Q from QUALIFIED_VAR_LIST and VAR_QUALIFIER_LIST.
* progs.mk: avoid overlap between PROG_VARS and
init.mk's QUALIFIED_VAR_LIST since PROG would also
match its VAR_QUALIFIER_LIST,
libs.mk does not have the same issue.
* subdir.mk: _SUBDIRUSE for realinstall should run install
remove include of ${.CURDIR}/Makefile.inc that can be done via
local.subdir.mk where needed
* own.mk: do not conflict with man.mk
2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240314
* add sys/Cygwin.mk from Christian Franke
2024-05-03 22:43:12 +00:00
|
|
|
const char *EvalStack_Details(void);
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
/* util.c */
|
|
|
|
typedef void (*SignalProc)(int);
|
|
|
|
SignalProc bmake_signal(int, SignalProc);
|
|
|
|
|
|
|
|
/* make.c */
|
2020-11-20 03:54:37 +00:00
|
|
|
void GNode_UpdateYoungestChild(GNode *, GNode *);
|
2022-02-05 20:03:50 +00:00
|
|
|
bool GNode_IsOODate(GNode *) MAKE_ATTR_USE;
|
2020-11-07 19:39:21 +00:00
|
|
|
void Make_ExpandUse(GNodeList *);
|
2022-02-05 20:03:50 +00:00
|
|
|
time_t Make_Recheck(GNode *) MAKE_ATTR_USE;
|
2012-06-08 21:57:36 +00:00
|
|
|
void Make_HandleUse(GNode *, GNode *);
|
|
|
|
void Make_Update(GNode *);
|
2021-06-25 18:16:24 +00:00
|
|
|
void GNode_SetLocalVars(GNode *);
|
|
|
|
bool Make_Run(GNodeList *);
|
2022-02-05 20:03:50 +00:00
|
|
|
bool shouldDieQuietly(GNode *, int) MAKE_ATTR_USE;
|
2012-06-08 21:57:36 +00:00
|
|
|
void PrintOnError(GNode *, const char *);
|
2021-06-25 18:16:24 +00:00
|
|
|
void Main_ExportMAKEFLAGS(bool);
|
|
|
|
bool Main_SetObjdir(bool, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
|
2022-02-05 20:03:50 +00:00
|
|
|
int mkTempFile(const char *, char *, size_t) MAKE_ATTR_USE;
|
Import bmake-20240108
Interesting/relevant changes since bmake-20230909
* VERSION (_MAKE_VERSION): 20240106
Merge with NetBSD make, pick up
o fix duplicate progname when reporting an unknown target
o unit tests for Cmd_Exec using temp file
* VERSION (_MAKE_VERSION): 20240105
Merge with NetBSD make, pick up
o main.c: Cmd_Exec write cmd to a file if too big
avoid blowing commandline/env limits
* VERSION (_MAKE_VERSION): 20240101
o util.c: flesh out more of strftime
* configure.in: add --with-bmake-strftime
it is not a full implementation but enough to pass all
the unit-tests.
* parse.c: LoadFile do not append \n to empty buffer.
* VERSION (_MAKE_VERSION): 20231230
Merge with NetBSD make, pick up
o simplify memory allocation for string buffers
o fix declared types of list nodes
o suff.c: clean up freeing of suffixes
o var.c: simplify debug message for the ':@var@...@' modifier
clean up variable handling
* VERSION (_MAKE_VERSION): 20231226
Merge with NetBSD make, pick up
o compat.c: ensure make's output is correctly ordered with that of
the target when not going to a tty
o main.c: check for shellPath whether to call Shell_Init()
* VERSION (_MAKE_VERSION): 20231224
Merge with NetBSD make, pick up
o compat.c: check for shellPath whether to call Shell_Init()
tweak the unit test to detect the bug thus fixed.
o make.1: do not claim .SHELL is only used by jobs mode.
* VERSION (_MAKE_VERSION): 20231220
Merge with NetBSD make, pick up
o str.c: speed up pattern matching in the ':M' modifier
o var.c: fix confusing debug logging when deleting a variable
use consistent debug messages style when ignoring variables
* VERSION (_MAKE_VERSION): 20231210
Merge with NetBSD make, pick up
o var.c: avoid segfault on empty :C match expression
explain in debug log why variable assignment is ignored.
* VERSION (_MAKE_VERSION): 20231208
Merge with NetBSD make, pick up
o var.c: ensure fromCmd is set correctly for variables set on
command line.
* VERSION (_MAKE_VERSION): 20231124
Merge with NetBSD make, pick up
o main.c: cleanup processing of -j
fix lint warning about strchr
o var.c: more accurate error message for invalid ':mtime' argument
cleanup :[...] modifier
avoid reading beyond substring when comparing
o unit-tests cover all cases of :mtime, test and explain exporting
of variables
o cleanup comments
* bsd.after-import.mk (ECHO_TAG): FreeBSD no longer uses
$FreeBSD$ tag, so avoid adding it.
mk/ChangeLog since bmake-20230909
* dirdeps.mk: for MAKE_VERSION 20240105 we do not have the same
limits on command line length, so skip export of lists to env.
* jobs.mk: avoid C suffix in JOB_MAX_C if factor is floating
point. This keeps JOB_MAX numeric incase another makefile does
comparisons.
* gendirdeps.mk: if META_XTRAS is passed to us, add to META_FILES
2024-01-14 01:16:25 +00:00
|
|
|
void AppendWords(StringList *, char *);
|
2020-09-05 16:11:04 +00:00
|
|
|
void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *);
|
2022-02-05 20:03:50 +00:00
|
|
|
bool GNode_ShouldExecute(GNode *gn) MAKE_ATTR_USE;
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2023-01-28 00:23:54 +00:00
|
|
|
#ifndef HAVE_STRLCPY
|
|
|
|
size_t strlcpy(char *, const char *, size_t);
|
|
|
|
#endif
|
|
|
|
|
2020-11-07 19:39:21 +00:00
|
|
|
/* See if the node was seen on the left-hand side of a dependency operator. */
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2020-11-07 19:39:21 +00:00
|
|
|
GNode_IsTarget(const GNode *gn)
|
|
|
|
{
|
2021-12-18 07:27:22 +00:00
|
|
|
return (gn->type & OP_OPMASK) != OP_NONE;
|
2020-11-07 19:39:21 +00:00
|
|
|
}
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2020-11-07 19:39:21 +00:00
|
|
|
GNode_Path(const GNode *gn)
|
|
|
|
{
|
2021-01-14 01:24:34 +00:00
|
|
|
return gn->path != NULL ? gn->path : gn->name;
|
|
|
|
}
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2021-01-14 01:24:34 +00:00
|
|
|
GNode_IsWaitingFor(const GNode *gn)
|
|
|
|
{
|
2021-12-18 07:27:22 +00:00
|
|
|
return gn->flags.remake && gn->made <= REQUESTED;
|
2021-01-14 01:24:34 +00:00
|
|
|
}
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2021-01-14 01:24:34 +00:00
|
|
|
GNode_IsReady(const GNode *gn)
|
|
|
|
{
|
|
|
|
return gn->made > DEFERRED;
|
|
|
|
}
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2021-01-14 01:24:34 +00:00
|
|
|
GNode_IsDone(const GNode *gn)
|
|
|
|
{
|
|
|
|
return gn->made >= MADE;
|
|
|
|
}
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2021-01-14 01:24:34 +00:00
|
|
|
GNode_IsError(const GNode *gn)
|
|
|
|
{
|
|
|
|
return gn->made == ERROR || gn->made == ABORTED;
|
2020-11-07 19:39:21 +00:00
|
|
|
}
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
|
|
|
GNode_IsMainCandidate(const GNode *gn)
|
|
|
|
{
|
|
|
|
return (gn->type & (OP_NOTMAIN | OP_USE | OP_USEBEFORE |
|
|
|
|
OP_EXEC | OP_TRANSFORM)) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return whether the target file should be preserved on interrupt. */
|
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
|
|
|
GNode_IsPrecious(const GNode *gn)
|
|
|
|
{
|
|
|
|
/* XXX: Why are '::' targets precious? */
|
|
|
|
return allPrecious || gn->type & (OP_PRECIOUS | OP_DOUBLEDEP);
|
|
|
|
}
|
|
|
|
|
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2021-02-11 01:51:11 +00:00
|
|
|
GNode_VarTarget(GNode *gn) { return GNode_ValueDirect(gn, TARGET); }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2021-02-11 01:51:11 +00:00
|
|
|
GNode_VarOodate(GNode *gn) { return GNode_ValueDirect(gn, OODATE); }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2021-02-11 01:51:11 +00:00
|
|
|
GNode_VarAllsrc(GNode *gn) { return GNode_ValueDirect(gn, ALLSRC); }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2021-02-11 01:51:11 +00:00
|
|
|
GNode_VarImpsrc(GNode *gn) { return GNode_ValueDirect(gn, IMPSRC); }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2021-02-11 01:51:11 +00:00
|
|
|
GNode_VarPrefix(GNode *gn) { return GNode_ValueDirect(gn, PREFIX); }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2021-02-11 01:51:11 +00:00
|
|
|
GNode_VarArchive(GNode *gn) { return GNode_ValueDirect(gn, ARCHIVE); }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE const char * MAKE_ATTR_USE
|
2021-02-11 01:51:11 +00:00
|
|
|
GNode_VarMember(GNode *gn) { return GNode_ValueDirect(gn, MEMBER); }
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE void * MAKE_ATTR_USE
|
2021-12-18 07:27:22 +00:00
|
|
|
UNCONST(const void *ptr)
|
|
|
|
{
|
|
|
|
void *ret;
|
|
|
|
memcpy(&ret, &ptr, sizeof(ret));
|
|
|
|
return ret;
|
|
|
|
}
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2015-10-21 22:14:23 +00:00
|
|
|
/* At least GNU/Hurd systems lack hardcoded MAXPATHLEN/PATH_MAX */
|
|
|
|
#ifdef HAVE_LIMITS_H
|
|
|
|
#include <limits.h>
|
|
|
|
#endif
|
2014-01-26 07:40:17 +00:00
|
|
|
#ifndef MAXPATHLEN
|
2015-10-21 22:14:23 +00:00
|
|
|
#define MAXPATHLEN BMAKE_PATH_MAX
|
|
|
|
#endif
|
|
|
|
#ifndef PATH_MAX
|
|
|
|
#define PATH_MAX MAXPATHLEN
|
2014-01-26 07:40:17 +00:00
|
|
|
#endif
|
|
|
|
|
2017-07-24 00:52:52 +00:00
|
|
|
#if defined(SYSV)
|
2021-01-14 01:24:34 +00:00
|
|
|
#define KILLPG(pid, sig) kill(-(pid), (sig))
|
2017-07-24 00:52:52 +00:00
|
|
|
#else
|
2021-01-14 01:24:34 +00:00
|
|
|
#define KILLPG(pid, sig) killpg((pid), (sig))
|
2017-07-24 00:52:52 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2020-11-20 03:54:37 +00:00
|
|
|
ch_isalnum(char ch) { return isalnum((unsigned char)ch) != 0; }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2020-11-20 03:54:37 +00:00
|
|
|
ch_isalpha(char ch) { return isalpha((unsigned char)ch) != 0; }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2020-11-20 03:54:37 +00:00
|
|
|
ch_isdigit(char ch) { return isdigit((unsigned char)ch) != 0; }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
|
|
|
ch_islower(char ch) { return islower((unsigned char)ch) != 0; }
|
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2020-11-20 03:54:37 +00:00
|
|
|
ch_isspace(char ch) { return isspace((unsigned char)ch) != 0; }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool MAKE_ATTR_USE
|
2020-11-20 03:54:37 +00:00
|
|
|
ch_isupper(char ch) { return isupper((unsigned char)ch) != 0; }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE char MAKE_ATTR_USE
|
2020-11-20 03:54:37 +00:00
|
|
|
ch_tolower(char ch) { return (char)tolower((unsigned char)ch); }
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE char MAKE_ATTR_USE
|
2020-11-20 03:54:37 +00:00
|
|
|
ch_toupper(char ch) { return (char)toupper((unsigned char)ch); }
|
|
|
|
|
|
|
|
MAKE_INLINE void
|
2020-11-07 19:39:21 +00:00
|
|
|
cpp_skip_whitespace(const char **pp)
|
|
|
|
{
|
2021-01-14 01:24:34 +00:00
|
|
|
while (ch_isspace(**pp))
|
|
|
|
(*pp)++;
|
2020-11-07 19:39:21 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 03:54:37 +00:00
|
|
|
MAKE_INLINE void
|
|
|
|
cpp_skip_hspace(const char **pp)
|
|
|
|
{
|
2021-01-14 01:24:34 +00:00
|
|
|
while (**pp == ' ' || **pp == '\t')
|
|
|
|
(*pp)++;
|
2020-11-20 03:54:37 +00:00
|
|
|
}
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
MAKE_INLINE bool
|
|
|
|
cpp_skip_string(const char **pp, const char *s)
|
|
|
|
{
|
|
|
|
const char *p = *pp;
|
|
|
|
while (*p == *s && *s != '\0')
|
|
|
|
p++, s++;
|
|
|
|
if (*s == '\0')
|
|
|
|
*pp = p;
|
|
|
|
return *s == '\0';
|
|
|
|
}
|
|
|
|
|
2020-11-20 03:54:37 +00:00
|
|
|
MAKE_INLINE void
|
2020-11-07 19:39:21 +00:00
|
|
|
pp_skip_whitespace(char **pp)
|
|
|
|
{
|
2021-01-14 01:24:34 +00:00
|
|
|
while (ch_isspace(**pp))
|
|
|
|
(*pp)++;
|
2020-11-07 19:39:21 +00:00
|
|
|
}
|
|
|
|
|
2020-11-20 03:54:37 +00:00
|
|
|
MAKE_INLINE void
|
|
|
|
pp_skip_hspace(char **pp)
|
|
|
|
{
|
2021-01-14 01:24:34 +00:00
|
|
|
while (**pp == ' ' || **pp == '\t')
|
|
|
|
(*pp)++;
|
2020-11-20 03:54:37 +00:00
|
|
|
}
|
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
#if defined(lint)
|
Import bmake-20230909
Update import.sh to generate below
ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230909
Merge with NetBSD make, pick up
o main.c: allow -j to compute a multiple of ncpu
If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating
point number or ends in 'C' compute .MAKE.JOBS as a multiple of
_SC_NPROCESSORS_ONLN
.MAKE.JOBS.C will be "yes" if -jC is supported
2023-08-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230820
Merge with NetBSD make, pick up
o make.1: note that :localtime is better for %s
o parse.c: improve error messages for invalid input.
o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get
correct result, it is still better to use %s:L:localtime.
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230818
Merge with NetBSD make, pick up
o meta.c: meta_ignore - check raw path against metaIgnorePaths
to potentially skip call to realpath.
o var.c: be strict when parsing the argument of the ':mtime' modifier
o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}'
should be used to get an equivalent value to time(3).
2023-08-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230816
Merge with NetBSD make, pick up
o cond.c: clean up multiple-inclusion guards
2023-07-25 Simon J Gerraty <sjg@beast.crufty.net>
* unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS
if configure cannot work out how to control TZ.
Remove varmod-localtime from BROKEN_TESTS for IRIX*
2023-07-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230723
* configure.in: fix the test for wether TZ=Europe/Berlin works.
Depending on the time of year, if run between 22:00 and 00:00 UTC
the check in configure would fail incorrectly.
Take the day into account as well.
2023-07-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
Merge with NetBSD make, pick up
o make.1: clean up wording, clarify scope of '!' in conditions
2023-07-15 Simon J Gerraty <sjg@beast.crufty.net>
* make-bootstrap.sh.in: set prefix
If configure is run using ksh we get unexpanded ${prefix} in
DEFAULT_SYS_PATH, by ensuring prefix is set we should still get
correct result.
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
bump version for IRIX tweaks
* make.h: undef OP_NONE if defined
* unit-tests/Makefile: set BROKEN_TESTS for IRIX
* configure.in: override INSTALL on IRIX
2023-06-27 Simon J Gerraty <sjg@beast.crufty.net>
* boot-strap op_test: ensure we set TEST_MAKE as we want it.
mk/ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* jobs.mk (JOB_MAX): use -jC if we can
we actually use JOB_MAX_C which defaults to 1.33C
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* now_utc: %s only works with :localtime
2023-07-14 Simon J Gerraty <sjg@beast.crufty.net>
* install-sh: ignore -c as claimed and only insist on
a directory for destination when more than one file to copy.
* sys.mk: when looking for SYS_OS_MK try ${.MAKE.OS} and
${.MAKE.OS:S,64,,} early (so we find sys/IRIX.mk for IRIX64)
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230711
* sys.mk: set SYS_MK and INSTALL_SH for systems with incompatible
install(1)
* sys/IRIX.mk: when setting ROOT_GROUP only match the first :0:
set INSTALL to install-sh rather than pathname that may not exist
(yet).
2023-07-07 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: pass DIRDEP_TARGETS to DIRDEP_MAKE
normally this is empty - for the default target, but there are
use-cases where we might set it to something else.
2023-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230704
* dirdeps.mk: apply DEBUG_DIRDEPS_LIST_FILTER to lists we output
when DEBUG_DIRDEPS is in effect.
Eg. DEBUG_DIRDEPS_LIST_FILTER=ts\n
can greatly improve readability.
2023-09-17 17:03:11 +00:00
|
|
|
void do_not_define_rcsid(void); /* for lint */
|
|
|
|
# define MAKE_RCSID(id) void do_not_define_rcsid(void)
|
2021-01-14 01:24:34 +00:00
|
|
|
#elif defined(MAKE_NATIVE)
|
2021-02-11 01:51:11 +00:00
|
|
|
# include <sys/cdefs.h>
|
2021-12-18 07:27:22 +00:00
|
|
|
# ifndef __IDSTRING
|
|
|
|
# define __IDSTRING(name,string) \
|
|
|
|
static const char name[] MAKE_ATTR_UNUSED = string
|
|
|
|
# endif
|
|
|
|
# ifndef __RCSID
|
|
|
|
# define __RCSID(s) __IDSTRING(rcsid,s)
|
|
|
|
# endif
|
|
|
|
# ifndef __COPYRIGHT
|
|
|
|
# define __COPYRIGHT(s) __IDSTRING(copyright,s)
|
|
|
|
# endif
|
2021-02-11 01:51:11 +00:00
|
|
|
# define MAKE_RCSID(id) __RCSID(id)
|
2021-01-14 01:24:34 +00:00
|
|
|
#elif defined(MAKE_ALL_IN_ONE) && defined(__COUNTER__)
|
2021-02-11 01:51:11 +00:00
|
|
|
# define MAKE_RCSID_CONCAT(x, y) CONCAT(x, y)
|
|
|
|
# define MAKE_RCSID(id) static volatile char \
|
2021-01-14 01:24:34 +00:00
|
|
|
MAKE_RCSID_CONCAT(rcsid_, __COUNTER__)[] = id
|
|
|
|
#elif defined(MAKE_ALL_IN_ONE)
|
Import bmake-20230909
Update import.sh to generate below
ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230909
Merge with NetBSD make, pick up
o main.c: allow -j to compute a multiple of ncpu
If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating
point number or ends in 'C' compute .MAKE.JOBS as a multiple of
_SC_NPROCESSORS_ONLN
.MAKE.JOBS.C will be "yes" if -jC is supported
2023-08-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230820
Merge with NetBSD make, pick up
o make.1: note that :localtime is better for %s
o parse.c: improve error messages for invalid input.
o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get
correct result, it is still better to use %s:L:localtime.
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230818
Merge with NetBSD make, pick up
o meta.c: meta_ignore - check raw path against metaIgnorePaths
to potentially skip call to realpath.
o var.c: be strict when parsing the argument of the ':mtime' modifier
o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}'
should be used to get an equivalent value to time(3).
2023-08-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230816
Merge with NetBSD make, pick up
o cond.c: clean up multiple-inclusion guards
2023-07-25 Simon J Gerraty <sjg@beast.crufty.net>
* unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS
if configure cannot work out how to control TZ.
Remove varmod-localtime from BROKEN_TESTS for IRIX*
2023-07-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230723
* configure.in: fix the test for wether TZ=Europe/Berlin works.
Depending on the time of year, if run between 22:00 and 00:00 UTC
the check in configure would fail incorrectly.
Take the day into account as well.
2023-07-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
Merge with NetBSD make, pick up
o make.1: clean up wording, clarify scope of '!' in conditions
2023-07-15 Simon J Gerraty <sjg@beast.crufty.net>
* make-bootstrap.sh.in: set prefix
If configure is run using ksh we get unexpanded ${prefix} in
DEFAULT_SYS_PATH, by ensuring prefix is set we should still get
correct result.
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
bump version for IRIX tweaks
* make.h: undef OP_NONE if defined
* unit-tests/Makefile: set BROKEN_TESTS for IRIX
* configure.in: override INSTALL on IRIX
2023-06-27 Simon J Gerraty <sjg@beast.crufty.net>
* boot-strap op_test: ensure we set TEST_MAKE as we want it.
mk/ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* jobs.mk (JOB_MAX): use -jC if we can
we actually use JOB_MAX_C which defaults to 1.33C
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* now_utc: %s only works with :localtime
2023-07-14 Simon J Gerraty <sjg@beast.crufty.net>
* install-sh: ignore -c as claimed and only insist on
a directory for destination when more than one file to copy.
* sys.mk: when looking for SYS_OS_MK try ${.MAKE.OS} and
${.MAKE.OS:S,64,,} early (so we find sys/IRIX.mk for IRIX64)
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230711
* sys.mk: set SYS_MK and INSTALL_SH for systems with incompatible
install(1)
* sys/IRIX.mk: when setting ROOT_GROUP only match the first :0:
set INSTALL to install-sh rather than pathname that may not exist
(yet).
2023-07-07 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: pass DIRDEP_TARGETS to DIRDEP_MAKE
normally this is empty - for the default target, but there are
use-cases where we might set it to something else.
2023-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230704
* dirdeps.mk: apply DEBUG_DIRDEPS_LIST_FILTER to lists we output
when DEBUG_DIRDEPS is in effect.
Eg. DEBUG_DIRDEPS_LIST_FILTER=ts\n
can greatly improve readability.
2023-09-17 17:03:11 +00:00
|
|
|
# define MAKE_RCSID(id) void do_not_define_rcsid(void)
|
2020-11-07 19:39:21 +00:00
|
|
|
#else
|
2021-02-11 01:51:11 +00:00
|
|
|
# define MAKE_RCSID(id) static volatile char rcsid[] = id
|
2020-11-07 19:39:21 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
#endif
|