2019-06-18 18:49:40 +03:00
# Shortcut for common operations:
2020-01-21 13:56:56 +03:00
CRATES = proxmox proxmox-api-macro proxmox-sortable-macro
2020-01-15 10:05:49 +03:00
2019-06-18 18:49:40 +03:00
# By default we just run checks:
.PHONY : all
all : check
2020-01-15 10:05:49 +03:00
.PHONY : deb
deb : $( foreach c ,$ ( CRATES ) , $ c -deb )
echo $( foreach c,$( CRATES) , $c -deb)
lintian build/*.deb
2020-01-21 13:28:15 +03:00
.PHONY : dinstall
2020-01-21 14:30:13 +03:00
dinstall :
$( MAKE) clean
$( MAKE) deb
2020-01-21 13:56:56 +03:00
sudo -k dpkg -i build/librust-*.deb
2020-01-21 13:28:15 +03:00
2020-01-15 10:05:49 +03:00
%-deb :
./build.sh $*
touch $@
2019-06-18 18:49:40 +03:00
.PHONY : check
check :
2020-01-16 12:41:08 +03:00
cargo +nightly fmt -- --check
2019-06-18 18:49:40 +03:00
cargo test
2019-06-18 18:52:29 +03: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 18:49:40 +03:00
# Prints a diff between the current code and the one rustfmt would produce
.PHONY : fmt
checkfmt :
cargo fmt --all -- --check
# Reformat the code (ppply the output of `make checkfmt`)
.PHONY : fmt
fmt :
cargo fmt --all
# Doc without dependencies
.PHONY : doc
doc :
cargo doc --no-deps
.PHONY : clean
clean :
cargo clean
2020-01-15 10:05:49 +03:00
rm -rf build *-deb
2019-06-18 18:49:40 +03:00
.PHONY : update
update :
cargo update
2020-03-03 13:50:28 +03:00
%-upload : %-deb
cd build; \
dcmd --deb rust-$* _*.changes \
| grep -v '.changes$$' \
| tar -cf- -T- \
| ssh -X repoman@repo.proxmox.com upload --product devel --dist buster