-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
executable file
·121 lines (91 loc) · 2.03 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
## --- Makefile for Github/R package
## ---
## --- Define R package
PACKAGE=senlm
## --- Define github location
GIT=PRIMER-e/senlm
## --- Phony targets
.PHONY: doc
## --- Package creation
## > usethis::create_package ("...PATH.../PACKAGE", rstudio=TRUE)
## --- Initialisation
## git init
## git add DESCRIPTION
## git commit -m "First commit."
## git remote add origin git@github.com/PRIMER-e/senlm.git
## git push -u origin master
## --- Remove file
## Remove file from git webpage
## git filter-branch
## git pull
## git push
## --- IGNORE FILES
## --- .gitignore
## .Rproj.user
## .Rbuildignore
## senlm.Rproj
## Makefile
## code/*
## *~
## --- .Rbuildignore
## ^.*\.Rproj$
## ^\.Rproj\.user$
## ^Makefile$
## ^code$
## ^run$
## ---
## --- DEFAULT
all :
@ echo "Do what?"
## --- GIT
## --- Add files
add :
git add -A .
## --- Commit files
commit :
git commit -m `date +%Y-%m-%d`
## --- List git files
ls :
git ls-tree --full-tree -r --name-only HEAD
## --- Push
push :
git push
## --- Pull
pull :
git pull
## --- Upload code to github
git :
make add; make commit; make push
## --- PACKAGE
## --- Documentation
doc :
echo "devtools::document()" | R --quiet --no-save
## --- Vignettes
vig :
echo "devtools::clean_vignettes(); devtools::build_vignettes();" | R --quiet --no-save
## --- Local installation
##install :
## echo "setwd('..'); devtools::install('${PACKAGE}', build_vignettes=TRUE)" | R --quiet --no-save
install :
echo "devtools::install()" | R --quiet --no-save
## --- Build
build :
make doc; make vig; make install
## --- Rebuild, upload to git
update :
make build; make git;
## --- Get : Reinstall from git
get :
echo "devtools::install_github('${GIT}', build_vignettes=TRUE)" | R --quiet --no-save
## --- CHECK/TEST
## --- Check
check :
echo "devtools::load_all(); devtools::check()" | R --quiet --no-save
## --- Test : Initialisation
init-test :
echo "usethis::use_testthat()" | R --quiet --no-save
## --- Run tests
test :
echo "devtools::test()" | R --quiet --no-save
## --- Build site
## pkgdown::build_site()