Browse code

Makefile

GuangchuangYu authored on 21/07/2016 10:14:02
Showing2 changed files

... ...
@@ -3,3 +3,4 @@ TODO.md
3 3
 appveyor.yml
4 4
 .gitignore
5 5
 .svnignore
6
+Makefile
6 7
new file mode 100644
... ...
@@ -0,0 +1,24 @@
1
+PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
2
+PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
3
+PKGSRC  := $(shell basename `pwd`)
4
+
5
+all: check clean
6
+
7
+docs:
8
+	Rscript -e 'roxygen2::roxygenise(".")'
9
+
10
+build:
11
+	cd ..;\
12
+	R CMD build $(PKGSRC)
13
+
14
+install:
15
+	cd ..;\
16
+	R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
17
+
18
+check: build
19
+	cd ..;\
20
+	R CMD check $(PKGNAME)_$(PKGVERS).tar.gz
21
+
22
+clean:
23
+	cd ..;\
24
+	$(RM) -r $(PKGNAME).Rcheck/