Commit Graph

545 Commits

Author SHA1 Message Date
sjg 9db7e8cb6d Missed a s/tn->name/pref/ 2003-03-21 16:48:21 +00:00
sjg 0220f09cfc Add ParseDoSpecialSrc() to handle srcs that refer to ${.TARGET} etc.
These are expanded for each target (set in its own context) and
ParseDoSrc() is then called for the expanded src.

PR: 20828
Reviewed by: christos
2003-03-21 15:52:57 +00:00
thorpej c5007c219b Add a -X option, which prevents make(1) from putting variables
set on the command line into the environment individually.  This
can be useful on systems which have a tight limit on the size
of the argument space.
2003-03-14 05:19:43 +00:00
sjg cc9d340ac8 Add -B to MAKEFLAGS so that it propagates to sub-makes.
This allows one to use -j1 -B at some point in a tree to
overcome a -jN (which is the main reason one would use -B).
2003-02-26 08:59:12 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
perry 8a49ec08e4 "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
2003-02-04 23:07:28 +00:00
wiz 9115df8c49 success, not sucess. Noted by mjl. 2003-01-28 22:35:02 +00:00
uebayasi 3d7c8fcb51 Be more specific how to call arguments of modifiers.
Reviewed By: wiz
2003-01-09 01:22:30 +00:00
mjl 037d3d9eb9 Tyop fixes 2003-01-03 14:11:18 +00:00
sjg 32a3b241bf Treat an unquoted '#' as end of line when parsing conditionals.
This ensures that comments are ok at the end of line.

PR: 19596
Reviewed by: christos
2002-12-30 18:03:09 +00:00
gson 936f6a1c3c When JobExec() was called from JobRestartJobs() via JobRestart(), it
executed the make job with sigprocmask(SIG_BLOCK) in effect for a
number of signals including SIGCHLD.  This caused recursive submakes
of the make process in question not to receive SIGCHLDs when their
jobs exited.  This was a second, independent cause of bin/18895 in
addition to the race condition already fixed.  Fixed by unblocking all
signals before executing the job.
2002-12-09 01:23:53 +00:00
scw ffeb337cd7 Lst exp -> Lst explist, to avoid warnings about gcc-current's
builtin exp() function.
2002-12-05 15:56:52 +00:00
sjg ecdc5fc7ad Parse_DoVar: don't free cp until we are done with it!
Reviewed by: hannken
2002-12-01 05:53:30 +00:00
wiz 80dfe4a842 Bump date for .PATH description; begin sentence with upper case letter;
new sentence, new line.
2002-11-29 19:10:25 +00:00
sjg 78610dd53d Whenever we update .PATH, set the variable ${.PATH} to reflect the
search list that will be used.  Thus 'dot' and 'cur' will appear in
${.PATH} either at the start or end depending on .DOTLAST even though
they are not strictly in dirSearchPath.

When .CURDIR is assigned to - re-set the 'cur' Path.

Finally, when checking subdirs, look in 'dot' and 'cur' (first or last
depending on .DOTLAST) just as we do in other situations.
2002-11-26 06:12:59 +00:00
enami b3e831985f Call fcntl() on the right file descriptors. 2002-11-26 05:30:01 +00:00
gson 96f1cc8289 Fixed race condition that would cause make -j to pause for five
seconds if a SIGCHLD arrived while make was not blocked in poll(),
by making the SIGCHLD handler write to a pipe included in the poll.
Avoided the need to implement a duplicate fix for the USE_SELECT case
by emulating poll() in terms of select() when USE_SELECT is defined.
Fixes bin/18895.
2002-11-16 22:22:23 +00:00
perry 2bf91ba1e8 environment variables, not environmental variables 2002-11-02 04:13:41 +00:00
grant be8ae688ae New sentence, new line. 2002-09-30 11:08:56 +00:00
wiz 09ee17ab5a Fix an Xr, add a comma and join two short lines. In short, minor changes :) 2002-09-24 15:31:30 +00:00
christos d72855f015 add missing Lt. 2002-09-24 15:19:26 +00:00
lukem ad5f5e697c HP/UX fixes from Giles Lean:
- consistently support __hpux (which the HP compilers define) as well
  as __hpux__ (not sure which compilers set this, but retained anyway)
