Commit Graph

159 Commits

Author SHA1 Message Date
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
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
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
79f407f91e Fix a minor lint warning. 2002-04-13 12:20:51 +00:00
David E. O'Brien
664a5a88d4 Prefer BSDmakefile over makefile and Makefile.
Submitted by:	jmallett
Obtained from:	OpenBSD
2002-04-13 12:18:00 +00:00
David E. O'Brien
9b24805230 Fix copyrights, and undo SCS ID damage. 2002-04-13 10:57:56 +00:00
David E. O'Brien
4d1f4209a6 Update SCM ID method. 2002-04-13 10:17:18 +00:00
Philippe Charnier
cb497d661f 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
Warner Losh
c120448ada 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
Warner Losh
d3cb5ded92 remove __P 2002-03-22 01:33:25 +00:00
Ruslan Ermilov
73295d34c7 unifdef -UWANT_ENV_PWD.
No one ever going to use this bugfeature.
2001-04-25 14:44:42 +00:00
Ruslan Ermilov
43403d166a Make ${.OBJDIR} canonical.
Reviewed by:	bde
2001-04-25 14:22:38 +00:00
Warner Losh
20b367cea1 MAXPATHLEN includes the trailing NUL.
Correct array sizes to reflect this.
Correct NUL termination after strncpy.

# Didn't to strncpy -> strlcpy change.
2001-03-01 06:03:17 +00:00
Kris Kennaway
0937df81ca Introduce support for using OpenSSL ASM optimizations. This is done
through the use of a new build directive, MACHINE_CPU, which contains a
list of the CPU generations/features for which optimizations are desired.
This feature will be extended to cover the ports tree in the future.

Currently OpenSSL provides optimizations for i386, i586 and i686-class
CPUs. Currently it has not been tested on an i386 or i486.

Teach make(1) to provide sensible defaults for MACHINE_CPU if it is not
defined (namely, the lowest common denominator CPU we support for each
architecture).  Currently this is i386 for the i386 architecture and ev4
for the alpha.  sys.mk also sets the variable as a last resort for
consistency with MACHINE_ARCH and bootstrapping from very old versions of
make.

Benchmarks show a significant speed increase even in the i386 case, with
additional improvements for i586 and i686 systems.  For maximum performance
define MACHINE_CPU=i686 i586 i386 in /etc/make.conf.

Based on a patch submitted by:  Mike Silbersack <silby@silby.com>
Reviewed by:    current
2001-02-19 03:59:05 +00:00
Will Andrews
1a1a8c9324 There's also no point in #typedef'ing void/char pointers. Accordingly,
rip out ClientData/Address pointers and use standard types.

Obtained from:	OpenBSD
2000-12-02 20:24:42 +00:00
Will Andrews
98c28d6cc5 There's no reason to use fancy forms of NULL. Replace all instances
of NIL, NILLST, NILLGNODE, etc. with NULL.

Obtained from:		OpenBSD
2000-12-02 18:58:01 +00:00
Will Andrews
313c36f04b Format string paranoia. This should avoid potential buffer overflows from
user input (in its ever-broadening definition).

Obtained from:	NetBSD
2000-11-30 13:56:19 +00:00
Peter Wemm
34c46f2d3d *** empty log message *** 2000-09-25 18:44:30 +00:00
Brian Feldman
c7322223b9 Allow use of the ${MAKE_SHELL} variable to specify alternate shells for
make(1) to use.  Setting it to "sh" and "ksh" are the only values which
work right ATM; I wouldn't expect "csh" to get you far ;)
2000-08-16 23:31:43 +00:00
Warner Losh
9ad6473aef Do include <unistd.h> for getopt interface.
Don't extern it.
2000-07-28 06:50:25 +00:00
Andrey A. Chernov
39b31d1322 Fix assembler error messages - there is no \n allowed in __COPYRIGHT macro 2000-07-09 05:22:51 +00:00
Wilfredo Sanchez
023944f435 Use __RCSID() 2000-07-09 02:54:54 +00:00
Will Andrews
ea9b438956 Add loud debugging facility (-dl option) which allows programmers/developers
to override @-prefixed commands in Makefiles.  It is especially useful for
debugging ports and/or complex Makefiles in such a manner that is basically
a last resort, but is quite effective if the output is well-handled.

I'll update the manpage after dinner.  ;-)

Better patch submitted by:	steve
Reviewed by:			phk, steve, chuckr, obrien,
				Lyndon Nerenberg <lyndon@orthanc.ab.ca>
