Commit Graph

244 Commits

Author SHA1 Message Date
Juli Mallett
15ac7b352e Convert some broken cases where Error is called, but we try to continue,
to Fatal errors, because the logic that we use to try to continue is far
too broken, and makes things look and act weird, because we end up pointing
past the end of a buffer boundry into freed memory in the caller, as we
don't come close to setting the lengthPtr to a sane value.

Reviewed by:	make@

(This only changes failure cases which would have died horrid deaths to
 explicit clean death failure cases.)
2002-11-08 16:59:11 +00:00
Ruslan Ermilov
79c45f3bf9 Document the confusing behavior that the .if conditional defaults
to defined(), e.g., ``.if 1'' is equivalent to ``.if defined(1)'',
which is only true when the ${1} variable is defined.
2002-11-01 08:40:32 +00:00
Ruslan Ermilov
b382ba4fb1 bsd.doc.mk changes:
Don't gratuitously pipe thru a cat(1) if NODOCCOMPRESS.

Only create _stamp.extra when necessary.

Get rid of SOELIMPP and OBJS.

Use Groff version of soelim(1); we need its -I option
for the following to work.

Don't needlessly chdir to SRCDIR.  Only a few documents
need CD_HACK, and those that need it either use refer(1)
or .PSPIC macro which internally uses the .psbb call.
2002-10-29 14:56:09 +00:00
Juli Mallett
f67b533a2e In VarHead(), look into the correct (modified) string. 2002-10-29 12:11:56 +00:00
Ruslan Ermilov
36c4697a65 Mention that the left-hand side of the comparison
conditional must always be a variable expansion.

Obtained from:	PMake

Do not lie that debugging .for loops is a no-op.
2002-10-29 09:48:49 +00:00
Juli Mallett
85779f0ead Split var.c into var.c and var_modify.c and move all the modification funcs
to var_modify.c, for readability.  constify some low hanging fruit (string
manipulation functions) and the upper layers appropriately.  No longer use
the private strstr(3) implementation, while changing string code.

Tested by:      lots of successful make buildworld.
2002-10-28 23:33:57 +00:00
Juli Mallett
5d46839577 Fix problem with my ability to tell the difference between 'r' and 'l'... We
want to check var[1], not val[1].

Submitted by:	Mark Valentine <mark@thuvia.demon.co.uk>
Pointed out by:	sam
Pointy hat to:	jmallett
2002-10-24 20:37:58 +00:00
Juli Mallett
85ec8fdb1d When expanding a specific [1-char] variable, only expand said specific
[1-char] variable.  Don't just automatically expand something which
starts with that character.

Obtained from:	OpenBSD [3 years ago!]
2002-10-24 12:57:42 +00:00
Juli Mallett
775fb1e81e Duplicate the variable name in the v->name field, as otherwise it points to
data that will be modified.  And do the appropriate thing now and free the
v->name buffer along with other relinquished memory.

XXX There is duplication here of destroying a Var, which is probably bogus,
and probably missed in a few places.
2002-10-24 04:10:55 +00:00
Juli Mallett
cbfcb39874 Remove efree(), it isn't used consistently enough to even pretend that it
might help on the systems it could possibly be used as a bandaid for.  In
fact, the only thing it's useful for is instrumenting free(3) calls, and in
that capacity, it's better served as a local patch, than a public wrapper.
2002-10-23 23:16:43 +00:00
Juli Mallett
1d5e8e35b5 De-obfuscate and correct the include path handling for SysV style includes.
PR:		32759
Submitted by:	Mark Valentine
Reviewed by:	Matthew Emmerton" <matt@gsicomp.on.ca>
MFC after:	15 days
2002-10-23 01:57:33 +00:00
Juli Mallett
f8137bcf93 Move utilitarian routines to util.c, which isn't the same as the old
compatability-geared util.c.  These are things like message printers
and the PrintAddr function for traversing lists.  Other general-purpose
utilities inside make(1) can go here, in time.
2002-10-10 19:27:48 +00:00
Juli Mallett
4526ed6ffb Convert make(1) to use ANSI style function declarations. Variable
documentation already adequatedly existed in the description in most
cases.  Where it did not, it was added.  If no documentation existed
beforehand, then none was added.  Some unused dummies for use in the
traversal functions were marked as __unused during the conversion.
Occasionally, local style fixes were applied to lines already being
modified or influenced.

