-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
69 lines (58 loc) · 2.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
default: help
SRC=./src
.PHONY: lib
lib: clean # build the shared library version of dbc2dbf
R CMD SHLIB -o src/db2dbf.so src/*.c -fsanitize=undefined
.PHONY: clean
clean: # clean generated files
rm -rf revdep/*
rm -f $(SRC)/*.o
rm -f $(SRC)/*.so
.PHONY: check
check: # run CRAN checks
Rscript -e "devtools::check(remote = TRUE, manual = FALSE)"
Rscript -e "urlchecker::url_check()"
.PHONY: wincheck
wincheck: # run CRAN checks on Windows. Note: it uses a remote machine, check email for results
Rscript -e "devtools::check_win_devel()"
.PHONY: revdep
revdep: # reverse dependency checks
Rscript -e "revdepcheck::revdep_check(num_workers = 4)"
.PHONY: generate
generate: # generate C to R interface code
Rscript -e 'tools::package_native_routine_registration_skeleton(".")' > src/read_dbc_init.c
.PHONY: setup
setup: # install tools necessary for building the package
Rscript -e 'install.packages("devtools", repos="http://cran.us.r-project.org")'
Rscript -e 'install.packages("roxygen2", repos="http://cran.us.r-project.org")'
Rscript -e 'devtools::install_github("r-lib/revdepcheck")'
Rscript -e "usethis::use_revdep()"
.PHONY: document
document: # generate R docs from source code
Rscript -e "devtools::document()"
.PHONY: help
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
.PHONY: cran
cran: clean document check revdep # prepare the package for CRAN release
@echo ======== BUILD COMPLETE ========
@echo
@echo New version is ready for publishing.
@echo
@echo Please check that the following tasks are completed before submitting to CRAN:
@echo - Update inst/CHANGELOG.md
@echo - Update NEWS.md
@echo - Update cran-comments.md
@echo
@echo After the tasks above are completed, run the following command from R or RStudio to submit to CRAN:
@echo
@echo "devtools::submit_cran()"
@echo
@echo After submitting, create a commit with the updated CRAN-SUBMISSION file and tag it as a release candidate:
@echo
@echo git tag 1.0.7-rc1 # create release candidate tag
@echo git push --tags # publish remote tag
@echo
@echo Once a submission is approved, create the corresponding release tag for the latest commit.
@echo
@echo