Commit Graph

631 Commits

Author SHA1 Message Date
sjg 3c6b696332 Allow "string" and "${varspec}" on lhs of conditionals.
This makes it possible to use expressions like
${("${LIST:Msomething"}):?present:absent}
it also makes treatment of lhs and rhs more consistent, and
makes CondToken easier to read.

Update unit-test/cond1 to test new features.
2004-04-13 16:06:23 +00:00
sjg df910819de Revised patch for catching extraneous .else's
We actually need to tack condTop and skipIfLevel.
Bump MAXIF while here.
Enhance the unit-test for conditionals to exercise more code.

PR: 24420
2004-04-08 07:24:26 +00:00
sjg ab4f0bc644 Back out previous patch for now.
Breaks bsd.obj.mk
2004-04-08 01:35:33 +00:00
sjg 8bef426d13 Add check for extraneous .else's - based on patch from Arne H. Juul
in PR/24420.
Add a unit-test for conditionals.
Also in the unit-test makefile strip any .CURDIR in output.

PR: 24420
2004-04-08 00:59:01 +00:00
enami 84b05f6e6e Validate existence of arguemnt. PR#24933. 2004-03-27 00:17:08 +00:00
fair 11b2aeb6e2 Fix comment per PR 24437; make(1) tries "makefile" first, and then
"Makefile", not the other way around as previously documented.
2004-03-24 00:59:40 +00:00
enami 222e389ef2 Print useful line number on error while executing .for directive. 2004-03-06 03:57:07 +00:00
sjg a3cc11808b Fix :M so that modifiers in nested variables don't terminate parsing
early.  Add a unit-test to verify it works and keeps working.
Re-jig the unit-tests so that all are sub makefiles.
2004-02-20 09:03:26 +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
wiz e3fc4b66c3 Spell the plural of suffix "suffixes", not "suffices".
Inspired by PR 24400 by Todd Vierling.
2004-02-13 17:56:17 +00:00
wiz 56bb942672 Bump date; uppercase POSIX. 2004-02-05 23:51:46 +00:00
ross 3856fab870 Briefly document the posix command line order and add that this
is (unfortunately) not enforced.
2004-02-05 23:40:52 +00:00
ross 380bdcb7fb Parse args with open code to eliminate use of getopt(3).
No functional change under NetBSD.

Restarting a getopt(3) loop is an extension to the posix getopt(3)
behavior and is not portable.

Fixes tools build (tools/groff) under Cygwin.
2004-02-05 23:31:34 +00:00
wiz c732f0a853 Use more mdoc macros; new sentence, new line; bump date for previous. 2004-02-04 00:37:45 +00:00
chuck 51659857a7 add parent directory search for make as discussed on tech-toolchain.
- new dir.c function: Dir_FindHereOrAbove:
      Search for a path in the current directory and then all the directories
      above it in turn until the path is found or we reach the root ("/").
 - add hooks to use it in main.c for -m and syspath (compiled in
      _PATH_DEFSYSPATH and $MAKESYSPATH).
 - updated man page
