Skip to content

Commit

Permalink
Add docs make target
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaulrich committed Jun 30, 2023
1 parent 0652878 commit 8619698
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ PKG_INST_FILE = $(R_LIB)/${PKG_NAME}/DESCRIPTION
PKG_R_FILES := $(wildcard ${PKG_PATH}/R/*.R)
PKG_RD_FILES := $(wildcard ${PKG_PATH}/man/*.Rd)
PKG_SRC_FILES := $(wildcard ${PKG_PATH}/src/*)
PKG_ALL_FILES := ${PKG_PATH}/DESCRIPTION ${PKG_PATH}/NAMESPACE $(PKG_R_FILES) $(PKG_RD_FILES) $(PKG_SRC_FILES) \
${PKG_PATH}/inst/include/xts.h ${PKG_PATH}/inst/include/xtsAPI.h
PKG_ALL_FILES := ${PKG_PATH}/DESCRIPTION ${PKG_PATH}/NAMESPACE \
${PKG_PATH}/inst/include/xts.h ${PKG_PATH}/inst/include/xtsAPI.h \
$(PKG_R_FILES) $(PKG_RD_FILES) $(PKG_SRC_FILES) ${PKG_PATH}/.Rbuildignore

HTML_FILES := $(patsubst %.Rmd, %.html, $(wildcard *.Rmd)) \
$(patsubst %.md, %.html, $(wildcard *.md))
Expand All @@ -32,7 +33,7 @@ UNIT_TEST_FILES = $(wildcard ${PKG_PATH}/inst/tinytest/test-*.R)

BENCHMARK_FILE = ${PKG_PATH}/inst/benchmarks/benchmark.subset.R

.PHONY: build install check tests cran clean
.PHONY: docs build install check tests test clean

all: check #benchmark

Expand All @@ -53,11 +54,17 @@ $(PKG_INST_FILE): $(PKG_TARGZ)
@${R_HOME}/bin/R CMD INSTALL ${PKG_TARGZ} --no-byte-compile

# Run R CMD check
check: build
check: docs build
@_R_CHECK_CRAN_INCOMING_=false \
_XTS_TINYTEST_VERBOSE_=1 _XTS_TINYTEST_COLOR_=FALSE \
${R_HOME}/bin/R CMD check ${PKG_TARGZ} --no-vignettes

docs: ${PKG_R_FILES}
@${R_HOME}/bin/Rscript -e "roxygen2::roxygenize(roclets='rd')" \
&& sed -i '/^RoxygenNote/d' ${PKG_PATH}/DESCRIPTION \
&& /bin/rm ${PKG_PATH}/src/*.o \
&& /bin/rm ${PKG_PATH}/src/*.so

# Check for CRAN
cran:
@${R_HOME}/bin/R CMD build ${PKG_PATH} && \
Expand All @@ -78,4 +85,4 @@ html: $(HTML_FILES)
R --slave -e "set.seed(100);rmarkdown::render('$<')"

clean:
$(RM) $(HTML_FILES)
$(RM) $(HTML_FILES) ${PKG_PATH}/src/*.o ${PKG_PATH}/src/*.so

0 comments on commit 8619698

Please sign in to comment.