forked from veryl-lang/veryl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (41 loc) · 1.79 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
VERSION = $(patsubst "%",%, $(word 3, $(shell grep version ./crates/veryl/Cargo.toml)))
BUILD_TIME = $(shell date +"%Y/%m/%d %H:%M:%S")
GIT_REVISION = $(shell git log -1 --format="%h")
RUST_VERSION = $(word 2, $(shell rustc -V))
LONG_VERSION = "$(VERSION) ( rev: $(GIT_REVISION), rustc: $(RUST_VERSION), build at: $(BUILD_TIME) )"
ZIP_NAME = veryl
BIN_NAMES = veryl veryl-ls
export LONG_VERSION
.PHONY: all test clean release_lnx release_win release_mac
all:
cargo build
test:
cargo test
clean:
cargo clean
release_lnx:
cargo build --locked --release --target=x86_64-unknown-linux-musl $(addprefix --bin , ${BIN_NAMES})
zip -j ${ZIP_NAME}-x86_64-linux.zip $(addprefix target/x86_64-unknown-linux-musl/release/, ${BIN_NAMES})
release_win:
cargo build --locked --release --target=x86_64-pc-windows-msvc $(addprefix --bin , ${BIN_NAMES})
mv -v $(addsuffix .exe, $(addprefix target/x86_64-pc-windows-msvc/release/, ${BIN_NAMES})) ./
7z a ${ZIP_NAME}-x86_64-windows.zip $(addsuffix .exe, ${BIN_NAMES})
release_mac:
cargo build --locked --release --target=x86_64-apple-darwin $(addprefix --bin , ${BIN_NAMES})
cargo build --locked --release --target=aarch64-apple-darwin $(addprefix --bin , ${BIN_NAMES})
zip -j ${ZIP_NAME}-x86_64-mac.zip $(addprefix target/x86_64-apple-darwin/release/, ${BIN_NAMES})
zip -j ${ZIP_NAME}-aarch64-mac.zip $(addprefix target/aarch64-apple-darwin/release/, ${BIN_NAMES})
release_rpm:
mkdir -p target
cargo rpm build
cp target/x86_64-unknown-linux-musl/release/rpmbuild/RPMS/x86_64/* ./
watch:
cargo watch -i crates/parser/src/generated -x test -x bench
install:
cargo install --path crates/languageserver
cargo install --path crates/veryl
cargo install --path crates/mdbook
gen_sv:
cargo run --bin veryl -- build
flamegraph:
cargo bench --bench benchmark -- --profile-time=5