From 7a676f970837ee1b7ff08c244378c066a7976e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 24 May 2023 15:09:11 +0200 Subject: [PATCH] build: makefile improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- Makefile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 6452a8b..6c9dc10 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +include /usr/share/dpkg/default.mk + +PACKAGE := proxmox-websocket-tunnel +ARCH := $(DEB_BUILD_ARCH) + .PHONY: all all: check @@ -18,22 +23,22 @@ build: --config "$(PWD)/debian/debcargo.toml" \ --changelog-ready \ --no-overlay-write-back \ - --directory "$(PWD)/build/proxmox-websocket-tunnel" \ - "proxmox-websocket-tunnel" \ + --directory "$(PWD)/build/$(PACKAGE)" \ + "$(PACKAGE)" \ "$$(dpkg-parsechangelog -l "debian/changelog" -SVersion | sed -e 's/-.*//')" echo system >build/rust-toolchain - rm -f build/proxmox-websocket-tunnel/Cargo.lock - find build/proxmox-websocket-tunnel/debian -name '*.hint' -delete - cp build/proxmox-websocket-tunnel/debian/control debian/control + rm -f build/$(PACKAGE)/Cargo.lock + find build/$(PACKAGE)/debian -name '*.hint' -delete + cp build/$(PACKAGE)/debian/control debian/control .PHONY: dsc dsc: build - (cd build/proxmox-websocket-tunnel && dpkg-buildpackage -S -uc -us) + (cd build/$(PACKAGE) && dpkg-buildpackage -S -uc -us) lintian build/*.dsc .PHONY: deb deb: build - (cd build/proxmox-websocket-tunnel && dpkg-buildpackage -b -uc -us) + (cd build/$(PACKAGE) && dpkg-buildpackage -b -uc -us) lintian build/*.deb .PHONY: clean @@ -41,9 +46,11 @@ clean: rm -rf build *.deb *.buildinfo *.changes *.orig.tar.gz cargo clean +.PHONY: upload +upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) upload: deb cd build; \ - dcmd --deb rust-proxmox-websocket-tunnel_*.changes \ + dcmd --deb rust-$(PACKAGE)_*.changes \ | grep -v '.changes$$' \ | tar -cf- -T- \ - | ssh -X repoman@repo.proxmox.com upload --product pve --dist bullseye + | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)