pub struct Target { /* private fields */ }
Implementations§
Source§impl Target
impl Target
Sourcepub fn new_file(name: &str) -> Self
pub fn new_file(name: &str) -> Self
Creates a target that represents a file with the given name.
Sourcepub fn depends_on_target(self, target: Target) -> Self
pub fn depends_on_target(self, target: Target) -> Self
Adds a dependency to this target.
Sourcepub fn depends_on_file(self, file: &str) -> Self
pub fn depends_on_file(self, file: &str) -> Self
Adds a file dependency to this target.
Shorthand for depends_on_target(Target::new_file(file))
.
Sourcepub fn prune<F>(self, reached: F) -> Self
pub fn prune<F>(self, reached: F) -> Self
Sets an early checker to determine if the target can be pruned.
If the function returns true
, the target and its dependencies are
pruned, which means its dependencies will not make, and its recipe will
not be executed.
Sourcepub fn make(&self)
pub fn make(&self)
Kicks off the make process for this target.
Firstly it executes the prune_fn
function, if it exists and returns
true
, the make process for this target stops. Otherwise then, the make
processes of all dependencies are executed recursively. Then if this
target is a file and all its dependencies are files and this file is
newer than all its dependencies, the make recipe of this file is
skipped. Finally, the recipe function is executed if it exists.