]> git.proxmox.com Git - pve-edk2-firmware.git/blob - Makefile
buildsys: make build-dir generation atomic
[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 $@ $@.tmp
19 cp -rpa $(SRCDIR) $@.tmp
20 cp -a debian $@.tmp
21 echo "git clone git://git.proxmox.com/git/pve-edk2-firmware.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
22 mv $@.tmp $@
23
24 .PHONY: deb
25 deb: $(DEB)
26 $(DEB): $(BUILDDIR)
27 cd $(BUILDDIR); dpkg-buildpackage -b -uc -us
28 lintian $(DEB)
29 @echo $(DEB)
30
31 $(ORIG_SRC_TAR): $(BUILDDIR)
32 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
33
34 $(DSC): $(BUILDDIR) $(ORIG_SRC_TAR)
35 cd $(BUILDDIR); dpkg-buildpackage -S -uc -us -d
36
37 sbuild: $(DSC)
38 sbuild $(DSC)
39
40 .PHONY: dsc
41 dsc: $(DSC)
42 $(MAKE) clean
43 $(MAKE) $(DSC)
44 lintian $(DSC)
45
46 .PHONY: submodule
47 submodule:
48 test -e edk2/Maintainers.txt || git submodule update --init --recursive
49
50 $(SRCDIR)/Readme.md: submodule
51
52 .PHONY: update_modules
53 update_modules: submodule
54 git submodule foreach 'git pull --ff-only origin master'
55
56 .PHONY: upload
57 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
58 upload: $(DEB)
59 tar cf - $(DEB)|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)
60
61 .PHONY: distclean clean
62 distclean: clean
63 clean:
64 rm -rf *.deb $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.changes *.dsc *.buildinfo *.build
65
66 .PHONY: dinstall
67 dinstall: $(DEB)
68 dpkg -i $(DEB)