-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
115 lines (96 loc) · 3.33 KB
/
Copy pathMakefile
File metadata and controls
115 lines (96 loc) · 3.33 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
ENGINE := engine
APPS := apps/basic_app apps/impact_game apps/snapshot_tester apps/voxel_generator
ENGINE_MANIFEST := $(ENGINE)/Cargo.toml
APP_MANIFESTS := $(foreach app,$(APPS),$(app)/Cargo.toml)
APP_SUB_MANIFESTS := $(foreach app,$(APPS),\
$(app)/cli/Cargo.toml \
$(app)/roc_platform/Cargo.toml \
$(app)/tools/generate_roc/Cargo.toml)
FUZZ_MANIFESTS := \
engine/crates/impact_intersection/fuzz/Cargo.toml \
engine/crates/impact_voxel/fuzz/Cargo.toml
EXTRA_MANIFESTS := \
roc_platform/core/Cargo.toml \
roc_integration/Cargo.toml \
interop/dynamic_lib/Cargo.toml \
interop/hashing/Cargo.toml \
tools/asset_fetcher/Cargo.toml
ALL_MANIFESTS := \
$(ENGINE_MANIFEST) \
$(APP_MANIFESTS) \
$(APP_SUB_MANIFESTS) \
$(EXTRA_MANIFESTS) \
$(FUZZ_MANIFESTS)
DENY_MANIFESTS := \
$(ENGINE_MANIFEST) \
$(APP_MANIFESTS) \
roc_integration/Cargo.toml \
tools/asset_fetcher/Cargo.toml
.DEFAULT_GOAL := help
.PHONY: fmt clippy test deny udeps outdated update clean generate-roc help
fmt:
@for manifest in $(ALL_MANIFESTS); do \
echo "=== fmt: $$manifest ==="; \
cargo fmt --manifest-path $$manifest --all; \
done
clippy:
@for manifest in $(ALL_MANIFESTS); do \
echo "=== clippy: $$manifest ==="; \
cargo clippy --quiet --manifest-path $$manifest --workspace --all-targets --all-features; \
done
test:
@for manifest in $(ALL_MANIFESTS); do \
echo "=== test: $$manifest ==="; \
RUSTFLAGS="-Awarnings" cargo test --quiet --manifest-path $$manifest --workspace --all-features; \
done
deny:
@for manifest in $(DENY_MANIFESTS); do \
echo "=== deny: $$manifest ==="; \
cargo deny --manifest-path $$manifest --workspace --all-features check || true; \
done
udeps:
@for manifest in $(ALL_MANIFESTS); do \
echo "=== udeps: $$manifest ==="; \
RUSTFLAGS="-Awarnings" cargo +nightly udeps --quiet --manifest-path $$manifest --workspace --all-targets || true; \
done
outdated:
@for manifest in $(ALL_MANIFESTS); do \
echo "=== outdated: $$manifest ==="; \
cargo outdated --manifest-path $$manifest --workspace --depth 1 || true; \
done
update:
cargo update --manifest-path $(ENGINE_MANIFEST)
@for app in $(APPS); do \
$(MAKE) -C $$app cargo-update; \
done
@for manifest in $(EXTRA_MANIFESTS) $(FUZZ_MANIFESTS); do \
cargo update --manifest-path $$manifest; \
done
clean:
cargo clean --manifest-path $(ENGINE_MANIFEST)
@for app in $(APPS); do \
$(MAKE) -C $$app cargo-clean clean; \
done
@for manifest in $(EXTRA_MANIFESTS); do \
cargo clean --manifest-path $$manifest; \
done
@for manifest in $(FUZZ_MANIFESTS); do \
cargo clean --manifest-path $$manifest; \
done
generate-roc:
@for app in $(APPS); do \
$(MAKE) -C $$app generate-roc; \
done
help:
@echo "Top-level Makefile"
@echo ""
@echo "Targets:"
@echo " fmt - Format all Rust code with cargo fmt"
@echo " clippy - Lint all Rust code with cargo clippy"
@echo " test - Run tests across all workspaces"
@echo " deny - Check dependencies with cargo-deny"
@echo " udeps - Check for unused dependencies (nightly + cargo-udeps)"
@echo " outdated - Check for outdated dependencies (cargo-outdated)"
@echo " update - Update all Cargo.lock files"
@echo " clean - Remove all Cargo build artifacts"
@echo " generate-roc - Generate Roc code for all apps"