- fix a typo in the definition of signal().  arguably the codebase should
  just be converted to sigaction()...
2002-09-22 01:19:08 +00:00
thorpej 34269821f1 If MAKE_BOOTSTRAP and HAVE_CONFIG_H, pull in "config.h" so that
we get the correct _PATH_BSHELL definition.
2002-09-14 15:23:49 +00:00
wiz 3c7935455d End some sentences with a dot. bin/17987 by Julio Merino. 2002-08-19 11:14:23 +00:00
wiz 86ebbc3a0e Remove !__STDC__ stuff, de-__P(), ANSIfy, and de-register. 2002-06-15 18:24:55 +00:00
itojun f51456c273 err/errx/warn/warnx do not need \n at the end 2002-06-11 06:06:18 +00:00
wiz 6e749bff5c Comment out token after #endif. 2002-05-16 19:48:18 +00:00
wiz 19f4778435 Comment out token after #endif. (Hmmmmmmm.) 2002-05-16 19:47:47 +00:00
bjh21 b846107274 Rather than hardcoding "/bin/sh", use _PATH_BSHELL. To allow bootstrapping,
provide a default for this in pathnames.h, and only include <paths.h> ifndef
MAKE_BOOTSTRAP.
2002-04-27 15:14:30 +00:00
bjh21 628b5efe85 Allow the makefile to override _PATH_DEFSHELLDIR as well. 2002-04-24 20:38:47 +00:00
christos 3baa6002c6 PR/16361: J. Mallett: make(1)'s job.c does not properly initialise postCommands 2002-04-15 12:45:33 +00:00
pk 53dab8cf3b Darn.. remove test code from previous commit. 2002-03-21 11:42:21 +00:00
pk 971b06b979 When looking at predecessor/successor dependencies, we need to consult a
cohort's centurion as well.
2002-03-21 11:34:17 +00:00
christos a7ffc9ca78 don't print extra newlines on errors. 2002-03-21 01:24:43 +00:00
pk e9b668c861 Xref: parse.c, rev 1.46; make.c, rev 1.23
In these revisions `::' dependency handling was simplified by not linking
the cohort nodes into the dependency graph. This broke dependency checking
on all but the first instance of a `::' target since all of the cohort nodes
now just form a collection of disconnected dependency graphs.

Fix this by keeping a back-reference in each cohort to its leader (the
first instance of a :: node with the same name) and a count of the number
of cohorts that need to be made before dependent nodes are scheduled.

Classically, we'd need six centurions for cohort, but in this case one
suffices...
2002-03-20 18:10:30 +00:00
lukem dadfca12c4 clarify how :U works 2002-03-19 22:17:30 +00:00
pk 48f5b2bd9d Fix some of the syntax errors (in unused code) and layout glitches. 2002-03-18 13:32:36 +00:00
pk b9f8785382 Block signals during Lst_Open/Lst_Close list traverals and in JobExec
while setting up a child process. This prevents the major sources of
list inconsistencies that may result from doing list manipulations
from a signal handler.

XXX - all Lst_*() operations are at risk; look for ways to avoid touching
so much global state from the signal handlers.
2002-03-18 13:28:25 +00:00
pk f41ec821b9 Fix signal-handling bogons in JobPassSig():
- don't block the signal we're about to send to ourselves to
	  take the default action for
	- restore the signal handler for the current signal
	- remove duplicate sigprocmask() call

As a result, restoring the SIGTSTP handler in JobContinueSig() is no longer
necessary.
2002-03-18 12:28:07 +00:00
pk e962f03d24 JobInterrupt(): don't try to unlink JOIN or PHONY targets. 2002-03-18 08:23:33 +00:00
pk fe31442363 Remove bogons from JobMatchShell() 2002-03-18 07:54:33 +00:00
pk 9fee4daa5f Job_ParseShell(): fix keyword counting error. 2002-03-15 15:54:41 +00:00
pk 0debc78bef JobExec(): don't use Punt() in the child; it can't possibly DTRT, and will also
mess up the parents variables.

