Commit Graph

49 Commits

Author SHA1 Message Date
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
perry 08429de660 remove unneeded special rule for main.o 2009-03-24 13:54:37 +00:00
perry a24e0ba1bb The Makefile and main.c arranged to put "netbsd-${DATE}" into the
executable. Remove this so that different compiles can be binary
compared. rcsid's for all files are already embedded in the executable
so versions can be easily distinguished. (I didn't catch this on
previous passes because I did my builds on the same day.)

Note: there's a special rule for main.o in Makefile with a purpose I
can't actually discern -- I think it isn't needed, and I've flagged it
with a comment.
2009-03-20 20:48:00 +00:00
dsl 4fb693c12c Move the bmake_malloc() functions into their own .c and .h files.
Include instead of make.h in a few places.
2009-01-24 11:59:39 +00:00
dsl 899813caea Add functions for processing extendable arrays of pointers to strings.
Use for the .for variables and substution items - changing the latter from
make's all conquering lst.lib functions.
Being able to index everything makes the code simpler.
No functional changes intended.
2008-12-20 22:41:53 +00:00
joerg bd681a4d7e Don't use emalloc and friends directly, but call them consistently
bmake_malloc and friends. Implement them via macros for the native case
and provide fallback implementations otherwise. Avoid polluting the
namespace by not defining enomem globally. Don't bother to provide
strdup and strndup, they were only used for the estrdup and estrndup
comapt code.

This addresses the presence of emalloc in system libraries on A/UX and
resulted strange issues as reported by Timothy E. Larson.
2008-10-06 22:09:21 +00:00
christos 2b28370627 - use pid_t/size_t as appropriate instead of int.
- use %ld to print pids.
- fix a bit of lint.
- WARNS=4
2008-02-14 22:11:20 +00:00
uwe 7a8181d0dc Revert 1.34 (CFLAGS+=-g) that have been commited by mistake (hi, xtos). 2007-09-25 21:28:26 +00:00
sjg e1e6c59ee6 Use of libutil to provide emalloc et al, should be predicated on
a native NetBSD build using TOOLDIR etc.
Otherwise use the local versions.

Reviewed by: christos
2006-11-01 23:48:20 +00:00
dsl 7ef877a8c0 Fix previous - need to add a lstPrev() 2006-10-25 20:05:59 +00:00
peter e263dfd62f WFORMAT is no more... 2006-10-08 17:52:28 +00:00
christos 55ee861f25 protect libutil with HOSTPROG 2006-08-29 16:54:03 +00:00
christos cdab3a7a06 More programs using efun. 2006-08-26 18:17:41 +00:00
skrll f1713aebe3 Remove a hack that's no longer needed with gcc 3.3.6. 2006-06-15 10:55:02 +00:00
he b28792d8d4 Our gcc 3.3.3 (nb3) for hppa gets an "unrecognized insn" internal
compiler error when building buf.c with -O2, so reduce optimization
level to -O1 for this single file.
To be documented in docs/HACKS, discussed with skrll.
2006-05-08 11:07:57 +00:00
christos 3d5b8ce5a8 Coverity CID 529: Call VarFreeEnv to prevent leak. 2006-04-22 19:40:40 +00:00
ross 42dbdbd46a Simplify build, no functional changes.
Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when
you want things simple, instead add MAKE_NATIVE to get those hugely
important features like __RCSID().

It's now possible to build make on some hosts with: cc *.c */*.c
2004-05-07 00:04:38 +00:00
ross dcdf1bd27a Instead of including from the wrong directory and then fixing it (-I)
in the Makefile, how about just doing the right include?
2004-05-06 23:15:46 +00:00
sjg 79e5bb77fc Use ${.MAKE:S,^./,${.CURDIR}/,} so that when someone does
./make test
it works.  Note use .CURDIR rather than .OBJDIR since the later
_may_ not always be correct (eg. symlink in .CURDIR for make).
2004-02-15 19:05:45 +00:00
sjg 86b9a219d4 Fix for TEST_MAKE from Alan Barrett 2003-08-01 03:55:59 +00:00
sjg db7ca3c993 Fix parsing bug for :ts - patch from Alan Barrett <apb@cequrux.com>
Also add simple unit-test jig (regress/usr.bin/make will use it too)
but having it local here makes inclusion in bmake simpler.
2003-07-28 22:52:10 +00:00
mrg 8c66a01dc4 build var.c with -Wno-cast-qual - gcc3.3 complains about VarWordCompare() 2003-07-26 16:04:29 +00:00
christos 6a7d20bb25 Pass WARNS=3 2003-07-14 18:19:11 +00:00
reinoud a233fbd53e Fix major bug in make(1) ... due to shadowing of the dotLast path used for
the .DOTLAST primitive by a boolean variable with the same name, this whole
mechanism was broken ... it doesn't save much stat calls but it was wrong.

Thanks to Jason Thorpe for the other shadow-variable fixing patches he
made.
2002-01-27 01:50:54 +00:00
tv 053d51348d Overhaul the initialization and handling of .OBJDIR:
* Replace chdir_verify_path() with Main_SetObjdir(), which can be called
  externally, and can take a "const char *".  (There's a lot of non-const
  "char *" passing around in var.c of what should be const strings....)

