Commit Graph

243 Commits

Author SHA1 Message Date
apb
19f37cd621 Small markup fixes:
* Use \e instead of \\ to represent a backslash;
* Dont' start a line with .SUFFIXES.
2014-09-14 08:47:19 +00:00
dholland
985229f07f bump date; I think I'm done for tonight 2014-09-14 04:32:42 +00:00
dholland
cf64c76e74 Add some notes on compatibility with other make dialects.
I was originally intending to preserve some of Jarmo Jaakkola's notes
on POSIX make from the PR 49085 changes... but really there's no point
wandering into details about $? and such when the big picture is
"almost everything in this manual works only in BSD make".

Maybe the exact details can be stuffed into a chapter of the mythical
make reference manual if that ever gets (re)written.
2014-09-14 04:32:07 +00:00
dholland
d8e17b53b4 Improve the documentation of rule-local variables. Cherry-picked from
the PR 49085 changes, with some adjustments by me.
2014-09-14 03:50:28 +00:00
dholland
7837a7ce15 Improvements pertaining to shell commands and chdir. Some of this
appeared in the PR 49085 changes, even though it's not actually
relevant there except tangentially. However, I've reworked most of
that for clarity and added some more.
2014-09-14 03:13:49 +00:00
dholland
012b391598 Restore -r1.234 of make.1, which was an unrelated fix from sjg pertaining
to the docs for the -w option.
2014-09-09 06:41:56 +00:00
dholland
718f11413b Revert the man page as well. (hi joerg)
Revert it to 20140823 (-r1.230), before the controversial commits,
which changed it a good deal.
2014-09-09 06:39:59 +00:00
wiz
875700f431 Reduce pirate slang. 2014-09-05 06:57:20 +00:00
christos
1639e1cf8d document commented out .INVISIBLE and .JOIN. 2014-09-04 19:07:47 +00:00
sjg
a1caebb65d Enter/leave flag is -w not -dw 2014-08-28 19:55:00 +00:00
christos
defa6c58f6 PR/46096: Jarmo Jaakkola: fix many problems with dependencies (PR 49086)
Quite extensive rewrite of the Suff module.  Some ripple effects into
Parse and Targ modules too.

Dependency searches in general were made to honor explicit rules so
implicit and explicit sources are no longer applied on targets that
do not invoke a transformation rule.

Archive member dependency search was rewritten.  Explicit rules now
work properly and $(.TARGET) is set correctly.  POSIX semantics for
lib(member.o) and .s1.a rules are supported.

.SUFFIXES list maintenance was rewritten so that scanning of existing
rules works when suffixes are added and that clearing the suffix list
removes single suffix rules too.  Transformation rule nodes are now
mixed with regular nodes so they are available as regular targets too
if needed (especially after the known suffixes are cleared).

The .NULL target was documented in the manual page, especially to
warn against using it when a single suffix rule would work.
A deprecation warning was also added to the manual and make also
warns the user if it encounters .NULL.

Search for suffix rules no longer allows the explicit dependencies
to override the selected transformation rule.  A check is made in
the search that the transformation that would be tried does not
already exist in the chain.  This prevents getting stuck in an infinite
loop under specific circumstances.  Local variables are now set
before node's children are expanded so dynamic sources work in
multi-stage transformations.  Make_HandleUse() no longer expands
the added children for transformation nodes, preventing triple
expansion and allowing the Suff module to properly postpone their
expansion until proper values are set for the local variables.

Directory prefix is no longer removed from $(.PREFIX) if the target
is found via directory search.

The last rule defined is now used instead of the first one (POSIX
requirement) in case a rule is defined multiple times.  Everything
defined in the first instance is undone, but things added "globally"
are honored.  To implement this, each node tracks attribute bits
which have been set by special targets (global) instead of special
sources (local).  They also track dependencies that were added by
a rule with commands (local) instead of rule with no commands (global).

New attribute, OP_FROM_SYS_MK is introduced.  It is set on all targets
found in system makefiles so that they are not eligible to become
the main target.  We cannot just set OP_NOTMAIN because it is one of
the attributes inherited from transformation and .USE rules and would
make any eligible target that uses a built-in inference rule ineligible.

