-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
65 lines (51 loc) · 1.16 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
YARN?=yarn
YARN_FLAGS?=
CARGO?=cargo
CARGO_FLAGS?=
TRUNK?=trunk
TRUNK_FLAGS?=--config front/Trunk.toml
ifeq ($(APP_ENVIRONMENT),prod)
ENV=release
YARN_FLAGS+=--production
CARGO_FLAGS+=--release
TRUNK_FLAGS+=--release=true
else
ENV=debug
endif
.DEFAULT_GOAL := build
ifneq (,$(wildcard ./.env))
include .env
export
endif
build: api front
.PHONY: build
api:
$(CARGO) build $(CARGO_FLAGS) --package oxfeed-api
.PHONY: api
front: yarn wasm
.PHONY: front
wasm: yarn
RUST_LOG=info $(TRUNK) build $(TRUNK_FLAGS) index.html
.PHONY: wasm
yarn: front/static/lib
.PHONY: yarn
front/static/lib: front/package.json
cd front && $(YARN) $(YARN_FLAGS) install
serve: serve_api serve_front
.PHONY: server
serve_api:
$(CARGO) $(CARGO_FLAGS) run --package oxfeed-api
.PHONY: serve_api
serve_front: front
$(TRUNK) serve $(TRUNK_FLAGS) index.html
.PHONY: serve_front
check:
cargo check --package oxfeed
cargo check --package oxfeed-api
cargo check --package oxfeed-front --target wasm32-unknown-unknown
.PHONY: check
clippy:
cargo clippy --package oxfeed
cargo clippy --package oxfeed-api
cargo clippy --package oxfeed-front --target wasm32-unknown-unknown
.PHONY: clippy