]>
Commit | Line | Data |
---|---|---|
1 | # Shortcut for common operations: | |
2 | ||
3 | CRATES != cargo metadata --no-deps --format-version=1 | jq -r .workspace_members'[]' | awk '{ print $$1 }' | |
4 | ||
5 | # By default we just run checks: | |
6 | .PHONY: all | |
7 | all: check | |
8 | ||
9 | .PHONY: deb | |
10 | deb: $(foreach c,$(CRATES), $c-deb) | |
11 | echo $(foreach c,$(CRATES), $c-deb) | |
12 | lintian build/*.deb | |
13 | ||
14 | .PHONY: dsc | |
15 | dsc: $(foreach c,$(CRATES), $c-dsc) | |
16 | echo $(foreach c,$(CRATES), $c-dsc) | |
17 | lintian build/*.dsc | |
18 | ||
19 | .PHONY: autopkgtest | |
20 | autopkgtest: $(foreach c,$(CRATES), $c-autopkgtest) | |
21 | ||
22 | .PHONY: dinstall | |
23 | dinstall: | |
24 | $(MAKE) clean | |
25 | $(MAKE) deb | |
26 | sudo -k dpkg -i build/librust-*.deb | |
27 | ||
28 | %-deb: | |
29 | ./build.sh $* | |
30 | touch $@ | |
31 | ||
32 | %-dsc: | |
33 | BUILDCMD='dpkg-buildpackage -S -us -uc -d' ./build.sh $* | |
34 | touch $@ | |
35 | ||
36 | %-autopkgtest: | |
37 | autopkgtest build/$* build/*.deb -- null | |
38 | touch $@ | |
39 | ||
40 | .PHONY: check | |
41 | check: | |
42 | cargo test | |
43 | ||
44 | # Run the api-test server, serving the api-test/www/ subdir as 'www' dir over | |
45 | # http: | |
46 | .PHONY: apitest | |
47 | apitest: | |
48 | cargo run -p api-test -- api-test/www/ | |
49 | ||
50 | # Prints a diff between the current code and the one rustfmt would produce | |
51 | .PHONY: fmt | |
52 | fmt: | |
53 | cargo +nightly fmt -- --check | |
54 | ||
55 | # Doc without dependencies | |
56 | .PHONY: doc | |
57 | doc: | |
58 | cargo doc --no-deps | |
59 | ||
60 | .PHONY: clean | |
61 | clean: | |
62 | cargo clean | |
63 | rm -rf build/ | |
64 | rm -f -- *-deb *-dsc *-autopkgtest *.build *.buildinfo *.changes | |
65 | ||
66 | .PHONY: update | |
67 | update: | |
68 | cargo update | |
69 | ||
70 | %-upload: %-deb | |
71 | cd build; \ | |
72 | dcmd --deb rust-$*_*.changes \ | |
73 | | grep -v '.changes$$' \ | |
74 | | tar -cf "$@.tar" -T-; \ | |
75 | cat "$@.tar" | ssh -X repoman@repo.proxmox.com upload --product devel --dist bookworm |