The $(.IMPSRC) local variable now works like in gmake: it is set to
the first prerequisite for explicit rules.  For implicit rules it
is still the implied source.

The manual page is improved regarding the fixed features.  Test cases
for the fixed problems are added.

Other improvements in the Suff module include:
  - better debug messages for transformation rule search (length of
    the chain is now visualized by indentation)
  - Suff structures are created, destroyed and moved around by a set
    of maintenance functions so their reference counts are easier
    to track (this also gets rid of a lot of code duplication)
  - some unreasonably long functions were split into smaller ones
  - many local variables had their names changed to describe their
    purpose instead of their type
2014-08-23 15:05:40 +00:00
wiz
ecd932c9a3 Bump date for previous. 2014-08-23 15:03:22 +00:00
christos
4da7383dde PR/49085: Jarmo Jaakkola: fix several parsing errors
Don't exit from var.c:Var_Parse() before possible modifiers are handled
on D and F modified versions of local variables.  Properly expand $(?D)
and $(?F) too.

Make line continuations in rule's commands POSIX compliant.

Fix the syntax error caused by lib(member) as the last target before
a dependency operator.

Document the line continuation change in the manual page.  Also talk
more about the POSIX style local variables and their modifiers.

Add tests covering the fixed problems into d_posix.mk.  The test is
a known failure at the moment because of PR 49086 and PR 49092.

