Skip to content

Commit

Permalink
tuning the Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
davebraze committed Oct 18, 2021
1 parent 6d206bf commit b02191e
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
R_OPTS = --vanilla -e
R.OPTS = --vanilla -e
DATE = $(shell date.exe "+%Y%m%d")
PKG.VERS = $(shell Rscript $(R.OPTS) "cat(read.dcf('DESCRIPTION', fields='Version'))")
PKG.NAME = $(shell Rscript $(R.OPTS) "cat(read.dcf('DESCRIPTION', fields='Package'))")
BUILT.PKG = $(PKG.NAME)_$(PKG.VERS).tar.gz

## TODO:
## o Add target for pushing version tag (e.g., v0.0.9) to github for package release

test:
@echo $(BUILT.PKG)

date:
@echo $(DATE)

##### build and check package

##### targets to build and check package

## Build the package. Set 'binary=FALSE' (build a source package) for cross-platform portability.
build:
R $(R_OPTS) "devtools::build(pkg='.', binary=FALSE, vignettes=TRUE, manual=TRUE)"
R $(R.OPTS) "devtools::build(pkg='.', binary=FALSE, vignettes=TRUE, manual=TRUE)"

## Check the built package for current version number.
## Must pass checks with no errors, and preferably no warnings.
checkbuilt:
R $(R_OPTS) "devtools::check_built(path=here::here('..', 'FDButils_0.0.9.tar.gz'))"
R $(R.OPTS) "devtools::check_built(path=here::here('..', '$(BUILT.PKG)'))"

## Build and check the package. Does not save built package. Must pass checks with no errors, and preferably no warnings.
## Build and check the package. Does not save built package.
## Must pass checks with no errors, and preferably no warnings.
check:
R $(R_OPTS) "devtools::check(pkg='.')"
R $(R.OPTS) "devtools::check(pkg='.')"

##### Build pkgdown site from scratch (online documentation)
##### target to build pkgdown site from scratch (online documentation)
pkgdown:
R $(R_OPTS) "pkgdown::clean_site(pkg='.')"
R $(R_OPTS) "pkgdown::build_site(pkg='.', preview=TRUE)"
R $(R.OPTS) "pkgdown::clean_site(pkg='.')"
R $(R.OPTS) "pkgdown::build_site(pkg='.', preview=TRUE)"

##### Build documentation in various formats in order to check it's ok.
##### targets to build documentation in various formats, mostly in order to check it's ok before release

## Build roxygen2 documentation
document:
R $(R_OPTS) "devtools::document(pkg='.')"
R $(R.OPTS) "devtools::document(pkg='.')"

## Build PDF manual and put it in the parent directory to the package.
manual:
R $(R_OPTS) "devtools::build_manual(pkg='.')"
R $(R.OPTS) "devtools::build_manual(pkg='.')"

0 comments on commit b02191e

Please sign in to comment.