-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
34 lines (28 loc) · 1.01 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
rPackageName=Rlgt
newDate=$(shell date +%Y-%m-%d)
rPackageVersion=0.2-0
fixPermissions:
#sed running on Windows screws up permissions
ifeq ($(OS),Windows_NT)
icacls $(rPackageName)/DESCRIPTION /reset
icacls $(rPackageName)/NAMESPACE /reset
endif
check: roxy
R CMD build $(rPackageName)
R CMD check $(rPackageName)_$(rPackageVersion).tar.gz
install: roxy
R CMD build $(rPackageName)
R CMD INSTALL $(rPackageName)_$(rPackageVersion).tar.gz
roxy:
rm -f ./$(rPackageName)/man/*.Rd
echo "library(roxygen2)"> tmp_roxy.R
echo "path <- \"./$(rPackageName)\"" >> tmp_roxy.R
echo "pkgbuild::compile_dll(path=path)" >> tmp_roxy.R
echo "roxygenize(package.dir=path)" >> tmp_roxy.R
R CMD BATCH tmp_roxy.R
cd ./$(rPackageName) && sed -i 's/\(Date: \).*/Date: '"$(newDate)"'/' DESCRIPTION
cd ./$(rPackageName) && sed -i -e 's/\".registration=TRUE\"/.registration=TRUE/' NAMESPACE
clean:
rm -rf $(rPackageName)_$(rPackageVersion).tar.gz $(rPackageName).Rcheck
rm -rf ./$(rPackageName)/man/*.Rd
rm -rf ./tmp_roxy.R ./tmp_roxy.Rout