-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
65 lines (51 loc) · 2.74 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
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 lint release_lnx release_win release_mac
all:
cargo build
test:
cargo test
clean:
cargo clean
lint:
cargo fmt --check
cargo clippy -- -D warnings
release_lnx:
cargo build --locked --release --target=x86_64-unknown-linux-musl $(addprefix --bin , ${BIN_NAMES})
cargo build --locked --release --target=x86_64-unknown-linux-musl --manifest-path ./support/sourcemap-resolver/Cargo.toml
zip -j ${ZIP_NAME}-x86_64-linux.zip $(addprefix target/x86_64-unknown-linux-musl/release/, ${BIN_NAMES}) \
./support/sourcemap-resolver/target/x86_64-unknown-linux-musl/release/sourcemap-resolver
release_win:
cargo build --locked --release --target=x86_64-pc-windows-msvc $(addprefix --bin , ${BIN_NAMES})
cargo build --locked --release --target=x86_64-pc-windows-msvc --manifest-path ./support/sourcemap-resolver/Cargo.toml
mv -v $(addsuffix .exe, $(addprefix target/x86_64-pc-windows-msvc/release/, ${BIN_NAMES})) ./
mv -v ./support/sourcemap-resolver/target/x86_64-pc-windows-msvc/release/sourcemap-resolver.exe ./
7z a ${ZIP_NAME}-x86_64-windows.zip $(addsuffix .exe, ${BIN_NAMES}) sourcemap-resolver.exe
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})
cargo build --locked --release --target=x86_64-apple-darwin --manifest-path ./support/sourcemap-resolver/Cargo.toml
cargo build --locked --release --target=aarch64-apple-darwin --manifest-path ./support/sourcemap-resolver/Cargo.toml
zip -j ${ZIP_NAME}-x86_64-mac.zip $(addprefix target/x86_64-apple-darwin/release/, ${BIN_NAMES}) \
./support/sourcemap-resolver/target/x86_64-apple-darwin/release/sourcemap-resolver
zip -j ${ZIP_NAME}-aarch64-mac.zip $(addprefix target/aarch64-apple-darwin/release/, ${BIN_NAMES}) \
./support/sourcemap-resolver/target/aarch64-apple-darwin/release/sourcemap-resolver
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:
verylup install local
cargo install --path crates/mdbook
gen_sv:
cargo run --bin veryl -- build
flamegraph:
cargo bench --bench benchmark -- --profile-time=5