forked from r-wasm/webr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (48 loc) · 1.28 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
56
57
58
59
60
WEBR_ROOT = $(abspath .)
WASM = $(WEBR_ROOT)/wasm
HOST = $(WEBR_ROOT)/host
TOOLS = $(WEBR_ROOT)/tools
default: webr
# This is created at configure-time
include $(TOOLS)/fortran.mk
# Build webR and install the web app in `./dist`
.PHONY: webr
webr: $(EMFC) $(FORTRAN_WASM_LIB) libs
cd R && $(MAKE) && $(MAKE) install
cd src && $(MAKE)
# Supporting libs for webr
.PHONY: libs
libs:
cd libs && $(MAKE)
# Build webR in a temporary docker container
.PHONY: docker-webr
docker-webr:
mkdir -p dist
docker build -t webr-build .
docker run --rm --mount type=bind,source=$(PWD),target=/app webr-build
# Create a permanent docker container for building webR. Call `make`
# from within the container to start the build.
.PHONY: docker-container-%
docker-container-%:
docker build -t webr-build .
docker run -dit --name $* --mount type=bind,source=$(PWD),target=/app webr-build bash
docs: docs/build
docs/build:
cd docs && $(MAKE) api && $(MAKE) html
.PHONY: check
check:
cd src && $(MAKE) check
.PHONY: check-pr
check-pr:
cd src && $(MAKE) lint && $(MAKE) check && $(MAKE) check-packages
.PHONY: clean
clean:
rm -rf $(HOST) $(WASM)/R-*
cd R && $(MAKE) clean
.PHONY: clean-wasm
clean-wasm: clean
rm -rf $(WASM)
cd libs && $(MAKE) clean
.PHONY: distclean
distclean: clean-wasm clean-tools
rm -rf dist