Description Usage Arguments Details Value Author(s) See Also Examples
Rule is an atomic element of the build process. It defines a set of target
file names,
which are to be built with a given build
command from a given set depends
of files
that targets depend on, and which can be removed by a given clean
command.
1 2 |
target |
A character vector of target file names that are created by the given build command |
depends |
A character vector of file names the build command depends on |
build |
A shell command that runs the build of the given target |
clean |
A shell command that erases all files produced by the build command |
task |
A character vector of parent task names. The mechanism of tasks allows to
group rules. Anything different from |
phony |
Whether the rule has a |
type |
A string representing a type of a rule used e.g. while printing a rule in easily readable format.
For instance, |
If there is a need to group some rules together, one can assign them the same task identifier in
the task
argument. Each rule may get assigned one or more tasks. Tasks may be then built
by executing make task_name
on the command line, which forces to rebuild all rules assigned to the
task 'task_name'
. By default, all rules are assigned to task all
,
which causes make all
command to build everything.
Instance of S3 class rmake.rule
Michal Burda
1 2 3 4 5 6 7 8 9 10 11 | r <- rule(target='something.abc',
depends=c('file.a', 'file.b', 'file.c'),
build='myCompiler file.a file.b file.c -o something.abc',
clean='$(RM) something.abc')
# generate the content of a makefile (as character vector)
makefile(list(r))
# generate to file
tmp <- tempdir()
makefile(list(r), file.path(tmp, "Makefile"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.