Instead, use execError() for all error paths in the child code.
2002-03-14 16:08:37 +00:00
pk e84cfe875b Job_AbortAll(): add missing Lst_Close(). 2002-03-14 08:07:55 +00:00
pk 542708dea8 JobInterrupt(): add missing and fix a misplaced Lst_Close(). 2002-03-13 17:46:03 +00:00
pk e98ee34b4c Add the job's name to the `*** Error/Suspended/Continuing' informational
output. Useful when doing, e.g. a `make -j42'
2002-03-13 17:43:31 +00:00
pk 605f6cf148 MakeAddAllSrc(): check for empty .ALLSRC variable before using its value. 2002-03-12 23:52:35 +00:00
christos e7dc83d9f1 PR/15888: Jarkko Teppo: Problems building on HP/UX
1. Compensate for h-pox assert brain damage where it gets confused by the
   string in: assert(!memcmp(foo, "in", 2)); I miss the h-pox broken compiler,
   I had not had to work around it for years.
2. Oh, finally h-pox has random() and utimes(). We don't need our own anymore.
2002-03-12 20:15:15 +00:00
pk 24ed3538ca Propagate a .JOIN node's .ALLSRC contents to the parent's .ALLSRC. 2002-03-08 23:22:38 +00:00
enami 9b95f1b1f3 We don't want token while we're aborting. Otherwise, make spins wasting cpu. 2002-03-04 00:34:35 +00:00
tv 011931b3b4 Add <errno.h> to list of includes, from <imago@13thmonkey.org>,
in PR toolchain/15386.
2002-03-02 03:56:02 +00:00
reinoud 502866c1fe Pull every file parsing context into one structure instead of using a few
file global variables... adding an extra context variable is thus allmost
trivial now.
2002-02-21 22:21:34 +00:00
pk 3efeed43b5 Make{_}HandleUse(): update comments and layout, re-arrange to avoid some
code duplication.
2002-02-18 12:13:59 +00:00
pk 0b349f0680 Make_HandleUse() no longer has a return value, 2002-02-18 00:35:39 +00:00
pk 13a2e60c3c The use of OP_MARK in the MakeHandleUse() list callback function prevents
the removal of .USE nodes from a node's children list in case a given .USE
nodes appears multiple times on that list, preventing the target from ever
making it on the `to be made' queue.

Since the suffix rule processing code deals itself with removing the
transformation nodes from the parents to which it applies them, arrange
for doing the same for .USE nodes in MakeHandleUse() instead of in
Make_HandleUse(), and still use the OP_MARK stuff to avoid duplication
of commands.

Also, since Make_HandleUse() is not a list callback function and its
return value is no longer used, make its return type void.
2002-02-18 00:33:40 +00:00
pk bf488acb77 Add the default main target to the ${.TARGETS} variable, too. 2002-02-17 23:53:46 +00:00
pk 24039928a5 Prevent a premature end of the iteration if the first element in the list
is removed from the callback function.
2002-02-17 23:49:01 +00:00
pk b2203a2983 Targ_PrintType(): include .PHONY and .MADE attributes. 2002-02-10 12:03:08 +00:00
pk fa714e8390 Fix for previous: JobRestart() return value check was reversed. 2002-02-10 12:01:59 +00:00
pk 6c012e68f5 JobRestartJobs() should cease scheduling stopped jobs if the maximum
number of running jobs limit has been reached, otherwise an infinite
loop is the result.

