Learn R Programming

fakemake (version 1.9.0)

make: Mock the Unix Make Utility

Description

Mock the Unix Make Utility

Usage

make(
  name,
  make_list,
  force = FALSE,
  recursive = force,
  verbose = FALSE,
  dry_run = FALSE
)

Arguments

name

The name or alias of a make target.

make_list

The makelist (a listed version of a Makefile).

force

Force the target to be build?

recursive

Force the target to be build recursively (see Note)?

verbose

Be verbose?

dry_run

Run dry? Mock make's -n option.

Value

A character vector containing the targets made during the current run.

Examples

Run this code
# NOT RUN {
str(make_list <- provide_make_list("minimal"))
# build all
withr::with_dir(tempdir(), print(make("all.Rout", make_list)))
# nothing to be done
withr::with_dir(tempdir(), print(make("all.Rout", make_list)))
# forcing all.Rout
withr::with_dir(tempdir(), print(make("all.Rout", make_list, force = TRUE,
                                      recursive = FALSE)))
# forcing all.Rout recursively
withr::with_dir(tempdir(), print(make("all.Rout", make_list, force = TRUE)))

# show files
dir(tempdir(), pattern = ".*\\.Rout")

# dry run
file.remove(dir(tempdir(), pattern = ".*\\.Rout", full.names = TRUE))
withr::with_dir(tempdir(), print(make("all.Rout", make_list,
                                      dry_run = TRUE)))
dir(tempdir(), pattern = ".*\\.Rout")
# }

Run the code above in your browser using DataLab