2000-05-14 22:24:28 +00:00
Marcel Moolenaar
494b6f4cba Improve backward compatibility.
make(1) uses sysctlbyname() to find out if it is running on a PC98
machine. This check has been added on 1998/9/9. The MIB variable was
added on 1998/8/31. At that time __FreeBSD_version was 300003. So,
only perform the check *if* __FreeBSD_version is defined and if it's
greater than 300003.

For the record: sysctlbyname was added on 1997/5/30 so this change
automaticly handles that...
1999-11-23 10:35:24 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Tim Vanderhoek
9bd2d6eee4 Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).
Obtained from:	OpenBSD, sometimes indirected from NetBSD; myself
1999-08-17 00:39:26 +00:00
Tim Vanderhoek
b97af31bdb Add a -E flag, similar to -e (overide variables from environment) except
that -E only operates for a specified variable.  Useful since the -e option
will often pull-in many unwanted variable overrides (esp. in a make world
situation).  Uses include overriding BINOWN (which cannot be done by normal
methods or through abuses of MAKEFLAGS) or likely for ports to honour CFLAGS
(provided they're running on a system whose make(1) has this option).
1999-07-31 20:53:02 +00:00
Tim Vanderhoek
97f8cf3b7f Print an error message on illegal numerical arguments.
Submitted by: bin/9349 (slightly modified) Assar Westerlund <assar@sics.se>
1999-07-31 20:40:23 +00:00
Warner Losh
ac3efb6afc Make MACHINE_ARCH sensitive to the environment, as well as using the
compiled in default in case it isn't defined.  This is needed to make
cross compilation work in some edge cases.  It also makes cross
compiling on FreeBSD other BSD's easier as well.

Obtained from: NetBSD, OpenBSD (predates the split)
1999-03-01 06:01:05 +00:00
Bruce Evans
50f292a2b5 Fixed missing 'v' in usage message. 1998-11-15 05:55:58 +00:00
David Greenman
7009ec844f Added a -v (verbose) option and hid multi-job file banner generation
behind it.
1998-11-14 16:15:04 +00:00
David E. O'Brien
9471b48afe Only process the ``PWD'' environmental var if built with "WANT_ENV_PWD"
defined.  Bash v2 sets PWD and it creates major problems for those of us
with /usr/src being a symlink.  See the lists for examples of the problems.
1998-10-18 00:51:46 +00:00
KATO Takenori
cab4769a94 Set the `pc98' string to the MACHINE if machdep.ispc98 != 0. 1998-09-09 14:58:30 +00:00
Warner Losh
dff85ecbee Use malloc + sprintf rather than asprintf to ensure portability to
other, less advanced architecutres.  This should minorly help porting
efforts of FreeBSD.  I've done several make worlds since this came up
with this change, as well as debugging several interesting nits with
-V (which is the only thing this change will affect really).
1998-07-26 17:06:05 +00:00
Peter Wemm
b9305a0668 Make -V expand it's arguments. This means that instead of 'make -V OBJS'
printing something useless (to a shell) like: ${SRCS:N*.h:R:S/$/.o/g}
it will instead print the actual ${OBJS} value.
1998-06-13 11:55:57 +00:00
Warner Losh
ce2d5f5fa6 Add #include <stdlib.h> to pick up prototypes for getenv and friends. 1997-09-29 03:53:53 +00:00
Jordan K. Hubbard
b1795946fd Don't preferentially execute Makefiles in ${OBJDIR} - it just causes
confusion and suffering.  Tested by "make world".
Submitted by:	gibbs
1997-08-27 06:31:27 +00:00
Steve Passe
1ecd3f4585 Make explicit '-B' option propigate to submakes.
No one has said this would be a bad thing, so given the dearth of comments
I decided to add it, as its an important step towards getting "make world"
'parallel-ized'.

Reviewed by:	silence
Submitted by:	nnd@itfs.nsk.su
1997-08-25 21:35:44 +00:00
Steve Passe
6e0d2d5172 Better fix, as originally submitted by reporter.
Submitted by:	 N.Dudorov <nnd@itfs.nsk.su>
1997-08-14 19:24:11 +00:00
Steve Passe
74a19f1229 Fix PR bin/4291: /usr/bin/make - inconsistent -j<n> flag parsing.
Submitted by:	N.Dudorov <nnd@itfs.nsk.su>
1997-08-14 04:46:20 +00:00
Philippe Charnier
950622c987 Use err(3). Cosmetic in usage string. 1997-07-24 06:58:08 +00:00
Warner Losh
1c8af87873 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
Peter Wemm
53faa0dade Revert $FreeBSD$ to $Id$ 1997-02-22 19:29:21 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Steve Price
97162b3f35 Remove extraneous comment, fix second-level tabs (one
tab and four spaces), and return error message in *err
instead of calling Parse_Error.

Suggested by: Bruce Evans <bde@zeta.org.au>
1996-10-12 02:15:30 +00:00
Steve Price
39dd3fffbf Reinstate '!=' fix by Bruce Evans. The original commit message from
parse.c(1.9) was:

revision 1.9
date: 1996/09/12 03:03:25;  author: bde;  state: Exp;  lines: +7 -6
Fixed handling of `!=' assignment.  Don't warn if the shell's output is
null, but warn if there was an error reading it.

Suggested by: Bruce Evans <bde@zeta.org.au>
1996-10-11 03:55:29 +00:00
Steve Price
5d55a64610 O' to be bitten by CVS. Cleanup after import
of Christos' version of make(1) and add Id's.

Set straight by: Bruce Evans and Peter Wemm :)
1996-10-08 04:07:59 +00:00
Steve Price
66b6f9d1e4 Clarify the rule used to determine the object
directory location.
1996-10-06 16:19:08 +00:00
Steve Price
c0d06fe463 Merge in NetBSD's changes to make(1). Changes include:
- Add the .PHONY, .PARALLEL, and .WAIT directives
	- Added the -B and -m commandline flags
	- misc. man page cleanups
	- numerous job-related enhancements
	- removed unused header file (bit.h)
	- add util.c for functions not found in other envs.
	- and a few coordinated whitespace changes

