| Title: | Create 'Makefiles' Using R |
|---|---|
| Description: | A user-friendly interface for the construction of 'Makefiles'. |
| Authors: | Andreas Dominik Cullmann [aut, cre], Kirill Müller [aut] |
| Maintainer: | Andreas Dominik Cullmann <[email protected]> |
| License: | GPL-3 |
| Version: | 1.1.0.9000 |
| Built: | 2026-05-20 06:40:38 UTC |
| Source: | https://gitlab.com/fvafrcu/makefiler |
A user-friendly interface for the construction of 'Makefiles'.
You will find the details invignette("An_Introduction_to_MakefileR", package = "MakefileR").
Maintainer: Andreas Dominik Cullmann [email protected]
Authors:
Kirill Müller
Useful links:
Rules can be appended to groups and Makefiles using the
c function or the + operator.
## S3 method for class 'MakefileR_group' c(..., recursive = FALSE) ## S3 method for class 'MakefileR_group' x + y## S3 method for class 'MakefileR_group' c(..., recursive = FALSE) ## S3 method for class 'MakefileR_group' x + y
..., x, y
|
|
recursive |
|
c(make_group(sep = ""), make_group(make_comment("Dummy targets"), make_rule(".FORCE"), make_rule(".SILENT")), make_group(make_comment("Definitions"), make_def("A", "a"))) makefile() + (make_group() + make_comment("Definitions") + make_def("A", "a"))c(make_group(sep = ""), make_group(make_comment("Dummy targets"), make_rule(".FORCE"), make_rule(".SILENT")), make_group(make_comment("Definitions"), make_def("A", "a"))) makefile() + (make_group() + make_comment("Definitions") + make_def("A", "a"))
For helping the reader understand what's happening
make_comment(...)make_comment(...)
... |
|
Use the
c function or the + operator
to append comments to groups and Makefiles.
An object of class MakefileR_comment
https://www.gnu.org/software/make/manual/
Other items:
make_def(),
make_group(),
make_rule(),
make_text()
make_comment("This is a comment")make_comment("This is a comment")
A variable definition in a Makefile consists of a variable name
and its defition. Both are separated by the equality sign =.
make_def(variable, definition, operator = "=")make_def(variable, definition, operator = "=")
variable |
|
definition |
|
operator |
|
No quoting is applied to the definition by this function. Currently, both variable and definition are required to be character values of length one.
Use the
c function or the + operator
to append definitions to groups and Makefiles.
An object of class MakefileR_def
https://www.gnu.org/software/make/manual/
Other items:
make_comment(),
make_group(),
make_rule(),
make_text()
make_def("R_USER_LIBRARY", .libPaths()[[1L]]) makefile() + make_def("R_USER_LIBRARY", .libPaths()[[1L]])make_def("R_USER_LIBRARY", .libPaths()[[1L]]) makefile() + make_def("R_USER_LIBRARY", .libPaths()[[1L]])
Helps separating similar rules.
make_group(..., .dots = NULL, sep = NULL)make_group(..., .dots = NULL, sep = NULL)
... |
|
.dots |
|
sep |
|
Use the
c function or the + operator
to append groups to other groups and Makefiles (thus creating nested groups).
An object of class MakefileR_group
https://www.gnu.org/software/make/manual/
Other items:
make_comment(),
make_def(),
make_rule(),
make_text()
makefile(make_rule("all", c("first_target", "second_target")))makefile(make_rule("all", c("first_target", "second_target")))
A rule in a Makefile consists of a (list of) targets which may
depend on one or more dependencies each. Optionally, a script is executed to
create the target. Generally, multiple targets mean that the rule is
identical for each of the individual targets, and multiple dependencies mean
that all of them are required to build each of the targets.
In the script, the target can be referenced by $@, and the first
dependency can be referenced by $<. Note that the dollar sign has a
special meaning in a Makefile, use $$ in scripts that need
to use the dollar sign themselves.
make_rule(targets, deps = NULL, script = NULL)make_rule(targets, deps = NULL, script = NULL)
targets |
|
deps |
|
script |
|
Use the
c function or the + operator
to append rules to groups and Makefiles.
An object of class MakefileR_rule
https://www.gnu.org/software/make/manual/
Other items:
make_comment(),
make_def(),
make_group(),
make_text()
make_rule("all", c("first_target", "second_target")) make_rule(".FORCE") make_rule("first_target", ".FORCE", "echo 'Building first target'") make_rule("second_target", "first_target", c("echo 'Building second target'", "echo 'Done'")) makefile() + make_rule("all", c("first_target", "second_target")) + make_rule(".FORCE") + make_rule("first_target", ".FORCE", "echo 'Building first target'") + make_rule("second_target", "first_target", c("echo 'Building second target'", "echo 'Done'"))make_rule("all", c("first_target", "second_target")) make_rule(".FORCE") make_rule("first_target", ".FORCE", "echo 'Building first target'") make_rule("second_target", "first_target", c("echo 'Building second target'", "echo 'Done'")) makefile() + make_rule("all", c("first_target", "second_target")) + make_rule(".FORCE") + make_rule("first_target", ".FORCE", "echo 'Building first target'") + make_rule("second_target", "first_target", c("echo 'Building second target'", "echo 'Done'"))
For anything else not covered by the other make_ functions, such as
the export statement for exporting Makefile variables.
make_text(...)make_text(...)
... |
|
Use the
c function or the + operator
to append comments to groups and Makefiles.
An object of class MakefileR_text
https://www.gnu.org/software/make/manual/
Other items:
make_comment(),
make_def(),
make_group(),
make_rule()
make_text("export SOME_VARIABLE")make_text("export SOME_VARIABLE")
A Makefile consists of a list of rules, definition, comments
and other items.
makefile(..., .dots = NULL)makefile(..., .dots = NULL)
... |
|
.dots |
|
Use the
c function or the + operator
to append rules, definitions, comments, plain text, and groups.
An object of class MakefileR_file
https://www.gnu.org/software/make/manual/
make_rule, make_def,
make_comment, make_text, make_group,
c.MakefileR_group
makefile(make_rule("all", c("first_target", "second_target")))makefile(make_rule("all", c("first_target", "second_target")))
Makefiles, as created by makefile, only exist in memory until
they are written to a file by this function.
write_makefile(makefile, file_name)write_makefile(makefile, file_name)
makefile |
|
file_name |
|
The value returned by writeLines