forked from r-wasm/webr-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (37 loc) · 1.12 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
-include ~/.webr-vars.mk
R_VERSION = $(shell cat $(WEBR_ROOT)/R/R-VERSION)
R_VERSION_SHORT = $(shell grep -Eo '[0-9]+\.[0-9]+' $(WEBR_ROOT)/R/R-VERSION)
R_HOST ?= /usr/local
.PHONY: repo
repo:
mkdir -p repo/src/contrib lib
R_VERSION=$(R_VERSION_SHORT) \
R_HOST=$(R_HOST) \
PATH="$(WEBR_ROOT)/wasm/bin:${PATH}" \
PKG_CONFIG_PATH="$(WEBR_ROOT)/wasm/lib/pkgconfig" \
$(R_HOST)/bin/Rscript repo-update.R
.PHONY: pkg-%
pkg-%:
make clean-$*
mkdir -p repo/src/contrib lib
R_VERSION=$(R_VERSION_SHORT) \
R_HOST=$(R_HOST) \
PATH="$(WEBR_ROOT)/wasm/bin:${PATH}" \
PKG_CONFIG_PATH="$(WEBR_ROOT)/wasm/lib/pkgconfig" \
$(R_HOST)/bin/Rscript repo-update.R $*
.PHONY: clean
clean:
rm -rf repo lib
.PHONY: clean-%
clean-%:
rm -rf repo/src/contrib/$**
rm -rf repo/bin/emscripten/contrib/$(R_VERSION_SHORT)/$**
rm -rf lib/$*
make PACKAGES
.PHONY: PACKAGES
PACKAGES:
$(R_HOST)/bin/Rscript -e "tools::write_PACKAGES('repo/src/contrib')"
$(R_HOST)/bin/Rscript -e "tools::write_PACKAGES('repo/bin/emscripten/contrib/$(R_VERSION_SHORT)', type = 'mac.binary')"
# Print Makefile variable
.PHONY: print-%
print-% : ; @echo $* = $($*)