Commit Graph

208 Commits

Author SHA1 Message Date
jmallett
2b6e4e1504 Remove local prototypes for main(). 2002-08-19 03:07:56 +00:00
ru
9f330c956f 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
ru
2c0f1f41c3 Pacify ``make -f /dev/null -V FOO''. 2002-08-07 13:25:51 +00:00
jmallett
5a6eb0ca5f 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
imp
7701b3e2af 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
jmallett
fed551e328 Bit-width fields should be of type 'int'. 2002-07-15 06:57:25 +00:00
jmallett
35fdcc10ba Use %zu to print size_t. 2002-07-15 06:57:01 +00:00
jmallett
3c86151887 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
jmallett
2b6583821c More unsigned char casts to isupper(3).
Obtained from:	NetBSD
2002-06-20 19:45:44 +00:00
jmallett
6fa0c764dc Provide a heuristic for RCS conflicts.
Obtained from:	NetBSD
2002-06-20 19:44:34 +00:00
jmallett
cf5af427a0 Look for wildcards, and balanced meta-characters such as { and } like NetBSD
does.

Obtained from:	NetBSD
2002-06-20 19:41:21 +00:00
jmallett
f59ce1b70d Expand a buffer to reduce diffs to NetBSD.
Obtained from:	NetBSD
2002-06-20 19:31:55 +00:00
jmallett
7ae269b640 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
jmallett
f27248e5ba 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
jmallett
4586b0f323 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
jmallett
1d6e66be9f make(I) appeared in PWB UNIX. 2002-06-17 13:43:15 +00:00
jmallett
63759e6467 Avoid classy use of a variable one time with a constant value. 2002-06-13 08:57:53 +00:00
jmallett
0ca350a1fa Use %p to print a pointer, not %lx and a cast to (unsigned long). Yuck. 2002-06-13 08:55:29 +00:00
jmallett
a41b038bb5 Don't do stupid things to avoid unused parameters, mark them __unused. 2002-06-13 08:54:16 +00:00
jmallett
c3b688425d 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
jmallett
7114af77d0 The error functions take constant pointers to strings for their format. 2002-06-12 04:11:01 +00:00
jmallett
020c0b0669 Remove a stray asterisk in a comment. 2002-06-01 00:52:28 +00:00
ru
297515d525 mdoc(7) police: removed unnecessary .Ns's. 2002-05-30 05:47:50 +00:00
ru
b4b6d4dfb9 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
jmallett
64477eb2ea 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
jmallett
a743481874 str_concat() doesn't really take const arguments.
Submitted by:	bde
Pointy hat to:	jmallett
2002-05-22 15:34:00 +00:00
ru
7d529109a8 Do not run shell from /bin, run it from $PATH.
Bump MAKE_VERSION to 5200205221.
2002-05-22 14:53:18 +00:00
ru
367d0965de 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
jmallett
59fd383a6e 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
jmallett
4c8f46cf75 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
trhodes
fa6c7efe3f More consistancy. file system > filesystem 2002-05-16 02:19:14 +00:00
jmallett
285791a696 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
charnier
ad8a79e6a5 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
obrien
a88daa02f8 Move the sysV variable substitution up with the BSD feature that replaced it. 2002-04-19 04:08:35 +00:00
ru
ea1a822782 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
obrien
0b2395fb4a 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
obrien
49304db558 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
obrien
dac9642299 Fix a minor lint warning. 2002-04-13 12:20:51 +00:00
obrien
296a363e57 Prefer BSDmakefile over makefile and Makefile.
Submitted by:	jmallett
Obtained from:	OpenBSD
2002-04-13 12:18:00 +00:00
obrien
40ecff682a Fix copyrights, and undo SCS ID damage. 2002-04-13 10:57:56 +00:00
obrien
f8ef670650 Update SCM ID method. 2002-04-13 10:17:18 +00:00
obrien
e2a368995a Make str_concat handle NULL arguments properly (a-la how ODE-2.3.6 make does).
Submitted by:	jmallett
Inspired by:	CMU BUILDTOOLS4 coredumping, ODE-2.3.6 make(1)
2002-04-13 10:13:39 +00:00
obrien
64ca819597 De'register. 2002-04-13 10:05:30 +00:00
obrien
dfc0fa60ce Constify str_concat()
Submitted by:	jmallett
2002-04-13 09:49:33 +00:00
obrien
9d111f7a74 Check to make sure fdopen() succeeds in make(1).
Submitted by:	jmallett
Inspired by:	NetBSD
2002-04-13 09:10:07 +00:00
charnier
ead5386a3c Un.Ar makefile. The add of .Ar was part of my last commit.
Asked by:	ru
2002-04-12 16:05:53 +00:00
charnier
a67f50f015 Reorder #include. Cast arg #2 of lseek to an off_t when constant. No need to
test if failsafe memory allocation fails, it can't. perror -> warn. Use
failsafe memory allocation provided.

Use .Pa and .Ar. Uppercase (first letter) programname after dot.
2002-04-12 13:23:33 +00:00
imp
7eed3429c0 o unifdef -D__STDC__
o remove badly bit-rotted compat file that likely won't work on the systems
  it purports to support.
2002-03-23 23:30:30 +00:00
imp
1698cb216e remove __P 2002-03-22 01:33:25 +00:00
cjc
1b7c0a19e3 make(1) claims to ignore the remainder of a conditional once its value
has been determined similar to C. That is, one expects a construction
like,

.if defined(TEST) && (${TEST:L} == "test")

Never to generate an error since the second expression should never be
evaluated when TEST is undefined.

However, this was not the case. The above fails with the current
make(1) if TEST is undefined. This patch fixes the above and many
similar cases.

PR:		bin/34032
Submitted by:	Alan Eldridge <alane@geeksrus.net>
MFC after:	1 week
2002-02-20 14:31:19 +00:00