]> git.proxmox.com Git - vncterm.git/commitdiff
buildsys: make build-dir generation atomic
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 29 May 2023 15:49:38 +0000 (17:49 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 29 May 2023 15:56:10 +0000 (17:56 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile

index 47ad5c1545b1aa5f2fce654f3cb2b520aec5d690..1740b81dc4fbbeae6a9f9ec0abfc7a0ece0db4dd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@ include /usr/share/dpkg/pkg-info.mk
 include /usr/share/dpkg/architecture.mk
 
 PACKAGE=vncterm
+BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
 GITVERSION:=$(shell cat .git/refs/heads/master)
 
 VNCVER=0.9.14
@@ -58,13 +59,16 @@ vncterm.1: vncterm.pod
        rm -f $@
        pod2man -n $< -s 1 -r $(DEB_VERSION_UPSTREAM) <$< >$@
 
+$(BUILDDIR):
+       rm -rf $@ $@.tmp
+       rsync -a . $@.tmp
+       echo "git clone git://git.proxmox.com/git/vncterm.git\\ngit checkout $(GIVERSION)" > $@.tmp/debian/SOURCE
+       mv $@.tmp $@
+
 .PHONY: deb
 deb: $(DEB)
-$(DEB):
-       $(MAKE) clean
-       rsync -a . --exclude build build
-       echo "git clone git://git.proxmox.com/git/vncterm.git\\ngit checkout $(GIVERSION)" > build/debian/SOURCE
-       cd build; dpkg-buildpackage -rfakeroot -b -us -uc
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -rfakeroot -b -us -uc
        lintian $(DEB)
 
 .PHONY: upload