Commit Graph

1192 Commits

Author SHA1 Message Date
sjg a75f41b571 Ensure -- filemon is at start of line 2014-11-06 01:36:57 +00:00
sjg 0b32bec31a Use read and fwrite rather than fgets and printf when reading filemon data. 2014-10-20 23:22:57 +00:00
sjg 18f74f9db1 Extract broken tests 2014-10-20 23:21:11 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos d2ae978666 Define some of the missing macros. The only error now is:
213: warning: can't find font `C'

Because the CW macro wants to use a constant width font is "ascii" mode,
and this does not exist with -Tascii. I don't think this should be fixed
here...
2014-09-30 21:33:14 +00:00
dholland 9e4a361214 Comments, and one very minor tidyup. 2014-09-18 08:06:13 +00:00
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 d2a37b0d8b Fix handling of the silly $(@D) $(@F) etc. vars so modifiers on them
work. This is issue #1 in PR 49085 from Jarmo Jaakkola, but I've used
a different and cleaner patch this time.
2014-09-14 02:32:51 +00:00
dholland 58de96de3f Recognize the crazy POSIXisms $(?D) and $(?F); issue 2 in PR 49085
from Jarmo Jaakkola.
2014-09-13 23:21:01 +00:00
dholland d32cd0af74 typo in comment, from the first reverted patch 2014-09-13 23:10:28 +00:00
apb 73b33010e7 Add a test for backslash-newline at the very end of a command script. 2014-09-09 10:22:27 +00:00
apb 14a634bc53 Change @echo to echo in several places in escape.mk,
to make it easier to spot changes in what make sends to the shell.
Adjust escape.out to match.
2014-09-09 10:11:20 +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
dholland 3728c0fad2 Restore apb's 20140820 commit (-r1.228 of main.c):
It should not be an error to have VAR != command that prints no output

Joerg reverted a bit too enthusiastically.
2014-09-09 06:18:17 +00:00
joerg d92bea4fa3 Revert all make changes except the unit tests to the state of three
weeks ago. Individual changes can be reapplied after review.
2014-09-07 20:55:34 +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 82b1920e05 Replace use of $() with ${}
$() means something special to the shell, so ${} reduces confusion
and is used almost exclusively in the rest of the makefiles.

Discussed with: christos
2014-08-30 22:21:07 +00:00
sjg 294be283d0 *.rawout are out-of-date if ${TEST_MAKE} is newer. 2014-08-29 20:03:27 +00:00
sjg 75abee676e posix1.mk and suffixes.mk need to cleanup in order to achieve
repeatable results.
posix1.mk's lib.a target still looks dubious.
2014-08-29 15:55:44 +00:00
christos aeacc22675 undo eating the trailing backslash now that the shell has been fixed. 2014-08-29 09:27:43 +00:00
sjg a1caebb65d Enter/leave flag is -w not -dw 2014-08-28 19:55:00 +00:00
christos 98e4fd4ef7 don't leave trailing backlashes on commands, just like gmake does. What does
POSIX have to say?
2014-08-28 14:39:13 +00:00
christos f50c40cd6c Make .INVISIBLE nodes be ignored by suffix transformations. 2014-08-27 08:50:38 +00:00
apb 089825332f Let "make clean" delete the files and dirs created by some of the tests. 2014-08-24 17:17:24 +00:00
apb 71a54383f7 In either a variable assignmentor a command, backslash-backslash-newline
does not escape the newline.  This is compatible with gmake.
2014-08-24 16:47:12 +00:00
apb b4e732f551 Our practice is that an even number of backslashes before a newline
in a variable assignment simply stores the backslashes as part of the
value, and treats the newline as though it was not escaped.  This
is compatible with GNU make.
2014-08-24 16:08:14 +00:00
apb 175bed92d9 Our practice, despite what POSIX might say, is that "\#"
in a variable assignment stores "#" as part of the value.
The "\" is not taken literally, and the "#" does not begin a comment.
2014-08-24 15:10:13 +00:00
apb c80311840b Convert the variable printing tests to use .USE rules,
to ensure that the value printed always comes from the expected variable.
2014-08-24 14:38:38 +00:00
apb ae2e300da1 Adjust tests to correct for the fact that end-of-line comments
in variable assignments should not be included in the value.

Also fix more typos.
2014-08-24 14:04:35 +00:00
apb c761b26f2c Fix more typos in variable names. 2014-08-24 13:11:49 +00:00
apb e989f440f6 Fix typos in variable names, and in a comment. 2014-08-24 13:07:25 +00:00
apb b3edfc2816 Add tests for backslash escaping in make(1).
Many of these tests fail, and I have populated the escape.exp file with
the results that I expect, not with the results that make(1) actually
produces.

Also update the set lists for these tests.
2014-08-24 11:52:45 +00:00
christos 69f7fee3bd fix output based on new sources 2014-08-23 16:08:42 +00:00
christos 6076cfd13e Instead of adding the test in 48095 I added the tests in 48096. Add the
missing test now.
2014-08-23 15:21:35 +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 be99220c64 Convert test in PR/49085 2014-08-23 15:02:04 +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
apb ee8e02daed Add a .PATH, so you can be in any other directory and run
"make -f /path/to/this/Makefile sometest.out"
and have it create sometest.out in your current directory.
2014-08-21 22:00:30 +00:00
apb c354f55834 Add varmisc.mk, for miscellaneous variable tests.
For now, the only test is copied from
src/tests/usr.bin/make/d_unmatchedvarparen.mk.  This was
the only test in src/tests/usr.bin/make that was not also in
src/usr.bin/make/unit-tests.

XXX: src/tests/usr.bin/mk should be changed to reach over to
src/usr.bin/make/unit-tests, instead of keeping out of date copies
of the tests.
2014-08-21 15:37:13 +00:00
apb b9dad2e00f Give each group of tests its own output file.
* Rename each sub-makefile to *.mk;
* Add a *.exp file of expected output for each sub-makefile;
* Remove test.exp, which is replaced by all the other *.exp files.
* Use suffix rules to generate *.rawout and *.out files for
  each test case.
* Rewrite the test and accept targets to adapt to the new way.

The old (now removed) test.exp file is almost identical to the
concatenation (in the correct order) of all the new *.exp files.  There
are expected differences in makefile names embedded in the output, and
the new "exit status" lines.  Some old "*** Error code 1 (ignored)"
lines are also removed (replaced by new "exit status 1" lines).
2014-08-21 13:44:51 +00:00
apb 8189a8d901 Stricter sed expression for matching an optional PID in square brackets. 2014-08-21 13:31:52 +00:00
apb ff90baf509 When sanitising test output, replace "${TEST_MAKE}" with "make".
This string may appear in error messages that end up in the output.
2014-08-21 12:42:03 +00:00
apb 9dba8e3973 Add tests for VAR != command. 2014-08-20 08:39:14 +00:00