Now make(1) should always build with WARNS=3.
2002-10-09 03:42:10 +00:00
Juli Mallett
0ce3fbf191 Use __FBSDID in the lst.lib files, to match to main make(1) files. It is
defined to __RCSID when bootstrapping, by the Makefile, but this change is
for consistency
2002-10-09 02:00:22 +00:00
Juli Mallett
15c11220ee Remove extern declarations from functions and source files where they would
happily fit into headers.
2002-10-09 01:56:02 +00:00
Juli Mallett
cf382f5bb1 Remove unused local-locals, where upper-level locals may safely be used. 2002-10-09 01:51:00 +00:00
Juli Mallett
7e75296d52 Reference the correct local variable in all parts of a for loop, so we
operate on the correct data (properly).

Tracked down by:	Dan Nelson
2002-10-08 21:29:04 +00:00
Poul-Henning Kamp
5fd43411f3 Give make(1) the ability to use KQUEUE to wait for worker processes
instead of polling for them.

Unfortunately we cannot enable it yet because it panics the kernel
somewhere in kqueue.

Submitted by:	Stefan Farfeleder <e0026813@stud3.tuwien.ac.at>
2002-10-04 20:30:03 +00:00
Juli Mallett
80ce40f394 In lieu of a good way to prevent every possible looping in make(1), stop
there from being more than 500 processes forked by make(1), to prevent a
forkbomb from happening, in a dumb and mechanical way.

PR:		alane
Submitted by:	bin/42772
MFC after:	2 weeks
2002-10-03 04:32:47 +00:00
Juli Mallett
03f3a2a645 Code that has been #if0'd with the comment "WHY" since revision 1.1 can
disappear.
2002-10-02 16:06:39 +00:00
Juli Mallett
0b6a3508ac Remove 6-years-stale #if0, the behaviour isn't ever going to be limited to
compatible mode, as far as I know, since we use it...
2002-10-02 16:03:26 +00:00
Juli Mallett
40eecdba73 Fix spurious three-space indentation in a four-space indentation file. 2002-09-29 00:20:28 +00:00
Juli Mallett
3873e563fc Fix ability to use csh(1) as the make(1) shell.
Sponsored by:	Bright Path Solutions
2002-09-29 00:02:04 +00:00
Juli Mallett
763d9eb177 Make make(1) WARNS=6 clean except for const issues. This mostly involves
renaming variables to not shadow libc functions or greater scope locals.  Kinda
makes one wonder if the extern ones weren't meant in some of these places :)

The only thing I'd still like to do WRT this is possibly combine rstat and
status in compat.c -- that should be fine, as I do not think the codepaths
will want both around at once.

Sponsored by:	Bright Path Solutions
2002-09-28 23:35:07 +00:00
Juli Mallett
76e8db31fc Fix merge error in previous commit.
Sponsored by:	Bright Path Solutions
2002-09-28 20:04:17 +00:00
Juli Mallett
1e3d8881cf Add empty default cases where they should be, remove non-local execution stuff
in compat.c which doesn't even have preprocessor-conditional-hidden support
code, and add a debugging statement where we might end up with a nil list
somehow, but where I doubt it.

First confirmed userland kill for Flexelint.

Sponsored by:	Bright Path Solutions
2002-09-28 20:03:26 +00:00
Ruslan Ermilov
2420b40463 Document the parsing bug. 2002-09-27 09:21:07 +00:00
Juli Mallett
a08239b5d0 Remove a semicolon that appears to be a lie.
Spotted by:	SPARC64 make WARNS=3
Sponsored by:	Rachel Hestilow <rachel@jerkcity.com>
2002-09-26 06:44:30 +00:00
Juli Mallett
cac04057f2 When formatting the time for a target, use %H instead of %k, which is mostly
the same, but uses a non-extension option.

Sponsored by:	Rachel Hestilow <rachel@jerkcity.com>
2002-09-26 06:40:04 +00:00
Juli Mallett
4fed818c7e Don't declare things as extern when they will be static.
Sponsored by:	Rachel Hestilow <rachel@jerkcity.com>
2002-09-26 01:39:22 +00:00
Juli Mallett
2dbb6cf1cb Make the DEBUGF() macro portable by (ugh) adding a Debug() function, which
is merely printf() but to stderr.  This takes care of the caveat which lead
to the use of a vararg macro -- getting everything to stderr.
2002-09-18 16:13:03 +00:00
Juli Mallett
cdba64071c Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), using
variable length arguments to a macro.  Bump version as this makes DEBUG
statements *always* go to stderr rather than sometimes stdout.  There are
a few stragglers, which I will take care of as soon as I can.  Mostly these
relate to the need-for-death-of some of the remote job code.

