forked from h2oai/h2o-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (49 loc) · 2.23 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
PROJECT_VERSION ?= 99.70
# Do a best-effort attempt to see if the R user has pdflatex installed
# and avoid running it if they don't.
#
# But use the '-' to ignore failures and continue the build even if it does fail.
PDFLATEX=$(shell which pdflatex)
build_outer:
sed 's/SUBST_PROJECT_VERSION/$(PROJECT_VERSION)/' h2o-DESCRIPTION.template > h2o-package/DESCRIPTION
sed 's/SUBST_PROJECT_VERSION/$(PROJECT_VERSION)/' h2o-package.template > h2o-package/man/h2o-package.Rd
ifeq ($(PDFLATEX),)
@echo pdflatex not found, skipping pdf generation...
else
-R CMD Rd2pdf --force --output="h2o-package/h2o_package.pdf" --title="Package 'h2o'" --no-index --no-preview h2o-package/man 1> /dev/null
endif
mkdir -p h2o-package/inst/java/
cp -f ../target/h2o.jar h2o-package/inst/java/h2o.jar
R CMD build h2o-package
mkdir -p ../target/R
cp -p README.txt ../target/R
mv h2o_$(PROJECT_VERSION).tar.gz ../target/R
build_inner:
sed 's/SUBST_PROJECT_VERSION/$(PROJECT_VERSION)/' h2oRClient-DESCRIPTION.template > h2oRClient-package/DESCRIPTION
sed 's/SUBST_PROJECT_VERSION/$(PROJECT_VERSION)/' h2oRClient-package.template > h2oRClient-package/man/h2oRClient-package.Rd
ifeq ($(PDFLATEX),)
@echo pdflatex not found, skipping pdf generation...
else
-R CMD Rd2pdf --force --output="h2oRClient-package/h2oRClient_package.pdf" --title="Package 'h2oRClient'" --no-index --no-preview h2oRClient-package/man 1> /dev/null
endif
R CMD build h2oRClient-package
echo h2oRClient_$(PROJECT_VERSION).tar.gz > info.txt
openssl md5 h2oRClient_$(PROJECT_VERSION).tar.gz | sed 's/.*= //' >> info.txt
# Create temporary directory for jarring later
mkdir -p ../r_pack_tmp/resources/R
cp -p info.txt ../r_pack_tmp/resources/R/info.txt
cp -p h2oRClient_$(PROJECT_VERSION).tar.gz ../r_pack_tmp/resources/R
# Add to resources directory
mkdir -p ../lib/resources/R
mv info.txt ../lib/resources/R/info.txt
mv h2oRClient_$(PROJECT_VERSION).tar.gz ../lib/resources/R
clean:
rm -f h2oRClient-package/DESCRIPTION
rm -f h2oRClient-package/h2oRClient_package.pdf
rm -f h2oRClient-package/man/h2oRClient-package.Rd
rm -f h2oRClient_*.tar.gz
rm -f h2o-package/DESCRIPTION
rm -f h2o-package/h2o_package.pdf
rm -f h2o-package/man/h2o-package.Rd
rm -f h2o-package/inst/java/h2o.jar
rm -f h2o_*.tar.gz