-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (27 loc) · 817 Bytes
/
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
ifdef release
export NODE_ENV = production
CARGO_ARGS = --release
TARGET = release
else
export NODE_ENV = development
PARCEL_ARGS = --no-optimize
TARGET = debug
endif
web/dist/$(TARGET): web/package.json web/index.html $(wildcard web/js/**/*) $(wildcard web/css/**/*)
rm -rf web/dist
cd web;\
yarn --production=false;\
yarn build $(PARCEL_ARGS) --dist-dir dist/$(TARGET)
backend/static/index.html: web/dist/$(TARGET)
rm -rf backend/static/**/*
cp -r web/dist/$(TARGET) backend/static
target/$(TARGET): backend/static/index.html $(wildcard backend/src/**/*) Cargo.toml
rm -rf target/$(TARGET)
cargo build $(CARGO_ARGS)
build: target/$(TARGET)
.PHONY: build
clean:
rm -rf backend/static target/$(TARGET) web/dist
clean-full: clean
rm -rf web/.parcel-cache web/node_modules
.PHONY: clean clean-full