-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
88 lines (72 loc) · 1.44 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# This basic Makefile should be compatible with both BSD and GNU make.
BINARY= s3du
CARGO= cargo
MANDOC= mandoc
MAN_DIR= man
MAN_SECTION= 1
TARGET_DIR= target
DEBUG_BUILD= $(TARGET_DIR)/debug/$(BINARY)
DOC_BUILD= $(TARGET_DIR)/doc/$(BINARY)
RELEASE_BUILD= $(TARGET_DIR)/release/$(BINARY)
# Build debug binary
$(DEBUG_BUILD):
$(CARGO) build
# Generate docs
$(DOC_BUILD):
$(CARGO) doc --no-deps
# Build release binary
$(RELEASE_BUILD):
$(CARGO) build --release
# Build debug binary
.PHONY: build
build: $(DEBUG_BUILD)
# Clean everything
.PHONY: clean
clean:
$(CARGO) clean
# Clean only docs
.PHONY: cleandoc
cleandoc:
$(CARGO) clean --doc
# Build debug binary
.PHONY: debug
debug: $(DEBUG_BUILD)
# Generate docs
.PHONY: doc
doc: $(DOC_BUILD)
# Lint the man page
.PHONY: manlint
manlint:
$(MANDOC) \
-T lint \
$(MAN_DIR)/$(BINARY).$(MAN_SECTION)
# List outdated crates
.PHONY: outdated
outdated:
$(CARGO) outdated
# Build release binary
.PHONY: release
release: $(RELEASE_BUILD)
# Run all tests
.PHONY: test
test:
$(CARGO) test
# Run individual feature tests before main test.
.PHONY: test_all
test_all: test test_cloudwatch test_s3
# Test CloudWatch feature alone
.PHONY: test_cloudwatch
test_cloudwatch:
$(CARGO) test \
--no-default-features \
--features="cloudwatch"
# Test S3 feature alone
.PHONY: test_s3
test_s3:
$(CARGO) test \
--no-default-features \
--features="s3"
# Update Cargo.lock
.PHONY: update
update:
$(CARGO) update