-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (47 loc) · 1.56 KB
/
Copy pathMakefile
File metadata and controls
58 lines (47 loc) · 1.56 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
# Build ember (Rust) and, on macOS, ember-vz (Swift).
# Places both binaries side-by-side in target/{debug,release}/ so ember
# can find ember-vz at runtime.
UNAME := $(shell uname -s)
# Which workspace members to check, lint, and test.
#
# `default-members = ["."]` in Cargo.toml means a bare `cargo test` only
# covers the root package, so the unit tests in ember-core and the
# platform crate never run. `--workspace` is not the fix: it selects the
# other platform's backend too, and that backend does not compile here
# (ember-macos needs `clonefile`, ember-linux's image tests need
# `mkfs.ext4`). Naming the packages is what actually works.
ifeq ($(UNAME),Darwin)
PACKAGES := -p ember -p ember-core -p ember-macos
else
PACKAGES := -p ember -p ember-core -p ember-linux
endif
.PHONY: build release clean fmt check clippy test udeps
build:
cargo build
ifeq ($(UNAME),Darwin)
cd ember-vz && swift build
codesign --force --sign - --entitlements ember-vz/entitlements.plist ember-vz/.build/debug/ember-vz
cp ember-vz/.build/debug/ember-vz target/debug/
endif
release:
cargo build --release
ifeq ($(UNAME),Darwin)
cd ember-vz && swift build -c release
codesign --force --sign - --entitlements ember-vz/entitlements.plist ember-vz/.build/release/ember-vz
cp ember-vz/.build/release/ember-vz target/release/
endif
clean:
cargo clean
ifeq ($(UNAME),Darwin)
cd ember-vz && swift package clean
endif
fmt:
cargo fmt
check:
cargo check --all-targets $(PACKAGES)
clippy:
cargo clippy --all-targets $(PACKAGES) -- -D warnings
test:
cargo test $(PACKAGES)
udeps:
cargo machete