Commit Graph

218 Commits

Author SHA1 Message Date
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
Juli Mallett
83739a1077 Diff reduction for great justice against NetBSD, cast to unsigned char when
passing an argument to isspace(3).
2002-06-20 19:28:00 +00:00
Juli Mallett
fe36b03b4c Fix a memory leak from previous commit by freeing the possibly expanded
string at the first opportunity, being sure to now always allocate the
new string from VarPossiblyExpand.  Oops.
2002-06-19 17:39:36 +00:00
Juli Mallett
0a9c401f9a Possibly expand the variable name's embedded variables before using it, as
seen (somewhat) in NetBSD.  This catches a few extra recursion cases that
could be hidden by expanding a NIL variable causing an existing variable to
be returned (which caused infinite looping and climbing memory usage in at
least one case).

Obtained from:	NetBSD (in principle)
2002-06-19 17:23:08 +00:00
Juli Mallett
be2694ca0e make(I) appeared in PWB UNIX. 2002-06-17 13:43:15 +00:00
Juli Mallett
a446b510a4 Avoid classy use of a variable one time with a constant value. 2002-06-13 08:57:53 +00:00
Juli Mallett
536ceed1fc Use %p to print a pointer, not %lx and a cast to (unsigned long). Yuck. 2002-06-13 08:55:29 +00:00
Juli Mallett
bea86ac44d Don't do stupid things to avoid unused parameters, mark them __unused. 2002-06-13 08:54:16 +00:00
Juli Mallett
d2c462cec8 String lengths and sizeof()s are size_t not int. Mark an unused parameter
of ReadMakefile as __unused, it's there because this function is used by
the abstracted list interface which normally deals with item handlers which
take two arguments.  Add a missing static prototype.
2002-06-12 04:18:31 +00:00
Juli Mallett
22c26d85e3 The error functions take constant pointers to strings for their format. 2002-06-12 04:11:01 +00:00
Juli Mallett
30617de0f3 Remove a stray asterisk in a comment. 2002-06-01 00:52:28 +00:00
Ruslan Ermilov
1ab9d5a384 mdoc(7) police: removed unnecessary .Ns's. 2002-05-30 05:47:50 +00:00
Ruslan Ermilov
1737392273 Back out the ``run shell from $PATH'' change; this was an overkill
and is insecure.

Requested by:	bde
2002-05-24 15:51:27 +00:00
Juli Mallett
e0bd05dc2f Set the MAKEFILE variable to the value passed to ReadMakefile(), not the full
path to it.  Use the full path only for parsing it.
2002-05-23 12:01:54 +00:00
Juli Mallett
8eccf3b248 str_concat() doesn't really take const arguments.
Submitted by:	bde
Pointy hat to:	jmallett
2002-05-22 15:34:00 +00:00
Ruslan Ermilov
ea98f295f7 Do not run shell from /bin, run it from $PATH.
Bump MAKE_VERSION to 5200205221.
2002-05-22 14:53:18 +00:00
Ruslan Ermilov
8e9bddc97b Added the MAKE_VERSION global that could be useful in determining
if a given make(1) is feature-compatible with a set of makefiles.

When merged, this will be used to replace the ugly upgrade_checks
hacks in src/Makefile.

Version has the RYYYYMMDDX format, where R is from RELENG_<R> and
X allows for 10 distinguishable changes per day.

Discussed with:	bde
2002-05-22 14:35:47 +00:00
Juli Mallett
27ffa61f2a Replace the evil that is __DECONST() with (void *). This is one of the least
evil things we can do involving the const qualifier and a pointer.

Submitted by:	bde, ru
2002-05-22 11:16:48 +00:00
Juli Mallett
21b8b7cb3c Make ReadMakefile() operate using the realpath(3) name for the file handed to
it, which means that relative paths will be expanded to absolute paths, and
filenames without a path will end up with their absolute path included as
well.  This aids tremendously in debugging a build using our make(1) with
multiple Makefile's, such as when there is a syntax error in a file in a
sub-directory as per <bsd.subdir.mk>.  Normally we'd end up with just
"Makefile" known about the Makefile in question, which means that an error
would be useless for someone trying to debug their build system, now we
end up with a complete real pathname for the Makefile.

So mostly this is useful in a debugging context, but possibly others too
(I haven't thought of them yet, but they probably are more useful if you
make Dir_FindFile use realpath(3), but that's another story).

Reviewed by:	-current
MFC after:	2 weeks
2002-05-21 20:24:46 +00:00
Tom Rhodes
46c2a2cfa4 More consistancy. file system > filesystem 2002-05-16 02:19:14 +00:00
Juli Mallett
417485c74a Fix make(1) behaviour regarding SysV-style substitution when given a nil
left-hand-side.

PR:		bin/5297
Submitted by:	"Matthew Emmerton" <matt@gsicomp.on.ca>
MFC after:	1 week
2002-05-05 19:04:58 +00:00
Philippe Charnier
e8937ba009 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
David E. O'Brien
ccf3ce3e97 Move the sysV variable substitution up with the BSD feature that replaced it. 2002-04-19 04:08:35 +00:00
Ruslan Ermilov
78257b6288 Do not reset MAKEFILE when reading ".depend" as this rather
eliminates the usefulness of ${MAKEFILE}.

Obtained from:	NetBSD
MFC after:	1 week
2002-04-18 12:04:34 +00:00
David E. O'Brien
75a778e9f8 Back out rev 1.17, it breaks dependencies.
With rev 1.7 one cannot build src/bin/sh -- because make fails to create
the buildtools before trying to use them.  Actually it does compile the
buildtools into .o's before trying to use them, but not all the way into
binaries.
2002-04-14 04:15:34 +00:00
David E. O'Brien
ade4ded301 Revision 1.17 seems to break a subsequent buildworld (i.e. with the new
make installed) in gnu/usr.bin/groff/src/preproc/eqn (which, being a
build tool itself, is built with the original make during buildworld).

The problem seems to be that in str_concat(), the string is not
terminated when the length of the second string is 0.
This apparently can happen during null suffix rule processing.

Submitted by:	tmm
2002-04-13 19:36:47 +00:00
David E. O'Brien
79f407f91e Fix a minor lint warning. 2002-04-13 12:20:51 +00:00