cleanup makefiles, set target dirs per makefile
[pve-firewall.git] / Makefile
CommitLineData
29a94c79 1VERSION=3.0
d8ea08e3 2PKGREL=18
bb272dd3
DM
3
4PACKAGE=pve-firewall
5
43be6155 6BUILDDIR ?= ${PACKAGE}-${VERSION}
bb272dd3 7
43e33825 8ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
4382be0a 9GITVERSION:=$(shell git rev-parse HEAD)
bb272dd3
DM
10
11DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
05018f6e
WB
12DEB2=${PACKAGE}-dbgsym_${VERSION}-${PKGREL}_${ARCH}.deb
13DEBS=$(DEB) $(DEB2)
bb272dd3 14
05018f6e 15all: $(DEBS)
bb272dd3
DM
16
17.PHONY: dinstall
18dinstall: deb
05018f6e 19 dpkg -i $(DEBS)
bb272dd3 20
43be6155
TL
21${BUILDDIR}:
22 rm -rf ${BUILDDIR}
23 rsync -a src/ debian ${BUILDDIR}
24 echo "git clone git://git.proxmox.com/git/pve-firewall.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
bb272dd3
DM
25
26.PHONY: deb
05018f6e
WB
27deb: $(DEBS)
28$(DEB2): $(DEB)
43be6155
TL
29$(DEB): ${BUILDDIR} check
30 cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
05018f6e 31 lintian ${DEBS}
bb272dd3 32
ebb20753 33.PHONY: check
43be6155 34check:
ebb20753
DM
35 make -C test check
36
43be6155
TL
37.PHONY: clean distclean
38distclean: clean
39clean:
3f665549 40 make -C src clean
ebb20753 41 make -C test clean
43be6155 42 rm -rf *~ debian/*~ example/*~ *.deb *.changes *.buildinfo ${BUILDDIR} ${PACKAGE}-*.tar.gz
bb272dd3
DM
43
44.PHONY: upload
05018f6e
WB
45upload: $(DEBS)
46 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}