Makefile for R packages
Makefile Shell R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Makefile for R packages

maker is based on This version has been updated to be run outside of the package directory and reduce external Rscript dependencies.


You are welcome to:

Integrate maker into your project

Our version of maker is meant to be installed and run outside of the package directory. Start by cloning maker (for example in the base directory that contains your R package(s)), create the appropriate symlinks and use it.

git clone
ln -s maker/Makefile .
make help

Update maker

make maker


$ make help


  make TARGET PKG=package
    e.g. make build PKG=MSnbase


  build                       build source package
  vignettes                   build vignettes in ./${PKGDIR}/vignettes/
  compile-attributes          run Rcpp::compileAttributes()
  release                     build package for Bioc/CRAN release (includes vignettes etc.)


  check                       build and check package; the check will always use "--no-vignettes" because vignettes are checked by the build process before
  check-only                  check package and time checking
  bioccheck                   build, check and BiocCheck package
  bioccheck-only              BiocCheck package
  check-reverse-dependencies  check packages which depend on this package
  check-downstream            check packages which depend on this package


  clean                       remove temporary files and .Rcheck
  clean-tar                   remove .tar.gz archive
  clean-vignettes             remove vignettes in inst/doc/
  clean-all                   combine "clean", "clean-tar" and "clean-vignettes"

Increment version:

  increment-version-major     increment major version number (X++.1) and set the "Date" field in the DESCRIPTION file
  increment-version-minor     increment minor version number (1.X++) and set the "Date" field in the DESCRIPTION file
  increment-version-patch     increment patch version number (1.1.X++) and set the "Date" field in the DESCRIPTION file


  install                     build and install package
  install-only                install package
  remove                      remove package


  roxygen                     roxygenize package
  rd                          roxygenize rd rocklet
  pkg-home                    pkgdown home
  pkg-news                    pkgdown news
  pkg-refs                    pkgdown references (manuals)
  pkg-vigs                    pkgdown articles (Rmd vignettes)
  pkg-all                     pkgdonw home, refs, articles and news (in that order)
  pkgdown                     full pkgdown site using the pkgdown::build_site                   knit README.Rmd if available
  NEWS                        create plain text NEWS from if available

Maker specific targets:

  maker                       update maker toolbox             update help output in
  version                     prints latest git hash and date of maker

Available variables:

  PKG/PKGDIR                  path to the target package (default is 'maker')
  MAKERRC                     path to the maker configuration file (default is '~/.makerrc')
  VIG                         vignettes be build (default is 1). If 0, build --no-build-vignettes is used
  WARNINGS_AS_ERRORS          fail on warnings (default is 1)
  CRAN                        check using --as-cran (default is 0)
  COLOURS                     using colours for R CMD check results (default is 1)
  RPROFILE                    path to .Rprofile (default is ${MAKEDIR}/include/Rprofile)
  TIMEFORMAT                  time format (default: empty)


  Vignettes are not build when checking: R CMD check --no-build-vignettes

  win-builder                 build package and send to
  run-demos                   source and run demo/*.R files
  get-default-pkg             print current default PKG
  set-default-pkg             set new default PKG
  remove-default-pkg          remove current default PKG

Getting help:

  help target usage           print this help text
 Create an issue on or 
 write an e-mail to Sebastian Gibb <> and Laurent Gatto <>.

Additional targets via external Makefile

To add new project specific target to maker, you could create a makefiles directory in your main maker directory (defined as ${MAKERDIR}) and add the following to your ~/.makerrc configuration file:

include ${ADDMAKEFILESDIR}/Makefile.*

to automatically include new Makefiles. See issue 8 for a short discussion and an example.


You could specify your own default variables in ~/.makerrc. Please see, e.g. .makerrc:

## configuration Makefile for maker

## don't build vignettes
VIG  := 0

## always use --as-cran
CRAN := 1

The ~/.makerrc file is a Makefile as well. So you can use every supported Makefile command.

See the Setting R_HOME issue to use multiple R installations with maker.

More recipes

See the file for additional/contributed recipes.