Nothing
#' Interface to `make` for package building
#'
#' \code{make} calls make for the specified target.
#'
#' @param target Makefile target, use \code{make_geteasytargets} to get a list of possible targets.
#' @param path path where makefile resides
#' @param makefile the Makefile to be used
#' @include make.R
#' @export
#' @examples
#' \dontrun{
#' make ("build")
#' }
make <- function (target = "all", path = "./", makefile = "Makefile"){
oldwd <- getwd ()
on.exit (setwd (oldwd))
setwd (path)
if (! file.exists (makefile))
stop ("Makefile (", getwd (), "/", makefile, ") not found.")
system2 ("make", args = paste ("-f", makefile, target))
}
#'
#' \code{make_geteasytargets} extracts "easy" targets from the makefile, i.e.
#' non-complex (no "%") targets that are also not filenames.
#'
#' @export
#' @rdname make
#' @examples
#'
#' \dontrun{
#' make_geteasytargets ()
#' }
make_geteasytargets <- function (makefile = "Makefile"){
makefile <- readLines(makefile)
targets <- makefile [grepl (":", makefile)]
targets <- targets [! grepl ("^([[:space:]]|#)", targets)]
targets <- targets [! grepl (":=", targets)]
targets <- gsub (":.*$", "", targets)
## now prune everything that is not an "easy" target
targets <- targets [! grepl ("%", targets)] # no complex targets
targets <- targets [! grepl ("^[.]", targets)] # no hidden targets
targets <- targets [! grepl ("/", targets)] # no targets in subdirectories
targets [! file.exists (targets)]
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.