]> git.proxmox.com Git - proxmox.git/blobdiff - Makefile
proxmox-acme: derive PartialEq for API types
[proxmox.git] / Makefile
index 626b5727e83af86ffd8d0ecb2c189e13dcc27a07..6edca1021abf3367aa592319f7e3ef1c181d1082 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Shortcut for common operations:
 
-CRATES=proxmox proxmox-api-macro proxmox-sortable-macro
+CRATES != /usr/bin/cargo metadata --no-deps --format-version=1 | jq -r .workspace_members'[]' | awk '{ print $$1 }'
 
 # By default we just run checks:
 .PHONY: all
@@ -11,17 +11,34 @@ deb: $(foreach c,$(CRATES), $c-deb)
        echo $(foreach c,$(CRATES), $c-deb)
        lintian build/*.deb
 
+.PHONY: dsc
+dsc: $(foreach c,$(CRATES), $c-dsc)
+       echo $(foreach c,$(CRATES), $c-dsc)
+       lintian build/*.dsc
+
+.PHONY: autopkgtest
+autopkgtest: $(foreach c,$(CRATES), $c-autopkgtest)
+
 .PHONY: dinstall
-dinstall: deb
+dinstall:
+       $(MAKE) clean
+       $(MAKE) deb
        sudo -k dpkg -i build/librust-*.deb
 
 %-deb:
        ./build.sh $*
        touch $@
 
+%-dsc:
+       BUILDCMD='dpkg-buildpackage -S -us -uc -d' ./build.sh $*
+       touch $@
+
+%-autopkgtest:
+       autopkgtest build/$* build/*.deb -- null
+       touch $@
+
 .PHONY: check
 check:
-       cargo +nightly fmt -- --check
        cargo test
 
 # Run the api-test server, serving the api-test/www/ subdir as 'www' dir over
@@ -32,13 +49,8 @@ apitest:
 
 # 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
+       cargo +nightly fmt -- --check
 
 # Doc without dependencies
 .PHONY: doc
@@ -48,8 +60,16 @@ doc:
 .PHONY: clean
 clean:
        cargo clean
-       rm -rf build *-deb
+       rm -rf build/
+       rm -f -- *-deb *-dsc *-autopkgtest *.build *.buildinfo *.changes
 
 .PHONY: update
 update:
        cargo update
+
+%-upload: %-deb
+       cd build; \
+           dcmd --deb rust-$*_*.changes \
+           | grep -v '.changes$$' \
+           | tar -cf "$@.tar" -T-; \
+           cat "$@.tar" | ssh -X repoman@repo.proxmox.com upload --product devel --dist bookworm