From 9a75d607232c7f680220cfb51a2930eb377d46aa Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 22 May 2023 13:22:43 +0200 Subject: [PATCH] buildsys: make build-dir generation atomic Signed-off-by: Thomas Lamprecht --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bffecf1..895e06c 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,11 @@ BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION) all: $(BUILDDIR): - rm -rf $(BUILDDIR) - cp -a src $(BUILDDIR) - cp -a debian $(BUILDDIR)/ - echo "git clone git://git.proxmox.com/git/pve-guest-common.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE + rm -rf $@ $@.tmp + cp -a src $@.tmp + cp -a debian $@.tmp/ + echo "git clone git://git.proxmox.com/git/pve-guest-common.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE + mv $@.tmp $@ .PHONY: deb deb: $(DEB)