forked from r-wasm/webr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (54 loc) · 1.46 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
61
62
63
64
65
66
67
68
WEBR_ROOT = $(abspath .)
WASM = $(WEBR_ROOT)/wasm
HOST = $(WEBR_ROOT)/host
TOOLS = $(WEBR_ROOT)/tools
# This is symlinked at configure-time
include $(TOOLS)/fortran.mk
EMFC_FILES = $(EMFC) $(FORTRAN_WASM_LIB)
# Build webR and install the web app in `./dist`
.PHONY: webr
webr: $(EMFC_FILES) libs
cd R && $(MAKE) && $(MAKE) install
cd src && $(MAKE)
$(EMFC_FILES):
cd $(EMFC_DIR) && $(MAKE) && $(MAKE) install
# 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: clean-wasm
cd tools/dragonegg && $(MAKE) clean
cd tools/flang && $(MAKE) clean
.PHONY: clean-wasm
clean-wasm: clean-webr
rm -rf $(WASM)
cd libs && $(MAKE) clean
.PHONY: clean-webr
clean-webr:
rm -rf $(HOST) $(WASM)/R-*
cd R && $(MAKE) clean
.PHONY: distclean
distclean: clean
rm -rf dist