Commit Graph

296 Commits

Author SHA1 Message Date
rillig 4dc2cd5c6f make: rename context and ctxt to scope
This continues the previous commit, in which VAR_GLOBAL, VAR_INTERNAL
and VAR_CMDLINE were renamed.

Renaming the variable 'ctxt' was trivial since that word is used nowhere
else.  In the comments though, each occurrence of the word 'context' had
to be checked individually since the word 'context' was not only used
for referring to a variable scope.  It is also used to distinguish
different situations where characters are escaped in a certain way
('parsing context') and in a few other expressions.
2021-02-04 21:42:46 +00:00
rillig b3b6e90160 make(1): remove trailing whitespace in manual page 2020-12-23 13:49:12 +00:00
rillig a542a5a6b7 make(1): allow .undef to undefine multiple variables at once
Since make doesn't support variable names containing spaces, this edge
case is not enough reason to stop this feature.  Having multiple
variable names as arguments nicely aligns with other directives such as
.for and .export.
2020-12-22 20:10:21 +00:00
sjg a4b8ab5ff9 Add .MAKE.UID and .MAKE.GID 2020-11-25 00:50:44 +00:00
rillig b0c345bc98 make(1): document the -S option
This option has been available at least since 1993-03-21, and for the
same time it has been undocumented.
2020-11-14 22:19:13 +00:00
sjg aa03bcf7d6 Pass a writable flag to Main_SetObjdir to control writable check
For curdir and an explicit .OBJDIR target, we allow for
the directory to be read-only.
During InitObjdir we otherwise default to requiring objdir to be
writable - this can be controlled by env variable
MAKE_OBJDIR_CHECK_WRITABLE

Add unit-tests/objdir-writable

Reviewed by: christos rillig
2020-11-12 23:35:21 +00:00
rillig b418af7851 make(1): fix manual page regarding numerical comparisons
Make uses double, not int, for comparing things.
2020-11-01 20:24:45 +00:00
rillig 5c2c546f89 make(1): fix manual page about the modifiers of the :C modifier 2020-08-28 17:15:04 +00:00
sjg 74eb567570 Add .SHELL as read-only variable
The .SHELL variable represents the shellPath used to run
scripts.

Reviewed by: rillig, christos
2020-08-22 19:30:58 +00:00
rillig 60fd66e933 make(1): fix a few inconsistencies in the manual page 2020-08-19 06:10:06 +00:00
dholland bed4fe6a95 Also mention that make dependency operators must be uniform.
This wasn't previously documented, I think.
2020-08-05 08:50:42 +00:00
dholland 07e947ff5b Rework the description of the :, !, and :: dependence operators to make sense.
Bump date.
2020-08-05 08:43:24 +00:00
sjg a826e8b769 Add -dL for LINT
When parsing variable assignments other than := and if
value contains '$' attempt Var_Subst the same as for :=,
if the value does not parse correctly, we get a fatal error
including file an line number.

This can greatly help with finding the cause of problems.

Reviewed by: christos
2020-07-31 20:22:10 +00:00
sjg 6625c883c8 Add -dh for DEBUG_HASH
Allow tracking of max chain length, to see how well the hash
tables are working.
Pull the actual hash operation into a marco so it can be
easily changed - for experimenting.

The current hash, is pretty good.

Reviewed by: christos
2020-07-18 21:37:38 +00:00
wiz 5686c270c9 Remove trailing whitespace. 2020-06-06 20:28:42 +00:00
sjg 39bf2cb2a2 make: add :Or for reverse sort
:Or is more efficient than :O:[-1..1]

Reviewed by: christos
2020-06-05 19:20:46 +00:00
christos 4f0d04b7c8 document the SYSV ${VAR:old=new} corner cases. 2020-04-27 20:03:08 +00:00
wiz 658916dfa6 Remove trailing whitespace. 2020-02-04 16:28:29 +00:00
uwe bef663a135 Make delimiters in <file> and "file" literal. 2020-02-03 22:25:17 +00:00
kamil eff97f353a Fix usage of angle-brackets and quotes in make(1) manpage
make(1) has commands .include <file> and .include "file",
but the manpage was (inconsistently) rendering <file> with
angle-brackets (e.g. in UTF8  ) and "file" with curly-quotes
in HTML output (but not text).

This is an attempt to fix that and output only literal <file>
and "file" as is actually required in the makefile.fileoutput,

https://reviews.freebsd.org/D21470

Submitted by Mateusz Piotrowski (FreeBSD)
2020-02-03 15:47:03 +00:00
maxv 2a5d072bf2 Revert the filemon removal in bmake, as pointed out by maya we do care
about not introducing divergence with FreeBSD, and the cost of unused
is acceptable here.
2019-12-19 07:14:07 +00:00
maxv e67f51b8f7 Retire filemon, discussed on tech-kern@. 2019-12-18 07:37:17 +00:00
gutteridge 1c2ba908cc make(1): minor grammar fixes in BUGS section 2019-02-16 07:41:12 +00:00
christos c50a4e606c - Introduce :q modifier for make variables and make it double escape $'s so
that passing variables to recursive makes with :q works as expected.
- Revert :Q to work as before.
- Adjust makefiles that use recursive make to use :q