Give JobStart() a return value to report this condition.
2002-02-08 17:44:23 +00:00
pk c36b1263ac JobStart(): if there no commands to execute for a node, set its status
to MADE before calling Make_Update(). This is necessary to complete
all rules associated with sources on an .ORDER dependency.
2002-02-08 17:31:38 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
pk d5e7cd89bf When making a node which is the source of both a .MADE target and a
normal target (the latter dependency being the reason why it's made),
the .MADE parent should not be put on the `toBeMade' list again (in
Make_Update()) since it was already put on it in Make_ExpandUse().
Doing so would cause the rules for the .MADE target to be executed
(at least) twice, and also mess up the unmade children count of _its_
parent, resulting in spurious graph cylce detection.

To achieve this, make sure the unmade children count of the .MADE target
is set to zero before enqueueing it on the `toBeMade' list in
Make_ExpandUse(). Then, in Make_Update(), check if the parent has the
.MADE attribute before diddling with the queue.

For the same reason the status of a node must not be set to UPTODATE
unconditionally in compat mode, since that will prevent the node from
being built even if it is the source of a normal target. Instead,
check both its state and the type of the parent to decide whether to
continue on behalf of the current parent.
2002-02-07 16:48:22 +00:00
ross 8bd7cb6a69 Edit -mdoc usage.
* There is no -indent option to .Bd or .Bl, although you would
  never know that from its frequent use in this tree. There is a
  "-offset indent" combination that makes sense, and you can certainly
  say "-width indent".

* Also, you can't markup the -width option argument, tho you CAN
  use a callable macro. So "-width Ar filename" doesn't make sense,
  but either "-width Ar" or "-width filename" does, as might something
  like "-width xxfilename" for a little extra space.

* There are a lot of needlessly complex hanging tag macros in man4 used
  to create simple item lists. Those should be simplified one of these
  days before someone copies and edits yet another man4 page.
2002-02-07 03:15:06 +00:00
pk 086b942780 Add `tu' and `tl' variable expansion modifiers, which transform the
value to uppercase and lowercase, respectively. From Kevin Neal from FreeBSD.
2002-02-06 16:26:12 +00:00
pk 86c078cb11 JobPrintCommand: avoid stale pointers on a node's command list.
The debugging value of the code that did this is limited, so drop it
altogether.
2002-02-06 16:20:25 +00:00
christos 079762b2ef Remove OP_NOSUFF, fix OP_MADE in compat mode [from pk], and make the OP_MADE
comment reflect reality.
2002-02-04 17:24:56 +00:00
christos d73f720df6 Bring down the number of stat(2) system calls from 682 to 294. This change
adds a .NOSUFF directive that has been applied to targets that have been
already made, and are not supposed to have suffix rules applied to them.
2002-02-03 21:41:44 +00:00
pk f1ca4b0556 Resurrect revision 1.23: no need to stat .PHONY targets. 2002-02-03 20:08:30 +00:00
pk 58e7f3798e Don't bother to apply suffix rules to find sources for a target marked
as .MADE.
2002-02-03 19:58:15 +00:00
bgrayson 47da4b42c7 - Several paragraphs were indented one level further than needed.
- The endfor example needed some spacing readjustments.
2002-02-01 19:35:29 +00:00
pk ce3fe4630a Fix the bug addressed in revision 1.27 properly. Analysis of the problem
(see also PR#15179):

  When looking up names which directory components (i.e. having slashes,
  except when of the form `./name'), FindFile()/DirLookup() first looks
  the final filename component in the cache for each directory on the search
  path and then proceeds to match the prefixed directory components by
  comparing them to the trailing directory components of the the search
  path being probed.

  This is not correct. When looking for `bar/target' in a path `.../src/foo',
  you want it to come up with `.../src/foo/bar/target' (if it exists). There's
  no point in comparing the the `bar' prefix on the target to the `foo' suffix
  on the search path. Indeed, this will cause a false match if those prefix
  and suffix components are actually equal and search path itself also has a
  file called `target'. For example, looking for `foo/target' in `.../src/foo'
  will spuriously match `.../src/foo/target', not `.../src/foo/foo/target'.

  This last bug prompted the change in dir.c, rev 1.27, which happens
  to partially workaround it by avoiding the above matching code in the
  case of the `curdir' search path entry (at the cost of incurring an
  exorbitant amount of cache misses). The situation is unchanged however,
  when processing other entries on the search path (e.g. those other than
  `dot' and `cur').

Drop the prefix matching code in DirLookup() entirely and use DirFindDot()
and DirLookup() only for names without proper directory components (i.e.
`target' and `./target). Otherwise, non-absolute names are dealt with by
DirLookupSubdir(), while absolute names can be checked for an exact match
of the directory components prefix against the directories on the current
search path. This allows for the use of the file cache to check the
existence of the file and additionally, provides a shortcut out of
Dir_FindFile() if we have the prefix match but not a cache entry (this
is especially beneficial for searches in .CURDIR when it's not equal
to `dot').
2002-01-31 12:38:34 +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
christos b66dfef469 Don't bother to lookup for files in `.' that start with a `/'. Cuts in the
number of NAMI's from 1344 -> 830 in a full build of /usr/src/usr.bin/make.
2002-01-26 22:36:41 +00:00
christos 933b6f81c0 Process escaped characters properly. Now:
foo\:bar:
	touch $@

works. Of course I am lazy right now, and I am not removing the '\' escapes
so the output looks fine, but it is functionally correct.
2002-01-26 20:42:14 +00:00
tv 3dc61f3b98 Make util.c replacement functions use autoconf conditionals to probe
what is Really available in the host OS.
2002-01-25 17:51:31 +00:00
reinoud 45e2e07bcf Small update to make(1) to let it follow more its own guidelines ! ... This
patch makes sure that files included using ".include <bsd.own.mk>" are
really looked for in the system make file directory or in the specified -m
paths instead of allways looking in the other -I and .PATH specified paths
... This speeds up the make a few procents at times for all the system make
files are now found directly instead of searching several paths, saving a
lot of stat() calls.

The number of stat calls is still exorbirant hight though... 910 or so for
making `make' alone ....
2002-01-24 01:39:03 +00:00
pk 7b3fe83270 In Dir_FindFile() add a missing Lst_Close() and move another one to the
proper place.
2002-01-18 19:18:23 +00:00
thorpej de95e88a8c Before we #define __attribute__ away, #undef it. 2002-01-18 03:36:00 +00:00
thorpej 8580a533fa Make sure to eat __attribute__'s argument, too. 2002-01-18 03:34:19 +00:00
eeh 9d929c71e8 __attribute__() if we're doing MAKE_BOOTSTRAP is a no-no. 2002-01-17 19:15:02 +00:00
tv 4cdd7a39ce Bleh, make the conditional work *correctly* this time (...teaches me not to
try distilling down parenthesized booleans without caffeine).
2002-01-16 03:40:29 +00:00
tv f740a6705b Fix typo in previous. 2002-01-16 03:37:03 +00:00
tv 2724818d75 Don't look at archive timestamps if MAKE_BOOTSTRAP is set. (I'm not
entirely sure that this is useful *at all* these days, since it's been
turned off for ELF since ELF was brought in....)
2002-01-16 03:36:15 +00:00
lukem a269984793 - partially fix ${foo:?true:false} so that at least it now parses ok and
the true result works. for some reason the false result doesn't, even
  though make -dv shows it being set as the result. (blah!)
- add braces in comments to fix vi showmatch
2001-12-25 14:50:36 +00:00
lukem 792e1d4ca9 outdent description of variable expansion modifiers 2001-12-23 10:51:56 +00:00
tv 87ab66e132 Allow MAKE_MACHINE to be unset if MAKE_BOOTSTRAP. 2001-12-11 20:50:58 +00:00
tv 591ad135c6 Add __CYGWIN__ to list of exceptions from homegrown strftime().
(XXX - This should be an inclusive, not exclusive, list.  Later, this
should be autoconfiscated, but keep the internal implementation, since
src/tools/compat isn't necessarily available for use at make's build time.)
2001-12-11 20:37:24 +00:00
thorpej 9f434e6392 Clean up some MAKE_BOOTSTRAP issues wrt. MACHINE/MACHINE_ARCH. 2001-11-30 01:29:47 +00:00
tv a4c4ea7686 Fix a very old and annoying bug: Adding suffixes to sufflist wasn't setting
a refCount of 1 to indicate its presence on sufflist.  Hence suffixes were
being removed by Suff_EndTransform() and being freed before all the
referential links were removed.  This resulted in a malloc warning on 1.5.x:
  make in free(): warning: chunk is already free.

This could be reproduced with the following simple Makefile passed to
"make -r":
=====
.SUFFIXES: .l .c
.l.c:
foo:
2001-11-14 19:27:40 +00:00
tv e4b456f8b8 Redo the hashtable for "." if .OBJDIR changes. 2001-11-12 21:58:17 +00:00
wiz ae62ceb59b Whitespace/punctuation nits. 2001-11-12 03:23:58 +00:00
tv f3c05f752e Add new make variable .ALLTARGETS, which lists all targets in the Makefile.
(Makes it possible to search the target list for particular things and
apply attributes to all the relevant targets.)
2001-11-12 01:33:48 +00:00
tv eae8a8fd1a Sort list of make variables. 2001-11-12 01:31:21 +00:00
tv e8c8d143cc Back out my rev. 1.75 on recommendation of christos.
Instead of skipping the PWD check entirely, add a skip of the PWD override
if MAKEOBJDIR is set and contains a variable transform ($).  This has
similar problems to what happens if MAKEOBJDIRPREFIX is set.
2001-11-11 21:40:05 +00:00
tv 2814f4901b Fix long-standing bug where, if an objdir exists, searching the .PATH for a
file will strip any leading path on the filename when searching ${.CURDIR}.

This bug manifested itself more prominently with xsrc/xfree/xc/lib/GL/GL,
since we now always search ${.CURDIR} as an alternative to ${.OBJDIR}
(PR bin/14499).
2001-11-11 21:36:06 +00:00
tv 1c31149727 Apparently something was missed in the Main_SetObjdir commit. Fix a TRUE
value that should start out FALSE.
2001-11-02 15:37:41 +00:00
tv 17159cd70f Strike getenv("PWD") entirely, based on prior discussion with sjg. This
breaks too many situations, including MAKEOBJDIR with a :C,foo,bar,
transform in many cases.  It's ambiguous and unreliable, as the comment
above that code always indicated.  In order to have reliable objdirs, they
need to work the same way Every Time.

(Note that taking this out is not a performance hit; we were already doing
the getcwd() call first.  So the getenv("PWD") didn't increase performance.)
2001-11-02 03:52:21 +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
tv 41783071da Allow "-m" to be used in a .MAKEFLAGS: special target and get it to work.
(This splits out the "default system include paths" into its own Lst
variable, and uses it only if sysIncPath is empty.  This allows sysIncPath
to be filled in by the Makefile itself.)
2001-10-31 01:15:57 +00:00
jmc 7ed7336587 Fix typo in definition of PARSEFILE. It should refer to PARSEDIR (and not
itself twice) when describing the variables lifetime
2001-10-23 06:32:38 +00:00
sjg 93de21cdc1 Don't ignore errors during .END processing.
PR: 14267
Reviewed: christos
2001-10-16 18:50:12 +00:00
sjg 9c66252a02 When attempting to chdir to .CURDIR because Check_Cwd_Cmd says we need to
make sure that the dir actually exists.  In compat mode the corresponding
chdir simply fails and all is well - the issue only arises when playing
tricky games with the value of .CURDIR.

Reviewed: christos
2001-10-16 18:06:29 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
wiz 1e378c4c12 precede, not preceed. 2001-08-20 12:00:46 +00:00
ad 811a1f306a Nit. 2001-08-13 12:33:48 +00:00
matt 2850b6d11e Print out errno when vfork fails. 2001-07-24 05:06:40 +00:00
christos 147dd16dac add .USEBEFORE Attribute 2001-07-03 18:08:50 +00:00
sjg e28cc22621 Add 4th arg (flags) to Var_Set so that VarLoopExpand can tell it not
to export interator variables when using context VAR_CMD.

Reviewed: christos
2001-06-12 23:36:17 +00:00
christos 815427002e Revert Job_CatchOutput() change; it adds a considerable delay to make, and
it is not clear what problem it is trying to fix.
2001-06-11 04:20:32 +00:00
wiz 40ac848024 Fix various misspellings of compatible/compatibility. 2001-06-11 01:50:48 +00:00
sjg fc0df160d8 Simplify the exporting of VAR_CMD's via MAKEFLAGS.
We now just list the names of such variables in .MAKEOVERRIDES.
When we come to export MAKEFLAGS we quote the value of each exported variable
using :Q, using: ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@}
The :O:u suppresses duplicate names.
Also modifed Parse_DoVar to re-export MAKEFLAGS whenever .MAKEOVERRIDES
is assigned to so .MAKEOVERRIDES+= PATH will export PATH=${PATH:Q}
to the environment, while .MAKEOVERRIDES= will disable export of VAR_CMD's.
2001-06-10 02:31:00 +00:00
sjg e843d81502 Mention .MAKEOVERRIDES 2001-06-09 07:00:37 +00:00
sjg d7c22ce2d7 Do a better job of duplicate suppression in .MAKEOVERRIDES.
From Var_Set: We actually want the equivalent of
.MAKEOVERRIDES:= ${.MAKEOVERRIDES:Nname=*} name='val'
clearing the previous value for name is important, since
doing simple duplicate suppression does not handle:
$ make FOO=goo
which then runs a sub-make with FOO=boo
the commands from that sub-make should see just FOO=boo.
2001-06-09 05:57:31 +00:00
sjg 44372a7be4 Modify handling of command line variable assignments and their exporting
via MAKEFLAGS.  Instead of appending them directly to .MAKEFLAGS, put
them in .MAKEOVERRIDES (and ensure they are quoted).  This is now done
in Var_Set when it exports VAR_CMD's.
Use ExportMAKEFLAGS() to export MAKEFLAGS, using the combined content
of .MAKEFLAGS and .MAKEOVERRIDES (with duplicate supression).
If .MAKEFLAGS is assigned to in a Makefile, ExportMAKEFLAGS is called again.
This allows a line like:
.MAKEOVERRIDES=
to effectively stop the exporting of the command line vars in MAKEFLAGS.
2001-06-09 05:22:47 +00:00
sjg 80a2d65904 Provide a useful? MAKE_VERSION. 2001-06-09 05:17:51 +00:00
explorer 4b9b13c33f Perform variable expansion on sysv rhs patterns. That is, expand ${O} in: ${SRCS:.c=.${O}} 2001-06-05 06:00:39 +00:00
sommerfeld c60038a831 Avoid being overly specific since the unresolved merge conflict tags
we detect could have come from something other than cvs.
2001-06-02 18:04:44 +00:00
christos 45bc184ebb mention `cvs' in the the previous hack so that the clueless get a clue. 2001-06-02 16:17:08 +00:00
sommerfeld f705156c1e Gratuitous make(1) hack of the morning: if operator-less lines start
with merge delimeters (<<<<<<, ======, >>>>>>), report "Makefile
contains unresolved merge conflict" rather than "Need an operator".
2001-06-02 14:25:23 +00:00
sjg 9cfd89292b A number of semi-related changes.
1. make -dx turns on DEBUG_SHELL which causes sh -x to be used where
   possible.
2. PrintOnError() is now called when make is stopping due to an error.
   This routine reports the curdir and the value of any variables listed
   in MAKE_PRINT_VAR_ON_ERROR.
3. Variables set via command line, are propagated to child-makes via
   MAKEFLAGS.  This behaviour appears to be necessary for POSIX (according
   to the GNU folk anyway).
4. Do not reset MAKEFILE when reading ".depend" as this rather eliminates the
   usefulness of ${MAKEFILE}.
5. Added ${.newline} as a simple means of being able to include \n in the
   result of a :@ loop expansion.
6. Set ${MAKE_VERSION} if defined.  Need to come up with a useful value.

Reviewed: christos
2001-06-01 20:33:37 +00:00
christos d0c243e9e5 better error messages on exec* failures. From Simon Burge. 2001-05-29 17:37:51 +00:00
sjg 843e9049af Modifier :P avoid segfault if gn is found but path is NULL. 2001-05-12 06:48:49 +00:00
aymeric b57e4f3ad4 Fix core dump triggered by a .DEFAULT target with no commands.
Bug reported privately by Nicolas Ollinger <nollinge@ens-lyon.fr>.

You can trigger this bug prior to updating your sources with for example:
% cat > Makefile <<EOF
.DEFAULT:
a
EOF
% make
2001-05-08 15:15:53 +00:00
sommerfeld 46608f023e bin/12734: fix SIGTSTP/SIGCONT handling.
- install SIGCONT handler which reestablishes SIGTSTP handler and then calls
JobRestartJobs() to restart all the suspended jobs.
 - when SIGTSTP is handled, call JobCatchChildren() so *** Suspended messages
get printed before make stops rather than after.
2001-05-01 03:27:50 +00:00
wiz 14dbdf5518 Negative exit code cleanup: Replace exit(-x) with exit(x).
As seen on tech-userlevel.
2001-04-06 11:13:45 +00:00
wiz 11d6505ee1 getcwd lives in 3, not 2. Whitespace fixes. 2001-04-04 09:39:07 +00:00
itojun 6924e04336 redo of previous: do not destroy v->val if str points to v->val.
XXX GC of v->val
2001-03-10 00:41:48 +00:00
itojun 4679105873 correct case with VAR_KEEP. if clause checked VAR_KEEP backwards,
and made str a dangling pointer.
2001-03-09 12:49:05 +00:00
sjg cefcce2537 Test for non-existant LIB was incorrect (using cmtime cf. mtime). 2001-03-05 16:20:33 +00:00
christos 3e343f9152 PR/12251: Thomas Klausner: Make core dumps on unclosed conditional.
Well, it should say 'make core-dumps on any error on the primary makefile'.
This was a result of the new changes to print the path to the parsed
Makefile... Made the code a lot more conservative, plus prepended <progname>:
to each message.
2001-02-23 21:11:38 +00:00
cgd 2f928e31d3 <sys/time.h>, rather than <time.h>. The former is actually the documented
way to get gettimeofday(), etc.  On some systems on which you might want
to host make (e.g. solaris), <time.h> won't get you a struct timeval
definition.
2001-01-23 02:48:05 +00:00
thorpej f9db1fd410 Add trace.o 2001-01-18 05:53:05 +00:00
cgd d594ce939b comment or delete text after CPP directives. 2001-01-16 02:50:27 +00:00
cgd 3e8fb298b1 Avoid accidental use of trigraphs. Pointed out by development version of gcc. 2001-01-16 02:37:03 +00:00
christos a5854c63b6 .PHONY gnode's don't get a PREFIX, so don't try to set the parent's prefixes
on a parallel make.
2001-01-15 22:17:09 +00:00
mycroft 139c9e6bf2 Once again, do the warning in a format that doesn't completely blow, and that
corresponds with text in the man page.  Also split it into 2 pieces that can
both be used with, e.g., C-x` in Emacs.
2001-01-14 20:54:16 +00:00
christos a73d3d97ca Provide a new .if commands(<target>) primitive that returns true if the
target has commands associated with it.
2001-01-14 20:44:26 +00:00
christos 3fbe1ebe81 convert error messages into english 2001-01-14 06:02:25 +00:00
christos 07c4e36361 We cannot override commands yet, ignore the additional sets for now.
This will be reverted when the tree is fixed.
2001-01-14 05:41:08 +00:00
christos 50a2a73342 - make the second list of commands override the first like gmake does
- remember where the first command definition occured so that we can debug
  things.
2001-01-14 05:34:06 +00:00
christos a2da9e7752 make the -W arg work; it was not put in the getopt string. 2001-01-14 05:33:53 +00:00
cgd 741c8f626f back out the change in rev 1.57. it was misguided; see discussion
on current-users (subject "build problem - multibyte.c").
2001-01-13 20:36:58 +00:00
jdolecek f68d9de78d only print the 'duplicate script for target' warning if
parseWarnFatal is on
2001-01-12 09:27:44 +00:00
christos bda102d681 PR/11800: Chris Demetriou: Add -W flag to exit on parse warnings.
While I am here, s/make:.*"/%s:\1", progname/
2001-01-10 15:54:00 +00:00
sjg fc4c89c68b ReadMakefile: Don't simply fopen() fname before checking if we are in separate
objdir.  This is the way freebsd does it, and apart from being more correct,
saves a lot of pointless fopen() calls.
2001-01-07 06:16:02 +00:00
sjg 85be2f6526 Always try an give the absolute pathname of the Makefile that we got an error in.
Use .PARSEDIR if set and not '.', otherwise .CURDIR to qualify the Makefile's path.
2001-01-07 06:08:33 +00:00
sommerfeld ded2509e8b Missing bit of last change 2001-01-01 15:50:23 +00:00
sommerfeld 3274266e5f Delete forceSerial; just use compatMake for that.
Add -N flag to *really* not execute any commands (useful when using
the -d flags to debug usr/src/Makefile)
Document -N
Update documentation of -n to mention that it still executes commands
for targets marked .MAKE so that the -N/-n distinction is clear.
2001-01-01 15:47:37 +00:00