Commit Graph

66 Commits

Author SHA1 Message Date
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
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
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
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