read_makefile: Read a 'Makefile' Into a 'Makelist'

View source: R/makefiles.R

read_makefileR Documentation

Read a Makefile Into a Makelist

Description

This is experimental! See Note.

Usage

read_makefile(path, clean_sink = FALSE)

Arguments

path

The path to the file.

clean_sink

Remove sinks identical to corresponding targets from the list? Since makelists are parsed, missing sinks are set to the corresponding targets, but this makes them harder to read.

Value

The makelist.

Note

This function will not read arbitrary Makefiles, just those created via write_makefile! If you modify such a Makefile make sure you only add simple rules like the ones you see in that file.

Examples

make_file <- file.path(tempdir(), "Makefile")
write_makefile(provide_make_list(), path = make_file)
str(make_list <- read_makefile(path = make_file))

fakemake documentation built on Aug. 16, 2023, 1:09 a.m.