-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (58 loc) · 2.05 KB
/
Makefile
File metadata and controls
78 lines (58 loc) · 2.05 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
SHELL:=bash
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
default: help
.PHONY: help
help: ## Show this help.
@clear
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[0;33m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@echo ""
##@ Build sds-go
.PHONY: build-sds-go
build-sds-go: ## Build the sds-go lib.
@echo "Building sds-go lib"
cargo build --manifest-path="sds/Cargo.toml" --release --features dd_sds_go
##@ Formatting
.PHONY: format-go
format-go: ## Format the golang lib.
@echo "Formatting golang lib"
# Only the sds-go folder needs to be checked since generation-checks takes care of the generated code
$(shell gofmt -s -w sds-go/go && git diff --exit-code)
.PHONY: format-rust
format-rust: ## Format the rust lib.
@echo "Formatting rust lib"
cargo fmt --manifest-path="sds/Cargo.toml" --all
.PHONY: format-all
format-all: format-rust format-go ## Format the rust lib and golang libs.
##@ Testing
.PHONY: test-go
test-go: ## Test the golang lib.
@echo "Testing golang lib"
cd sds-go/go && go test ./...
.PHONY: test-rust
test-rust: ## Test the rust lib.
@echo "Testing rust lib"
cargo test --manifest-path="sds/Cargo.toml"
cargo test --manifest-path="sds/Cargo.toml" --features dd_sds_go
.PHONY: test-all
test-all: test-rust test-go ## Test the rust lib and golang libs.
.PHONY: test
test: test-all ## Alias for test-all
##@ Checks (format + test)
.PHONY: check-go
check-go: ## Check the golang lib.
@echo "Checking golang lib"
make format-go
make test-go
.PHONY: check-rust
check-rust: ## Check the rust lib.
@echo "Checking rust lib"
bash ./scripts/rust_checks.sh
##@ Licenses generation
.PHONY: update-licenses
update-licenses: ## Generate licenses for the project.
@echo "Updating licenses"
bash ./scripts/generate_license_3rdparty.sh
.PHONY: check-licenses
check-licenses: ## Check licenses for the project.
@echo "Checking licenses"
bash ./scripts/generate_license_3rdparty.sh check