-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·44 lines (37 loc) · 1.04 KB
/
Makefile
File metadata and controls
executable file
·44 lines (37 loc) · 1.04 KB
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
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGDATE = `date +%Y-%m-%d`
PKGYEAR = `date +%Y`
all: check
build:
mkdir -p builds
@rm -rf /tmp/$(PKGNAME)
cp -R ./ /tmp/$(PKGNAME)
@rm /tmp/$(PKGNAME)/Makefile
@rm /tmp/$(PKGNAME)/README.Rmd
@rm -rf /tmp/$(PKGNAME)/dev
@rm -rf /tmp/$(PKGNAME)/builds
# set tags
{ \
cd /tmp/$(PKGNAME) ;\
for f in `ls R/*.R man/*.Rd DESCRIPTION LICENSE`; do \
echo "processing $$f" ;\
sed \
-e "s/\$$version\$$\?/$(PKGVERS)/g" \
-e "s/\$$date\$$\?/$(PKGDATE)/g" \
-e "s/\$$year\$$\?/$(PKGYEAR)/g" \
< $$f > $$$$; \
mv $$$$ $$f; \
done; \
}
cd builds; R CMD build /tmp/$(PKGNAME)
@rm -rf /tmp/$(PKGNAME)
check: build
R CMD check builds/$(PKGNAME)_$(PKGVERS).tar.gz
check-cran: build
R CMD check --as-cran builds/$(PKGNAME)_$(PKGVERS).tar.gz
install:
R CMD INSTALL --library=$(R_LIBS_USER) builds/$(PKGNAME)_$(PKGVERS).tar.gz
clean:
@rm -rf $(PKGNAME).Rcheck
@rm -rf builds/$(PKGNAME).Rcheck