2004-02-03 19:25:29 +00:00
lukem f83f942f81 Document more SPECIAL SOURCES (aka ATTRIBUTES).
Improve description of variable modifiers.
In the variable list, be more specific referring to "environment variables"
rather than just relying upon the formatting difference between .Ev and .Va.
2004-01-27 01:38:01 +00:00
dsl c3032ca9a0 Restore correct name string when VarGetPattern() returns.
Stops error from free() evaluating ${x::=y} when x is undefined.
(Erm why is free() allowed to write to fd 2?)
2004-01-24 19:58:54 +00:00
sjg 4d32648363 ternary is .PHONY 2004-01-19 00:32:26 +00:00
dsl 4169574d6f Reindent search loop in SuffFindCmds using 'continue' and 'break' instead
of netsted ifs.  No logic change.
2004-01-11 17:24:25 +00:00
dsl 742a98df46 Change DEBUG(DIR) traces to indent subsequent filenames instead of
generating very long lines (basically changes "..." into " ...\n   ").
2004-01-11 12:22:40 +00:00
sjg 71746b839b Add unit test for ternary modifier 2004-01-09 00:56:44 +00:00
sjg 1752434408 Fix :?: modifier so that it works again. 2004-01-08 23:55:05 +00:00
sjg 345311007d Handle more complex conditional expressions.
CondCvtArg now returns NULL if it consumed all input, or a pointer
to any left overs.
2004-01-06 01:18:52 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
wiz 8114895bf3 Bump date for previous; use macros for marking up
the dollar sign.
2003-12-26 23:22:31 +00:00
jmc 31e37b335f Note that variable expansion can occur within SYSV style = substitions. 2003-12-26 23:18:18 +00:00
jmc 3eb499682d Support variable expansions inside of SYSV style = substitutions. Better matches
expectations (and some cases of historical behavior I've found). Also fixes
PR#3865
2003-12-26 23:13:32 +00:00
jmc c7c6bf2bbd Don't assume startc is always {, set delim to endc when separating the args to
the ? test.
2003-12-26 08:03:06 +00:00
jmc 1664a90985 Fixes for PR#18573 (make -j not stopping correctly on error).
Using -e in sh/ksh to stop on error doesn't work with grouped commands. At
least for any SUSE compliant sh(1). Instead, extend the Shell struct and add
errOut which provides a template to use to check error status from commands.
2003-12-20 00:18:22 +00:00
jmc be1cdb8652 When looking for a makefile and curdir != objdir (i.e. working inside of an
objdir) try opening the file from curdir and if that fails try from objdir.
This way .depend files get picked up via their full path names rather than
just .depend so vars like PARSEDIR, PARSEFILE are then set correctly. This
fixes PR#13289 reporting incorrect pathnames for .depends with errors in
them
2003-12-18 22:36:18 +00:00
wiz 15dcc3baa6 Drop trailing spaces. 2003-12-07 20:48:25 +00:00
dsl 2bd419cb33 Add back 'on error' that got deleted by mistake. 2003-12-07 20:46:44 +00:00
dsl 7da2fe51b3 Add a -Dg3 which outputs the 'input graph' only on error exit.
Lets you see the wood for the trees...
2003-12-07 20:30:28 +00:00
dsl eceb7dddfb Don't create targets if dependant files marked .OPTIONAL are missing. 2003-11-14 22:32:44 +00:00
lukem a2f8083d5d Add some subsections in the VARIABLE ASSIGNMENTS section.
In the "modifier description" list, show each modifier with the leading `:'.
Rationale: it's hard to search for modifiers without it, and we already do
the same thing in the -options and .makecommands lists.  I now find it much
easier to find the description for a modifier in the man page.
2003-11-07 01:01:46 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
jmc 89996408fa Fixes from PR#23210 to eliminate use of asprintf which makes cross building
on non-NetBSD hosts work again
2003-10-23 15:58:29 +00:00
jdolecek e9a93e256b properly dottify .\" comments; this fixes output of [range] paragraph 2003-10-09 16:56:06 +00:00
sjg d388dcd1a3 Implement :[] modifier to allow picking a range of words out of a variable.
Also :tW and a W flag to :C and :S to allow treating value as a single word.
Add unit tests for the above, and fix some corner cases.
Based on patches supplied by Alan Barrett <apb@cequrux.com>
2003-09-27 21:29:37 +00:00
jmmv 6c008dec3b Add the 'e' debug flag (i.e., '-d e'): when enabled, show the "target
failed" and "command failed" messages added recently.  These introduce
too much noise when debugging some kind of problems, specially in pkgsrc.
2003-09-10 18:04:22 +00:00
jmmv 328ce86893 Document the '-d f' flag. 2003-09-10 08:44:31 +00:00
lukem f741d2d094 when displaying the 'Failed command:', collapse runs of whitespace in the
command to a single space.   suggested by David Laight in private mail.
2003-09-09 16:16:02 +00:00
drochner 1a9a16338e Remove some code which makes file lookup rely on the fact that
the first two directory entries are "." and "..".
This behaviour is not required by applicable standards, and
actually not provided by "coda".
Now we get the "." and ".." into the per-directiry hash tables,
but this should not hurt.
2003-09-09 14:44:35 +00:00
lukem 16cddad1c8 don't free cmdStart too early, as cmd points somewhere in there and we
may want cmd for error messages.
should fix [bin/22705] from itojun@
2003-09-08 23:54:54 +00:00
sjg 435f6fef84 Make empty() consider an undefined variable as empty,
rather than throw a syntax error.
2003-09-06 06:52:08 +00:00
wiz 91f2a1b827 Whitespace nits. 2003-09-05 06:55:46 +00:00
sjg 9ab525fdf0 Allow -V '${FOO}' to print the expanded version of FOO.
A side effect of adding and removing a -E option for the above is that
the cases in MainParseArgs are now ordered correctly?
2003-09-05 06:52:11 +00:00
lukem 5bb8036aeb Also display failed target. Given
printf "all:\n\ttrue\n\t@false\n" | make -f -
the error output now looks like:
	*** Failed target:  all
	*** Failed command: false
	*** Error code 1
instead of just
	*** Error code 1

XXX: add this support for  make -j  builds.
2003-09-02 23:40:11 +00:00
lukem ea878e8983 display the command that failed.
this is useful if the command-line had been suppressed.
2003-09-02 12:17:40 +00:00
sjg a41eaef46a Hook make unit-tests into regress 2003-08-08 06:42:38 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
sjg 3dfdacc170 Avoid \a as a test of invalid separator, since if we make ksh the default
shell, we get different results.  \x seems safe.
2003-08-01 04:57:20 +00:00
sjg 86b9a219d4 Fix for TEST_MAKE from Alan Barrett 2003-08-01 03:55:59 +00:00
sjg 3716ad7f49 Allow .SHELL: to control the shell used by compat mode too.
Add a shell spec for ksh - a nice portable posix shell.
Document .SHELL:
2003-08-01 00:39:52 +00:00
scw bc25d2ab5f Const poisoning. 2003-07-31 13:48:11 +00:00
sjg 1ebbf35953 Test behavior of commandline variable assignments. 2003-07-31 00:46:15 +00:00
sjg 82cba16bce A couple of other places where delim should be set 2003-07-29 09:06:29 +00:00
sjg b806b12f2d First bug picked up by the unit tests - delim wasn't always initialized.
Avoid putting '\' in test case script lines since shell's like that on
SunOS insist on interpreting them.
2003-07-29 08:44:41 +00:00
sjg e3cd1dc68c Use single quotes to protect everything from shell's that might
alter the results.
2003-07-29 08:16:01 +00:00
sjg 6b9a4c9477 Regardless of the name of TEST_MAKE, force it to make in test.exp
to avoid needless failures.
2003-07-29 06:35:09 +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
sjg 59b1f67a11 Fix merge problem with ts modifier and const correctness.
Need to pass nstr to VarModify.
2003-07-23 18:06:46 +00:00
wiz aeb7902476 Bump date for tu addition; drop trailing space; sort a bit. 2003-07-16 11:34:16 +00:00
itojun a5450bcac9 backout. make(1) either uses strcpy() to malloc'ed region (enough size),
or function signature prohibits us from using strlcpy().
2003-07-16 07:16:24 +00:00
itojun 06ded73d5a we can't use snprintf here, as sizeof(pathname) is unknown 2003-07-16 07:11:29 +00:00
itojun bd8e1178ee strlcpy (fixed) 2003-07-15 05:39:28 +00:00
itojun 885eddc2ed strlcpy 2003-07-15 05:38:24 +00:00
sjg 8186ad8ad9 Fix a couple of missing UNCONST's that hit bmake. 2003-07-14 21:13:48 +00:00
sjg f1cf540a8d Add a :ts[c] modifier to allow controlling the separator used between
words in a variable expansion.  If 'c' is omitted no separator is used.
2003-07-14 20:39:20 +00:00
christos 6a7d20bb25 Pass WARNS=3 2003-07-14 18:19:11 +00:00
wiz 95ad95491e Fix two minor whitespace problems. 2003-07-14 08:55:18 +00:00
wiz 664b3c96d5 Misc mdoc fixes (mostly quoting). 2003-06-26 18:21:45 +00:00
matt 78735dbbe5 For a library, only check in cmtime (children's modification) if there are
children.  This prevents spurious out-of-date failures when you have a
rules checking for a library's existance (and no children).
2003-06-02 21:49:00 +00:00
wiz 7fbb5054ee New sentence, new line; bump date for last. 2003-05-23 18:15:17 +00:00
christos 7ce8fa7806 PR/10917: John Hawkinson: Document $MAKE and say which one we want to be using. 2003-05-23 17:25:10 +00:00
christos 11dc6dfd26 PR/19781: Thomas Klausner: make error message not helpful on unclosed ${var:foo 2003-05-22 18:20:10 +00:00
jmmv afa06162bc Remove extra space in usage message. 2003-05-10 19:21:40 +00:00
sjg 414c86b6d1 math.h is not needed and including it introduces uncessary dependencies
on some systems.

PR: 21204
2003-04-17 15:57:52 +00:00
wiz 7b31891279 Bump date for last. 2003-04-16 09:44:07 +00:00
christos 9d921a9a8d PR/1523: Chris Demetriou: don't count a library as built, if there is no way
to build it.
2003-04-08 17:46:59 +00:00
jrf 9350d70e69 Added MAKESYSPATH environment variable as per jmmv's suggestion in
PR 18030
2003-04-01 14:00:58 +00:00
sjg 62d1f2d214 Comment in ParseDoSrc was no longer accurate.
Explain the difference between handling of src node
in ParseDoSpecialSrc cf. ParseDoSrc.
2003-03-23 22:48:35 +00:00
sjg 50ca80687f We are supposed to pass the node for our expanded src to ParseAddDep
for each entry in allsrc.  Just like ParseDoSrc.  The only difference
in handling these special expanded srcs in in the call to ParseLinkSrc.
2003-03-23 05:11:22 +00:00
sjg 77076c2d51 ParseDoSpecialSrc: since we're already being called for each target
make it depend only on the expansion of src that matches.
Otherwise given:

a b c:  ${.TARGET}.x

a b and c will each depend on a.x, b.x and c.x

Further, we only _need_ to do ParseDoSpecialSrc if a .WAIT appears
in the source list - so establish that up front.
2003-03-22 23:41:02 +00:00
christos bef3a7f735 don't mess with suffix rules. 2003-03-21 19:14:53 +00:00
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