2019-06-18 17:49:40 +02:00
# Shortcut for common operations:
2024-06-19 16:00:04 +02:00
# see proxmox-backup if we ever want to support other prefixes
CRATES != echo proxmox-*/Cargo.toml | sed -e 's|/Cargo.toml||g'
2020-01-15 08:05:49 +01:00
2019-06-18 17:49:40 +02:00
# By default we just run checks:
.PHONY : all
all : check
2020-01-15 08:05:49 +01:00
.PHONY : deb
deb : $( foreach c ,$ ( CRATES ) , $ c -deb )
echo $( foreach c,$( CRATES) , $c -deb)
lintian build/*.deb
2023-05-23 10:44:18 +02:00
.PHONY : dsc
dsc : $( foreach c ,$ ( CRATES ) , $ c -dsc )
echo $( foreach c,$( CRATES) , $c -dsc)
lintian build/*.dsc
2021-01-14 14:23:45 +01:00
.PHONY : autopkgtest
autopkgtest : $( foreach c ,$ ( CRATES ) , $ c -autopkgtest )
2020-01-21 11:28:15 +01:00
.PHONY : dinstall
2020-01-21 12:30:13 +01:00
dinstall :
$( MAKE) clean
$( MAKE) deb
2020-01-21 11:56:56 +01:00
sudo -k dpkg -i build/librust-*.deb
2020-01-21 11:28:15 +01:00
2020-01-15 08:05:49 +01:00
%-deb :
./build.sh $*
touch $@
2023-05-23 10:44:18 +02:00
%-dsc :
BUILDCMD = 'dpkg-buildpackage -S -us -uc -d' ./build.sh $*
touch $@
2021-01-14 14:23:45 +01:00
%-autopkgtest :
autopkgtest build/$* build/*.deb -- null
touch $@
2019-06-18 17:49:40 +02:00
.PHONY : check
check :
cargo test
2019-06-18 17:52:29 +02:00
# Run the api-test server, serving the api-test/www/ subdir as 'www' dir over
# http:
.PHONY : apitest
apitest :
cargo run -p api-test -- api-test/www/
2019-06-18 17:49:40 +02:00
# Prints a diff between the current code and the one rustfmt would produce
.PHONY : fmt
fmt :
2020-03-16 12:21:14 +01:00
cargo +nightly fmt -- --check
2019-06-18 17:49:40 +02:00
# Doc without dependencies
.PHONY : doc
doc :
cargo doc --no-deps
.PHONY : clean
clean :
cargo clean
2023-05-23 10:46:08 +02:00
rm -rf build/
2023-06-04 18:27:46 +02:00
rm -f -- *-deb *-dsc *-autopkgtest *.build *.buildinfo *.changes
2019-06-18 17:49:40 +02:00
.PHONY : update
update :
cargo update
2020-03-03 11:50:28 +01:00
%-upload : %-deb
cd build; \
dcmd --deb rust-$* _*.changes \
| grep -v '.changes$$' \
2021-05-14 12:08:50 +02:00
| tar -cf " $@ .tar " -T-; \
2023-05-23 11:27:56 +02:00
cat " $@ .tar " | ssh -X repoman@repo.proxmox.com upload --product devel --dist bookworm