* Rewrite the initial "find my .OBJDIR" code to make use of the new
  function.  This still functions as it had in the past, but the comment
  above this block was changed to reflect reality:  if MAKEOBJDIRPREFIX
  or MAKEOBJDIR are set in the environment, then *only that value* is
  tried; make does not fall back to obj.MACHINE, obj, and /usr/obj/`pwd`
  as it would without these env vars set.

* Add a new special target, .OBJDIR:, which when parsed will cause make to
  change to a new object directory and reset .OBJDIR, and PWD in the
  environment.  This will allow some makefiles (mainly, src/tools)
  to override the default objdir semantics in order to add custom logic.
2001-10-31 03:59:42 +00:00
sjg 80a2d65904 Provide a useful? MAKE_VERSION. 2001-06-09 05:17:51 +00:00
sommerfeld 8a39635d34 Back out debug cruft. 2000-12-30 02:06:42 +00:00
sommerfeld a804073cac Add a token-passing scheme to allow a recursive make to successfully
use -j; all make's in a recursive build cooperate to limit the total
number of jobs, using a token-passing scheme.

The current token passing algorithm is similar to the one implemented
by gmake; there is a single pipe which is inherited through the entire
process hierarchy; tokens are obtained by reading a byte from the
"read end" of the pipe, and are returned by writing them to the "write
end".  This exact algorithm is likely to change in the future.

Implementation details:
 - Use the new trace facility to allow measurement of the
effectiveness of different token-passing schemes
 - Get a token in MakeStartJobs(), return it in Make_Update()
 - Eliminate Job_Full() and the jobFull global since they are
redundant with token system.
 - Add an "internal" -J option (to pass the token pipe fd's down to
submakes) and a -T option for tracing.
 - Change how compatMake is forced so that -j means something when
inherited by submakes.
 - When waiting for a token, poll the token-passing pipe as well as
the output pipes of existing jobs.
2000-12-30 02:05:20 +00:00
is 135600f947 More format string cleanup by sommerfeld. 2000-10-11 14:46:00 +00:00
ross 7886a593e3 Back out part of previous, only the parse.c mod was intended. 1999-08-04 16:44:07 +00:00
ross 0728723c31 Trivial speed hack. 1999-08-04 02:54:56 +00:00
lukem 8ba07ab0b3 use CPPFLAGS instead of CFLAGS 1997-10-24 09:00:17 +00:00
lukem 00c29d5afe don't define WARNS=1 here 1997-10-19 04:23:02 +00:00
mycroft e96e918e60 Use bsd.subdir.mk as appropriate. 1997-10-11 09:34:07 +00:00
christos 254d64f064 Add WARNS=1
RCSID police
1997-07-01 21:17:00 +00:00
gwr 10e180cc49 Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
1997-05-08 21:11:01 +00:00
gwr 012e528f2e Use .PATH.c: ... 1997-05-06 20:44:56 +00:00
christos aa49881371 - Merge in FreeBSD and Lite2 changes.
- Fix bug where a non-archive target with a .a suffix would always
  be considered to be out of date, since it does not have a TOC.
1996-11-06 17:58:58 +00:00
christos 5c1983c016 - Move -D flags from Makefile to config.h and explain what they do. Add
-Wall -Wno-unused to CFLAGS. Add new define SYSVVARSUB to enable SysV
  style variable substitutions and enable them.
- Add SunOS style command substitutions via SUNSHCMD
- Fix core dump with '{variable = value'
1996-05-28 23:34:35 +00:00
christos 57cad0d107 Jonathan Stone's fixes:
main.c:	Remove double include of <sys/resource.h>; if MACHINE is defined, use
	that instead of uname.
Makefile: Add util.c.
1996-03-11 13:45:31 +00:00
christos 8862d696fa fix pr/1421 and pr/1997 1996-02-04 22:20:27 +00:00
christos b5f782e810 - $NetBSD$ rcsids
- Fixed so that .[A-Z]* targets that do not match keywords are ignored as
  Posix mandates
- Added .PHONY target keyword
1995-06-14 15:18:37 +00:00
jtc d08e2815ca None of the functions in util.c are needed by NetBSD, so don't
bother to compile it.
1995-05-03 05:09:14 +00:00
cgd 138fcd8327 deal with new share/doc strategy 1994-06-30 05:33:30 +00:00
cgd 5b029eb9a8 update for new doc-make/install strategy 1994-06-25 05:57:47 +00:00
cgd 3db59563ee fixes/improvements from Christos Zoulas <christos@deshaw.com>. 1994-03-05 00:34:29 +00:00
jtc ae2b6ea2c2 Compile with -DPOSIX --- enables reasonable behavior for MAKE and
MAKEFLAGS variables.
1993-12-14 18:27:15 +00:00
mycroft 690cae8181 Add RCS indentifiers. 1993-07-31 15:17:49 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00