Nearby stylistic nits and XXX added/fixed where appropriate.
2002-09-17 22:31:26 +00:00
Juli Mallett
37721c8309 #define<space> -> #define<tab> 2002-09-17 21:29:06 +00:00
Juli Mallett
0fd9fa89a9 Print debugging from DEBUG(VAR) level to stderr. About to macroise this.
(Read: More commits to come).

MFC in:		4 days.
2002-09-17 21:26:57 +00:00
Archie Cobbs
1b69f09c39 Make it clear that the ":C" variable modifier expects an extended
regular expression instead of an obsolete regular expression.
Also, cross-reference re_format(7) instead of regex(3).

MFC after:	3 days
2002-09-06 17:33:11 +00:00
Peter Wemm
7b2f27b0fe Deal with bootstrapping from an old -current (almost exactly a year old)
which fails the make tests (doesn't understand ${notdef:U}) and therefore
fails on __FBSDID in usr.bin/make/*.  -DBOOTSTRAPPING is no help here since
this is before we are using the new share/mk/* files, and it would conflict
with the builtin -DBOOTSTRAPPING support later.. so use a different flag.
2002-08-31 07:18:40 +00:00
Juli Mallett
acdb9a105e Add a -C ala GNU make(1) for Makefiles which are too lazy to use $(MAKE) and
this particular GNU flag.  It changes into the given directory for the
operation in question.  This just goes into said directory at the time of
parsing the argument for getopt(3).

Submitted by:	Rachel Hestilow <rachel@jerkcity.com>
2002-08-25 02:45:04 +00:00
Ruslan Ermilov
4612010cdd Allow embedded :' and !' in target names.
PR:		bin/6612
Obtained from:	OpenBSD
MFC after:	1 week
2002-08-20 12:50:32 +00:00
Juli Mallett
3a7fc8ce59 Remove local prototypes for main(). 2002-08-19 03:07:56 +00:00
Ruslan Ermilov
ef3a89cfe8 main.c:450: warning: `targs' might be used uninitialized in this function
Spotted by:	patrick@godloveya.com, naddy, -Wuninitialized

This segfaulted alpha and sparc64; i386 had this magically zeroed.
2002-08-11 11:10:43 +00:00
Ruslan Ermilov
19d732af8b Pacify ``make -f /dev/null -V FOO''. 2002-08-07 13:25:51 +00:00
Juli Mallett
716297c2d3 Print a warning when we are given two scripts for one target. This is neither
as wide-reaching nor intensive as NetBSD's similar, but the warning uses the
same text.

Inspired by:	NetBSD
2002-07-28 03:52:41 +00:00
Warner Losh
a366365a74 Back out jmallett's realpath changes. They break a set of makefiles that
we use in sublte ways with relative paths.  Until they can be resolved,
back out these changes and put a big comment about why using realpath is
busted.

Approved by: jmallett
MFC After:  100 millifortnights
2002-07-26 21:50:36 +00:00
Juli Mallett
19074b91d3 Bit-width fields should be of type 'int'. 2002-07-15 06:57:25 +00:00
Juli Mallett
9739527ffb Use %zu to print size_t. 2002-07-15 06:57:01 +00:00
Juli Mallett
9f3d7bf758 Fix a bug fixed by NetBSD in revision 1.42 of parse.c by christos which caused
an example Makefile I was showing someone just last night to report a variable
as being recursive.

Obtained from:	NetBSD
2002-06-20 19:51:13 +00:00
Juli Mallett
7fc2a9f90c More unsigned char casts to isupper(3).
Obtained from:	NetBSD
2002-06-20 19:45:44 +00:00
Juli Mallett
536dddacf1 Provide a heuristic for RCS conflicts.
Obtained from:	NetBSD
2002-06-20 19:44:34 +00:00
Juli Mallett
2431da5c7e Look for wildcards, and balanced meta-characters such as { and } like NetBSD
does.

Obtained from:	NetBSD
2002-06-20 19:41:21 +00:00
Juli Mallett
a63d92ee89 Expand a buffer to reduce diffs to NetBSD.
Obtained from:	NetBSD
2002-06-20 19:31:55 +00:00