-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (63 loc) · 2.01 KB
/
Copy pathMakefile
File metadata and controls
82 lines (63 loc) · 2.01 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
################################################################################
# Definitions #
################################################################################
ifeq ($(OS), Windows_NT)
EXE=.exe
else
EXE=
endif
# set FLOW_RELEASE=[1|true] or CI=true for an optimized build; otherwise,
# defaults to dev mode that builds faster but is less efficient at runtime.
ifndef FLOW_RELEASE
FLOW_RELEASE?=$(CI)
endif
ifeq ($(FLOW_RELEASE),false)
FLOW_RELEASE=
endif
ifeq ($(FLOW_RELEASE),0)
FLOW_RELEASE=
endif
FLOW_JS_IMPL?=rust-wasm
NPM?=npm
NODE?=node
YARN?=yarn
################################################################################
# Rules #
################################################################################
do-test-js: bin/flow.js
$(NODE) src/__tests__/flow_dot_js_smoke_test.js $(realpath bin/flow.js)
do-test:
./runtests.sh bin/flow$(EXE)
bin/flow$(EXE) check packages/flow-dev-tools
${MAKE} do-test-tool
./tool test
do-test-tool:
FLOW_BIN=../../bin/flow$(EXE) ${YARN} --cwd packages/flow-dev-tools test
test-tool: bin/flow$(EXE)
${MAKE} do-test-tool
test-js: bin/flow.js do-test-js
test: bin/flow$(EXE) bin/flow.js
${MAKE} do-test do-test-js
.PHONY: bin/flow.js
ifeq ($(FLOW_JS_IMPL),rust-wasm)
bin/flow.js:
FLOW_RELEASE="$(FLOW_RELEASE)" scripts/build-flow-dot-js-wasm.sh --output "$@"
else
$(error Unknown FLOW_JS_IMPL '$(FLOW_JS_IMPL)'. Expected rust-wasm)
endif
# Run `make js FLOW_RELEASE=1` to do an optimized build
js: bin/flow.js
js-rust:
${MAKE} js FLOW_JS_IMPL=rust-wasm
test-js-rust:
${MAKE} test-js FLOW_JS_IMPL=rust-wasm
dist/npm-%.tgz: FORCE
@mkdir -p $(@D)
@mkdir -p npm-$(*F)-tmp
cd npm-$(*F)-tmp && ${NPM} pack ../packages/$(*F)/
mv npm-$(*F)-tmp/$(*F)-*.tgz dist/npm-$(*F).tgz
@rm -rf npm-$(*F)-tmp
FORCE:
.PHONY: js js-rust test-js-rust FORCE