Commit Graph

203 Commits

Author SHA1 Message Date
jmallett
f836f81d7e Bit-width fields should be of type 'int'. 2002-07-15 06:57:25 +00:00
jmallett
628d1557f9 Use %zu to print size_t. 2002-07-15 06:57:01 +00:00
jmallett
9c668cda70 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
35369281fe More unsigned char casts to isupper(3).
Obtained from:	NetBSD
2002-06-20 19:45:44 +00:00
jmallett
e60a9a71aa Provide a heuristic for RCS conflicts.
Obtained from:	NetBSD
2002-06-20 19:44:34 +00:00
jmallett
26790e5777 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
73f2e117bf Expand a buffer to reduce diffs to NetBSD.
Obtained from:	NetBSD
2002-06-20 19:31:55 +00:00
jmallett
0321c824f9 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
67770c1b81 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
0835cf6474 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
ba06fedaf3 make(I) appeared in PWB UNIX. 2002-06-17 13:43:15 +00:00
jmallett
fd7a71c1e7 Avoid classy use of a variable one time with a constant value. 2002-06-13 08:57:53 +00:00
jmallett
e7ef19fadd Use %p to print a pointer, not %lx and a cast to (unsigned long). Yuck. 2002-06-13 08:55:29 +00:00
jmallett
46e62e334d Don't do stupid things to avoid unused parameters, mark them __unused. 2002-06-13 08:54:16 +00:00
jmallett
dfc89a90de 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
9da06e346c The error functions take constant pointers to strings for their format. 2002-06-12 04:11:01 +00:00
jmallett
a04f022fe9 Remove a stray asterisk in a comment. 2002-06-01 00:52:28 +00:00
ru
008aabaf71 mdoc(7) police: removed unnecessary .Ns's. 2002-05-30 05:47:50 +00:00
ru
3917c3813f 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
9799147bdc 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
0bfdc3b4bd str_concat() doesn't really take const arguments.
Submitted by:	bde
Pointy hat to:	jmallett
2002-05-22 15:34:00 +00:00
ru
4b48b09abd Do not run shell from /bin, run it from $PATH.
Bump MAKE_VERSION to 5200205221.
2002-05-22 14:53:18 +00:00
ru
f463ccd331 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
17b7091c2e 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
d70b016cba 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
ec2a348c1f More consistancy. file system > filesystem 2002-05-16 02:19:14 +00:00
jmallett
8b9f6a2462 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
a426ff29b9 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
obrien
1511f40207 Move the sysV variable substitution up with the BSD feature that replaced it. 2002-04-19 04:08:35 +00:00
ru
9bebfb31a8 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
958be61f96 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
ff1e8b57e9 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
dd3a450bf3 Fix a minor lint warning. 2002-04-13 12:20:51 +00:00
obrien
acd36d8aff Prefer BSDmakefile over makefile and Makefile.
Submitted by:	jmallett
Obtained from:	OpenBSD
2002-04-13 12:18:00 +00:00
obrien
d032baf75b Fix copyrights, and undo SCS ID damage. 2002-04-13 10:57:56 +00:00
obrien
cf4dc38196 Update SCM ID method. 2002-04-13 10:17:18 +00:00
obrien
8e40ecb049 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
5d90ef30b0 De'register. 2002-04-13 10:05:30 +00:00
obrien
6f94f9a6bb Constify str_concat()
Submitted by:	jmallett
2002-04-13 09:49:33 +00:00
obrien
2b1f36ead5 Check to make sure fdopen() succeeds in make(1).
Submitted by:	jmallett
Inspired by:	NetBSD
2002-04-13 09:10:07 +00:00
charnier
e6723293c4 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
3f7056cd77 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
c65b2a9049 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
133187e134 remove __P 2002-03-22 01:33:25 +00:00
cjc
566ac0ea2c 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
schweikh
aa53fdad33 Make substitutions in internal macros like $(@F:.o=.c) work.
This should not affect our build process, as

	find /usr/src -name Makefile | xargs grep '@[DF]'

has no matches (other than FreeBSD.org email addresses :-)

PR:		bin/24377
Submitted by:	Mark Valentine <mark@thuvia.demon.co.uk>
Reviewed by:	Matthew Emmerton <matt@gsicomp.on.ca>
MFC after:	4 weeks
2002-01-12 10:45:27 +00:00
ru
9174553bc8 mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.
2001-08-10 13:45:36 +00:00
sheldonh
beb35793ec Use STD{ERR,IN,OUT}_FILENO instead of their numeric values. The
definitions are more readable, and it's possible that they're
more portable to pathalogical platforms.

Submitted by:   David Hill <david@phobia.ms>
2001-07-26 11:02:39 +00:00
ru
501d034a54 Clarify that MAKEOBJDIR and MAKEOBJDIRPREFIX are environment variables.
Submitted by:	bde
2001-07-16 15:33:34 +00:00
dd
7d1013753f Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00