]> git.proxmox.com Git - pve-edk2-firmware.git/blob - Makefile
buildsys: derive upload dist automatically
[pve-edk2-firmware.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=pve-edk2-firmware
4
5 SRCDIR=edk2
6 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
7 ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
8
9 GITVERSION:=$(shell git rev-parse HEAD)
10
11 DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb
12 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
13
14 all: $(DEB)
15 @echo $(DEB)
16
17 $(BUILDDIR): $(SRCDIR)/Readme.md
18 rm -rf $(BUILDDIR)
19 cp -rpa $(SRCDIR) $(BUILDDIR)
20 cp -a debian $(BUILDDIR)
21 echo "git clone git://git.proxmox.com/git/pve-edk2-firmware.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE
22
23 .PHONY: deb
24 deb: $(DEB)
25 $(DEB): $(BUILDDIR)
26 cd $(BUILDDIR); dpkg-buildpackage -b -uc -us
27 lintian $(DEB)
28 @echo $(DEB)
29
30 $(ORIG_SRC_TAR): $(BUILDDIR)
31 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
32
33 $(DSC): $(BUILDDIR) $(ORIG_SRC_TAR)
34 cd $(BUILDDIR); dpkg-buildpackage -S -uc -us -d
35
36 sbuild: $(DSC)
37 sbuild $(DSC)
38
39 .PHONY: dsc
40 dsc: $(DSC)
41 $(MAKE) clean
42 $(MAKE) $(DSC)
43 lintian $(DSC)
44
45 .PHONY: submodule
46 submodule:
47 test -e edk2/Maintainers.txt || git submodule update --init --recursive
48
49 $(SRCDIR)/Readme.md: submodule
50
51 .PHONY: update_modules
52 update_modules: submodule
53 git submodule foreach 'git pull --ff-only origin master'
54
55 .PHONY: upload
56 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
57 upload: $(DEB)
58 tar cf - $(DEB)|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)
59
60 .PHONY: distclean clean
61 distclean: clean
62 clean:
63 rm -rf *.deb $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.changes *.dsc *.buildinfo *.build
64
65 .PHONY: dinstall
66 dinstall: $(DEB)
67 dpkg -i $(DEB)