Skip to content

Commit 92acd86

Browse files
committed
Prepare helper functions for common R package processes.
1 parent 9356510 commit 92acd86

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## #######################################################################################
2+
##
3+
## Package maintenance makefile
4+
##
5+
## #######################################################################################
6+
7+
# Build package
8+
pkg-build:
9+
@R CMD build ./;
10+
11+
# Get latest built package
12+
pkg-latest-version:
13+
@ls versioning*.tar.gz | tail -1;
14+
15+
# Install the latest package version locally
16+
pkg-install:
17+
@R CMD build ./
18+
@R CMD INSTALL $$(ls versioning*.tar.gz | tail -1);
19+
20+
# Check package for CRAN
21+
pkg-check:
22+
@R CMD build ./
23+
@R CMD check --as-cran $$(ls versioning*.tar.gz | tail -1);
24+
25+
# Convenience target to print all of the available targets in this file
26+
# From https://stackoverflow.com/questions/4219255
27+
.PHONY: list
28+
list:
29+
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
30+
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ \
31+
{if ($$1 !~ "^[#.]") {print $$1}}' | \
32+
sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

0 commit comments

Comments
 (0)