Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com>
---
 Makefile | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 87563eb..7f18b7c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,12 @@ PKGVER != dpkg-parsechangelog -Sversion | cut -d- -f1
 PKGREL != dpkg-parsechangelog -Sversion | cut -d- -f2
 
 GITVERSION:=$(shell git rev-parse HEAD)
+BUILDDIR ?= build
 
 ARCH:=all
 
 DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
+DSC=${PACKAGE}_${PKGVER}-${PKGREL}.dsc
 
 all: ${DEB}
 
@@ -14,21 +16,29 @@ all: ${DEB}
 dinstall: ${DEB}
        dpkg -i ${DEB}
 
+${BUILDDIR}:
+       rm -rf ${BUILDDIR}
+       rsync -a src/ ${BUILDDIR}
+       rsync -a debian ${BUILDDIR}/
+       echo "git clone git://git.proxmox.com/git/pve-container\\ngit checkout 
${GITVERSION}" > build/debian/SOURCE
+
 .PHONY: deb
 deb: ${DEB}
-${DEB}:
-       rm -rf build
-       mkdir build
-       rsync -a src/ build
-       rsync -a debian/ build/debian
-       echo "git clone git://git.proxmox.com/git/pve-container\\ngit checkout 
${GITVERSION}" > build/debian/SOURCE
+${DEB}: ${BUILDDIR}
        cd build; dpkg-buildpackage -b -us -uc
        lintian ${DEB}
 
+
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d -nc
+       lintian ${DSC}
+
 .PHONY: clean
 clean:
        make -C src clean
-       rm -rf build *.deb ${PACKAGE}-*.tar.gz *.changes *.buildinfo
+       rm -rf *.deb ${PACKAGE}*.tar.gz *.changes *.buildinfo ${DSC} ${BUILDDIR}
        find . -name '*~' -exec rm {} ';'
 
 .PHONY: distclean
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to