LTARGET

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXIT STATUS
EXAMPLES
NOTES
SEE ALSO
COPYRIGHT

NAME

ltarget - report targets from a open-lmake job

SYNOPSIS

ltarget [OPTION]... [FILE]...

DESCRIPTION

ltarget may be used to pass flags to open-lmake. Unless specified otherwise, passed targets are allowed to be written to.

Note that :

Flags can be passed in (cf. OPTIONS below). Flags accumulate and will apply even if the file is independently accessed.

Targets are reported even if the autodep method (the autodep rule attribute) is none. This is the way (or a call to lmake.target) of reporting targets in such a case (usually with --write).

Symlobic links are not followed when files are interpreted. Following symbolic links would inevitably lead to files being read (to check if they are symbolic links) before being a target, which would be an error.

OPTIONS

-L, --follow-symlinks

Follow the last level symbolic link, default is not to follow.

-W, --write

Report an actual write, not only target flags. Default is to only alter flags.

-z, --dir

Specify a directory for use with --list.

-l, --list

Print list of currently generated targets to stdout. Only targets lying in the dir mentioned with --dir are listed (if this option is used), and only if they match the regexpr argument (if --regexpr) as reported. If the cwd lies outside the repo, listed files are absolute, else they are relative unless they are within an absolute source dir. The order of the listed targets is the chronological order. Cf note (3).

-X, --regexpr

Pass flags to all targets matching regexprs passed as argument. The ignore flag only applies to targets following this command.

-x, --no-exclude-star

Accept that flags are further processed according to regexpr-based requests, e.g. ltarget --regexpr, default is to exclude such processing.

-E, --essential

Show when generating user oriented graphs.

-i, --incremental

Targets are not unlinked before job execution and read accesses to them are ignored (including readdir(3)).

-w, --no-warning

No warning is emitted if targets are either uniquified or unlinked while generated by another job.

-I, --ignore

From now on, ignore all reads and writes to targets (including readdir(3)).

-a, --no-allow

Unless this option is passed, ltarget makes its arguments valid targets.

-s, --source-ok

Unless this option is passed, writing to a source is an error. In that case, being simultaneously a dep and a target is ok.

In case mentioned targets turn out to be deps, the dep flags are also available:
-c
, --critical

Create critical deps (cf. note (4)).

-D, --readdir-ok

Allow readdir(3) on passed deps even if not ignored nor incremental. Implies flag --no-required.

-e, --ignore-error

Ignore the error status of the passed deps.

-r, --no-required

Accept that deps be not buildable, as for a normal read access (in such a case, the read may fail, but open-lmake is ok).

EXIT STATUS

ltarget exits with a status of zero if target flags were correctly set. Else it exits with a non-zero status:

2

internal error, should not occur

11

bad usage : command line options and arguments coul not be parsed

EXAMPLES

ltarget --ignore a_file

echo >a_file

ltarget --readdir_ok a_dir

rm -rf a_dir

NOTES

(1)

The same functionality is provided with the lmake.target python function.

(2)

Flags can be associated to targets on a regexpr (matching on target name) basis by using the side_targets rule attribute.

(3)

--list is provided as a secure way to replace readdir(3). Using this feature only relies on job execution, not spurious files that can exist without the possibility of depending on such list.

(4)

If a series of dep is directly derived from the content of a file, it may be wise to declare it as critical. When a critical dep is modified, open-lmake forgets about deps reported after it.

Usually, when a file is modified, this has no influence on the list of files that are accessed after it, and open-lmake anticipates this by building these deps speculatively. But in some situations, it is almost certain that there will be an influence and it is preferable not to anticipate. this is what critical deps are made for: in case of modifications, following deps are not built speculatively.

SEE ALSO

lautodep(1), lcheck_deps(1), lcollect(1), ldebug(1), ldecode(1), ldepend(1), ldircache_repair(1), lencode(1), lforget(1), lmake(1), lmark(1), lrepair(1), lrun_cc(1), lshow(1), xxhsum(1)

The python module lmake.

The full open-lmake documentation in <open-lmake-installation-dir>/docs/index.html.

COPYRIGHT

Copyright © 2023-2025, Doliam. This file is part of open-lmake.

open-lmake is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.

open-lmake is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.