Special thanks to Christos Zoulas <christos@netbsd.org>
for help in the merge.  A 'diff -ur' between Net and
FreeBSD now only contains sccsid-related diffs. :)

Obtained from: NetBSD, christos@netbsd.org, and me
1996-10-06 02:35:38 +00:00
Steven Wallace
18e24ede6b Restore previous compatibility of ${.CURDIR}/obj.uname -m and
$(.CURDIR}/obj search while retaining compatability of new
prefix with cwd for the current source tree builds.
.TARGETOBJDIR has been removed from make and CANONICALOBJDIR set in
bsd.obj.mk

The builtin object directory searching is defined specifically as:

If MAKEOBJDIRPREFIX is defined, the search order is
${MAKEOBJDIRPREFIX}${.CURDIR}
${.CURDIR}

Else if MAKEOBJDIR is defined, the search order is
${MAKEOBJDIR}
${.CURDIR}

Otherwise, default to the search order
${.CURDIR}/obj.`uname -m`
$(.CURDIR}/obj
/usr/obj${.CURDIR}
${.CURDIR}

Reviewed by:	bde
1996-09-18 06:06:39 +00:00
Bruce Evans
454f40052a Fixed a missing colon in `notyet' code. 1996-08-31 14:22:33 +00:00
Bruce Evans
375633ec49 Added a -V option to print make's idea of the value of a variable.
Submitted by:	mark@linus.demon.co.uk (Mark Valentine)

Fixed bugs and inconsistencies in synopsis and usage message.
1996-07-17 11:02:43 +00:00
Jordan K. Hubbard
c4d74c02f2 Put back the $PWD override behavior of revision 1.4. The concensus
*seems* to be that it was the right thing to do.
1996-07-01 22:55:57 +00:00
Jordan K. Hubbard
664a482fd0 Remove code which overrode the opinion of getcwd() with an often bogus
value for $PWD.
1996-06-27 21:59:25 +00:00
Jordan K. Hubbard
cd9a2f5c28 Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src.  This is the final version of the
patches, incorporating the feedback I've received from -current.
1996-06-24 04:26:21 +00:00
Rodney W. Grimes
7799f52a32 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
Jordan K. Hubbard
9f574f9a90 Bring in a number of changes from NetBSD's make, fixing quite a few
problems in the process:

1. Quoting should work properly now.  In particular, Chet's reported bash
   make problem has gone away.
2. A lot of memory that just wasn't being free'd after use is now freed.
   This should cause make to take up a LOT less memory when dealing with
   archive targets.
3. Give proper credit to Adam de Boor in a number of files.
Obtained from: NetBSD (and Adam de Boor)
1995-01-23 21:03:17 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00