]> git.proxmox.com Git - proxmox-mini-journalreader.git/commitdiff
buildsys: do not hardcode build directory name
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 14 May 2019 09:16:32 +0000 (09:16 +0000)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 14 May 2019 12:01:47 +0000 (12:01 +0000)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile

index 0530f329d6106219c52adc89d8a7f75466d637e7..d15e11aa6e86ba091e88a201852fa2ff3a114459 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,18 +5,21 @@ PACKAGE := proxmox-mini-journalreader
 
 GITVERSION:=$(shell git rev-parse HEAD)
 
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
+
 DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
 
 all: $(DEB)
 
+$(BUILDDIR): src debian
+       rm -rf $(BUILDDIR)
+       rsync -a src/ debian $(BUILDDIR)
+       echo "git clone git://git.proxmox.com/git/proxmox-mini-journal\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE
+
 .PHONY: deb
 deb: $(DEB)
-$(DEB):
-       rm -rf build
-       rsync -a ./src/* build/
-       rsync -a ./debian build/
-       echo "git clone git://git.proxmox.com/git/pve-journalreader.git\\ngit checkout $(GITVERSION)" > build/debian/SOURCE
-       cd build; dpkg-buildpackage -b -us -uc
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
        lintian $(DEB)
 
 dinstall: $(DEB)
@@ -24,4 +27,4 @@ dinstall: $(DEB)
 
 .PHONY: clean
 clean:
-       rm -rf build/ *.deb *.buildinfo *.changes
+       rm -rf $(BUILDDIR) *.deb *.buildinfo *.changes