forked from tuna-f1sh/cyme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (21 loc) · 928 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
PROJECT_NAME := $(shell grep -m 1 name Cargo.toml | cut -d '"' -f 2)
CARGO_TARGET_DIR ?= target
RELEASE_BIN = $(CARGO_TARGET_DIR)/release/$(PROJECT_NAME)
VERSION := $(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
RSRCS += $(wildcard src/*.rs src/**/*.rs)
DOCS = doc/_$(PROJECT_NAME) doc/$(PROJECT_NAME).1 doc/$(PROJECT_NAME).bash doc/cyme_example_config.json
.PHONY: bump version release enter_version new_version
release: $(RELEASE_BIN)
generated: $(DOCS)
enter_version:
@echo "Current version: $(VERSION)"
@echo "Enter new version: "
@read new_version; \
sed -i "s/^version = .*/version = \"$$new_version\"/" Cargo.toml
new_version: enter_version generated
$(RELEASE_BIN): $(RSRCS)
@echo "Building version $(PROJECT_NAME) $(VERSION)"
cargo build --release
$(DOCS): Cargo.toml $(RSRCS)
@echo "Generating docs for $(PROJECT_NAME) $(VERSION)"
cargo run --all-features -- --gen