[XXX: unconverted tests]
2014-08-23 14:50:24 +00:00
sjg
2adf342aef Put .INCLUDEDFROM* in the right section 2014-02-15 18:55:30 +00:00
apb
8d32845036 Emphasise the fact that the regexp and replacement in :C/// are
subjected to variable expansion before regexp parsing.  This was already
documented if you read carefully enough, but more emphasis would have
helped me to figure out why I needed three or four backslashes where I
expected to need only two.
2014-01-19 10:23:29 +00:00
wiz
6c4455e96a Bump date for previous. 2014-01-10 16:28:34 +00:00
christos
6ee57b9ada add .INCLUDEDFROM{FILE,DIR} 2014-01-10 16:12:52 +00:00
dholland
0256a35b09 apostrophe's do not make plural's. 2013-11-07 18:50:46 +00:00
wiz
6f46d26376 Remove trailing whitespace. 2013-10-27 11:38:13 +00:00
apb
e7b5d5dc5f Explain that ${VAR:M*} will normalise the inter-word spacing. 2013-10-25 22:05:00 +00:00
apb
e1debe8414 The :C/// modifier takes an extendedregular expression. 2013-10-25 20:57:02 +00:00
apb
480a3064b0 Use Va markup to show that the "suffix" part of ".PATH.suffix"
is a placeholder, not a literal string.
Also bump date.
2013-08-11 09:53:49 +00:00
dholland
f02a6c3b94 Document .PATH.suffix:. Noted by apb back in December of 2008
(that's how long my queue is...)
2013-08-11 04:40:58 +00:00
sjg
bd8f3e806f Allow an empty .MAKE.JOB.PREFIX to supress output of --- job --- tokens 2013-07-30 19:09:57 +00:00
christos
4f413ffa5d More gmake compatibility:
1. add -w flag to print Entering and Leaving directory name the the beginning
   and the end of processing.
2. export MAKELEVEL=$((MAKELEVEL + 1)) only in the child environment.
3. when printing error messages, prefix them with the program name [$MAKELEVEL]
   for $MAKELEVEL > 0
4. if $MAKEFLAGS consists only of letters assume it is a set of flags (as
   allowed by posix), convert them to -f -l -a -g -s, so that they get parsed
   properly.
With those fixes gmake -> bmake -> gmake -> bmake etc. works as expected.
2013-07-16 14:00:53 +00:00
agc
6a34c4426f fix a typo 2013-06-26 20:20:36 +00:00
wiz
46ad464f12 Remove trailing whitespace. 2013-06-25 07:08:10 +00:00
sjg
adfd644b2f Add .MAKE.META.IGNORE_PATHS to facilitate local additions to the paths
which should be ignored by meta_oodate().
2013-06-25 00:20:54 +00:00
christos
e2bd819f6a improve wording 2013-05-22 19:35:11 +00:00
christos
689b483c53 put a note on what FRC means. 2013-05-22 19:30:35 +00:00
sjg
e570fc4070 Refine the effect of .OODATE on command comparison.
Rather than apply it to the whole script, just the current command line
is affected.   This allows a trick like ${.OODATE:M.NOMETA_CMP}
to cause command comparison to be supressed for one command only.
2013-03-31 05:49:51 +00:00
sjg
03ce90ebea If built with filemon support, set .MAKE.PATH_FILEMON to _PATH_FILEMON
so that makefiles can test for it.
2013-03-23 05:31:29 +00:00
christos
ed82ee44b4 Add a .STALE special target that gets invoked when dependency files contain
stail entries.
2013-03-05 22:01:43 +00:00
sjg
bd0907ac07 In SHELL COMMANDS section, provide some clues about different
behavior in jobs vs non-jobs mode.
Move the comment about when shell is skipped to this discussion
from COMPATABILITY.
Remove the incorrect statement about default mode being somehow
neither jobs mode or compat mode (it is compat mode).
2013-01-27 18:52:01 +00:00
christos
4f166942a1 It is Sprite, not Sprint; pointed out by Todd Miller. 2012-10-08 15:09:48 +00:00
christos
6010f05a86 spelling 2012-09-17 02:10:46 +00:00
sjg
cf6e63e419 Document the fact that lack of shell meta chars in a command
results in direct exec in compat mode.
2012-09-17 01:23:45 +00:00
wiz
d5a95690ed Add an s. 2012-08-30 22:35:37 +00:00
sjg
aede2a76f4 Add a knob to control whether -V fully expands a plain variable by default.
The default retains the traditional NetBSD behavior, but the knob
can be set so that FreeBSD can retain their expected behavior.
This is a compromise to be sure.

Add a debug flag -dV to override the above, so that regardless of
the knob setting, the raw value of a variable can be easily seen.
2012-08-30 22:09:58 +00:00
sjg
845789be8d Restore previous behavior - supressing duplicate entries in
.MAKE.MAKEFILES - it is more efficient.
2012-04-24 20:12:16 +00:00
sjg
7a49f6a73f Fix some typos in/around ParseGmakeExport.
Remove the suppresssion of duplicate entries in .MAKE.MAKEFILES
2012-04-20 05:33:41 +00:00
wiz
1ac719d147 Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
2012-04-08 22:00:37 +00:00
christos
f8c8cd087a document gmake export command 2012-03-31 14:46:16 +00:00
sjg
367aa166aa Fix description of 'silent' in .MAKE.MODE
Also document 'env' in that context.
2012-02-03 21:39:25 +00:00
sjg
25e3dfbf18 Mention limits of :P 2011-12-23 05:01:59 +00:00
sjg
3a4494dc38 The :@ example gives the impression that we encourage the ODE
convention of naming loop variables like .LINK., when in fact
single char variables are far more common in NetBSD.
2011-12-17 04:43:45 +00:00
dholland
9851fd89b4 Fix xref to the PSD; PR 45568 from Petri Laakso. 2011-11-13 18:18:35 +00:00
christos
e8514ab687 explain how to use .PARSEDIR and .PARSEFILE 2011-11-06 19:50:46 +00:00
sjg
09fee58e88 In meta mode, we create .meta files for most targets.
These capture all the interesting data - useful for debugging.
In such cases there is no need to replicate commands in the build log.
Rather than run the entire build .SILENT, allow meta mode to set that flag
per target iff a .meta file is created.
Normal behavior is retained for targets where no .meta file is created,
ensuring that no build data is lost.
2011-08-28 03:54:07 +00:00
sjg
daf6508d3f Make some dashes em-dashes (based on patch from Andrew O. Shadoura).
Note behavior of .META flag wrt out-of-date.
2011-08-18 15:36:51 +00:00