aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2016-09-27 23:00:48 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2016-09-27 23:00:48 +0200
commit12a31f4c130c551f82232d9ef7dfb608bd52c53f (patch)
tree2525ab1ea4102a6edddbd0c2f03f4a851bf2f9c5 /GNUmakefile
parent0d958ab6f84b569b5437f231c56004890c4ae23b (diff)
Reorganise repository using standard package layout
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile38
1 files changed, 19 insertions, 19 deletions
diff --git a/GNUmakefile b/GNUmakefile
index d6a2dd3..9d34c37 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,7 +1,6 @@
-PKGSRC := $(shell basename $(CURDIR))
-PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" pkg/DESCRIPTION)
-PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" pkg/DESCRIPTION)
-TGZ := $(PKGSRC)_$(PKGVERS).tar.gz
+PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
+PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
+TGZ := $(PKGNAME)_$(PKGVERS).tar.gz
R_HOME ?= $(shell R RHOME)
DATE := $(shell date +%Y-%m-%d)
@@ -17,38 +16,39 @@ usage:
@echo " check - Run CRAN check on the package."
@echo " install - Install the package."
-pkgfiles = pkg/DESCRIPTION \
+pkgfiles = DESCRIPTION \
README.html \
- pkg/inst/testdata/* \
- pkg/inst/staticdocs/index.r \
- pkg/tests/testthat.R \
- pkg/tests/testthat/* \
- pkg/data/* \
- pkg/R/*
+ .Rbuildignore \
+ inst/testdata/* \
+ inst/staticdocs/index.r \
+ tests/testthat.R \
+ tests/testthat/* \
+ data/* \
+ R/*
clean:
@echo "Cleaning up..."
- rm -fR pkg.Rcheck
+ rm -fR pfm.Rcheck
@echo "DONE."
roxygen:
@echo "Roxygenizing package..."
- "$(R_HOME)/bin/Rscript" -e 'library(devtools); document("pkg")'
+ "$(R_HOME)/bin/Rscript" -e 'library(devtools); document()'
@echo "DONE."
sd: roxygen
@echo "Building static documentation..."
# suppressWarnings to get rid of mbcsToSbcs warnings when plotting the 'ยต' character
- cd pkg; "$(R_HOME)/bin/Rscript" -e 'suppressWarnings(staticdocs::build_site())'
+ "$(R_HOME)/bin/Rscript" -e 'suppressWarnings(staticdocs::build_site())'
@echo "DONE."
$(TGZ): $(pkgfiles)
- sed -i -e "s/Date:.*/Date: $(DATE)/" pkg/DESCRIPTION
+ sed -i -e "s/Date:.*/Date: $(DATE)/" DESCRIPTION
@echo "Roxygenizing package..."
- "$(R_HOME)/bin/Rscript" -e 'library(devtools); document("pkg")'
+ "$(R_HOME)/bin/Rscript" -e 'library(devtools); document()'
@echo "Building package..."
- git log --no-merges -M --date=iso pkg/ > pkg/ChangeLog
- "$(R_HOME)/bin/R" CMD build pkg > build.log 2>&1
+ git log --no-merges -M --date=iso > ChangeLog
+ "$(R_HOME)/bin/R" CMD build . > build.log 2>&1
@echo "DONE."
README.html: README.rmd
@@ -60,7 +60,7 @@ build: $(TGZ)
test: build
@echo "Running testthat tests..."
- "$(R_HOME)/bin/Rscript" -e 'library(devtools); devtools::test("pkg")' 2>&1 | tee test.log
+ "$(R_HOME)/bin/Rscript" -e 'library(devtools); devtools::test()' 2>&1 | tee test.log
@echo "DONE."
quickcheck: build

Contact - Imprint