buildsys: make build-dir generation atomic
and factor it out to own target Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
18
Makefile
18
Makefile
@ -1,6 +1,7 @@
|
|||||||
include /usr/share/dpkg/pkg-info.mk
|
include /usr/share/dpkg/pkg-info.mk
|
||||||
|
|
||||||
PACKAGE=libpve-storage-perl
|
PACKAGE=libpve-storage-perl
|
||||||
|
BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
|
||||||
|
|
||||||
GITVERSION:=$(shell git rev-parse HEAD)
|
GITVERSION:=$(shell git rev-parse HEAD)
|
||||||
|
|
||||||
@ -12,20 +13,23 @@ all:
|
|||||||
dinstall: deb
|
dinstall: deb
|
||||||
dpkg -i $(DEB)
|
dpkg -i $(DEB)
|
||||||
|
|
||||||
|
$(BUILDDIR):
|
||||||
|
rm -rf $@ $@.tmp
|
||||||
|
cp -a src $@.tmp
|
||||||
|
cp -a debian $@.tmp/
|
||||||
|
echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout $(GITVERSION)" >$@.tmp/debian/SOURCE
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
.PHONY: deb
|
.PHONY: deb
|
||||||
deb: $(DEB)
|
deb: $(DEB)
|
||||||
$(DEB):
|
$(DEB): $(BUILDDIR)
|
||||||
rm -rf build
|
cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
|
||||||
cp -a src build
|
|
||||||
cp -a debian build/
|
|
||||||
echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout $(GITVERSION)" >build/debian/SOURCE
|
|
||||||
cd build; dpkg-buildpackage -b -us -uc
|
|
||||||
lintian $(DEB)
|
lintian $(DEB)
|
||||||
|
|
||||||
.PHONY: clean distclean
|
.PHONY: clean distclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf build *.deb *.buildinfo *.changes
|
rm -rf $(PACKAGE)-[0-9]*/ *.deb *.dsc *.build *.buildinfo *.changes $(PACKAGE)*.tar.*
|
||||||
|
|
||||||
.PHONY: upload
|
.PHONY: upload
|
||||||
upload: $(DEB)
|
upload: $(DEB)
|
||||||
|
|||||||
Reference in New Issue
Block a user