Discussed on tech-toolchain@
XXX: pullup 8
2018-05-27 01:14:50 +00:00
dholland 377ca2b42e Fix bad markup. 2018-04-02 04:26:17 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
dholland 8d1c7950e6 Improve description of -V. Can probably be improved further. 2017-06-22 13:42:09 +00:00
wiz a726a39b89 Whitespace fixes. 2017-06-22 13:34:13 +00:00
dholland af10ba7a81 Document what the magic variable .MAKE.EXPAND_VARIABLES actually does. 2017-06-22 13:21:21 +00:00
christos 6b4650c2c5 Add -v variable that always expands variables; restore -V the way it was. 2017-06-19 19:58:24 +00:00
sjg 693df6904d Since we are avoiding VAR_INTERNAL, allow the variable :_ stores to
to be specified, also allows for multiple stages of modification to
be stashed.
2017-02-01 18:39:27 +00:00
sjg 4098307a7f Add :range and :_
:range	replaces var value with an integer sequence one per word
	in the current var value.

:_	stores the current var value in $_ so that it can be referred to
	later in the modifier series.

Reviewed by: christos
2017-01-30 02:46:20 +00:00
sjg c3ec6594d3 Allow providing a utc value to :{gm,local}time
Reviewed by: christos
2017-01-14 22:58:04 +00:00
dholland 7f48560292 Document .DELETE_ON_ERROR. 2016-08-26 23:37:54 +00:00
wiz e20c5869bb Whitespace. 2016-08-18 19:23:20 +00:00
sjg 69fc18aad5 Add .MAKE.META.IGNORE_FILTER to allow more complicated filtering of filemon data.
The filter is applied to paths Read or Excuted, and if it expands to
nothing, the entry is skipped.

For example; dirdeps.mk can set this to:

.MAKE.META.IGNORE_FILTER = M*/${.MAKE.DEPENDFILE_PREFIX}*

when checking if DIRDEPS_CACHE is up to date, where only Makefile.depend*
are of interest.
2016-08-15 19:20:17 +00:00
sjg 374771b4a4 Set .ERROR_CMD if we can 2016-08-10 23:49:12 +00:00
wiz 401a245f9e Fix typo in width argument; end sentence with dot. 2016-06-03 07:07:37 +00:00
sjg 2d086608a8 Refactor the logic for deciding when a .meta file is needed.
Both meta_create() and meta_oodate() now share meta_needed()
to indicate if a .meta file is needed.

This allows for deciding that missing .meta file is cause of out-of-date.
The new knob 'missing-meta' controlls this, and is off by default
since the side effect files of generators like yacc will typically need
.NOMETA to avoid problems.

This however makes it much easier for folk to switch back and forth
with meta mode (eg. FreeBSD's normal build can leverage meta mode for
improved reliablility without need to clean).

Also if .MAKE.MODE does not contain 'nofilemon', the knob
'missing-filemon' allows control as to whether missing filemon data
should cause the target to be out-of-date.
Again off by default.
2016-06-03 01:16:27 +00:00
sjg 1ea1c693f3 Allow for ignoring paths that match a set of patterns.
This can be expensive, so use with caution.
2016-05-10 23:45:45 +00:00
sjg 2271de011e Fix syntax 2016-03-16 00:19:01 +00:00
matthias 00a4845b58 make $@ an alias for $! in archive member rules (compatibility with
other makes).
2016-03-14 07:42:15 +00:00
wiz 69951fe427 Spelling fixes. 2016-02-20 01:43:28 +00:00
sjg 30ecb77bc6 Add a knob .MAKE.SAVE_DOLLARS to control the behavior of $$ during :=
If TRUE '$$' are not consumed (saved).
If FALSE '$$' becomes '$' just like normal expansion rules.

default is TRUE.

Reviewed by: christos
2016-02-20 01:19:03 +00:00
sjg 8d916cfab5 Add .export-literal to avoid the need for $$ dance when trying to put
unexpanded variables into environment.

Reviewed by: christos
2016-02-18 20:25:08 +00:00
sjg f24ab88bf9 It's 2016 2016-02-18 06:18:58 +00:00
sjg a6c0ebbea8 Add support for .dinclude
Like .sinclude missing file will be ignored.
Like .depend stale dependencies will be ignored.
Allows better implementation of auto depend.

Reviewed by: christos
Requested by: Bryan Drewery at FreeBSD.
2016-02-18 05:02:49 +00:00
wiz b96dc7bfa6 Drop trailing whitespace. 2015-06-05 07:33:40 +00:00
sjg fab1dc5098 Document .OBJDIR target. 2015-06-05 05:37:42 +00:00
wiz 2690505034 It's 2015. 2015-04-10 08:43:32 +00:00