]> git.proxmox.com Git - swtpm.git/blob - GNUmakefile
c5217a611a4ec9cdb8d14904cc5eb0095ccb0ab5
[swtpm.git] / GNUmakefile
1 # NOTE: just for Proxmox packaging and called GNUmakefile to still allow direct (non-packaging) builds
2
3 include /usr/share/dpkg/default.mk
4
5 PACKAGE=swtpm
6
7 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
8 ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
9
10 GITVERSION:=$(shell git rev-parse HEAD)
11
12 DSC = $(PACKAGE)_$(DEB_VERSION).dsc
13 DEB = $(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
14 DEB_DBG = $(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
15 DEB_LIB = swtpm-libs_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
16 DEB_LIB_DBG = swtpm-libs-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
17 DEB_DEV = swtpm-dev_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
18 DEB_TOOLS = swtpm-tools_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
19 DEB_TOOLS_DBG = swtpm-tools-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
20
21 DEBS=$(DEB) $(DEB_DBG) $(DEB_LIB) $(DEB_LIB_DBG) $(DEB_DEV) $(DEB_TOOLS) $(DEB_TOOLS_DBG)
22
23 all:
24
25 $(BUILDDIR):
26 rm -rf $@ $@.tmp
27 rsync -a * $@.tmp
28 rm -f $@.tmp/GNUmakefile # just for Proxmox packaging convenience
29 echo "git clone git://git.proxmox.com/git/lxcfs.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
30 mv $@.tmp $@
31
32 .PHONY: deb
33 deb: $(DEBS)
34 $(DEB_DBG) $(DEB_LIB) $(DEB_LIB_DBG) $(DEB_DEV) $(DEB_TOOLS) $(DEB_TOOLS_DBG): $(DEB)
35 $(DEB): $(BUILDDIR)
36 cd $(BUILDDIR); dpkg-buildpackage -rfakeroot -b -us -uc
37 lintian $(DEBS)
38
39 sbuild: $(DSC)
40 sbuild $(DSC)
41
42 $(ORIG_SRC_TAR): $(BUILDDIR)
43 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
44
45 .PHONY: dsc
46 dsc:
47 $(MAKE) clean
48 $(MAKE) $(DSC)
49 lintian $(DSC)
50
51 $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
52 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
53
54 .PHONY: upload
55 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
56 upload: $(DEBS)
57 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
58
59 .PHONY: clean
60 clean:
61 rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.changes *.buildinfo *.build