-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (27 loc) · 874 Bytes
/
Makefile
File metadata and controls
33 lines (27 loc) · 874 Bytes
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
VERSION := $(shell grep '^version' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
TARGET_DIR := ./target
BINARY_NAME := vex
TARGETS := \
x86_64-unknown-linux-gnu \
install:
rustup target add $(TARGETS)
build:
@for target in $(TARGETS); do \
cargo build --target $$target --release; \
done
package:
@for target in $(TARGETS); do \
target_dir="$(TARGET_DIR)/$$target/release"; \
output_name="$(BINARY_NAME)"; \
formatted_target=$$(echo $$target | sed 's/-unknown//'); \
if echo $$target | grep -q "windows"; then \
cp "$$target_dir/$$output_name.exe" .; \
zip $(BINARY_NAME)-v$(VERSION)-$$formatted_target.zip $$output_name.exe; \
rm $$output_name.exe; \
else \
tar -czvf $(BINARY_NAME)-v$(VERSION)-$$formatted_target.tar.gz -C "$$target_dir" $$output_name; \
fi; \
done
release: build package
clean:
rm -rf $(TARGET_DIR) *.zip *.tar.gz