]> git.proxmox.com Git - pve-edk2-firmware.git/blob - Makefile
bump version to 4.2023.08-4
[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 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
10
11 # transitional virtual package depending on the amd64 ones
12 VIRTUAL_DEB = $(PACKAGE)_$(DEB_VERSION)_all.deb
13 AMD64_DEB = $(PACKAGE)-legacy_$(DEB_VERSION)_all.deb $(PACKAGE)-ovmf_$(DEB_VERSION)_all.deb
14 AARCH64_DEB = $(PACKAGE)-aarch64_$(DEB_VERSION)_all.deb
15 RISCV_DEB = $(PACKAGE)-riscv_$(DEB_VERSION)_all.deb
16
17 DEBS = $(VIRTUAL_DEB) $(AMD64_DEB) $(AARCH64_DEB) $(RISCV_DEB)
18
19 all: $(DEBS)
20 @echo $(DEBS)
21
22 $(BUILDDIR): $(SRCDIR)/Readme.md
23 rm -rf $@ $@.tmp
24 cp -rpa $(SRCDIR) $@.tmp
25 rm -rf $@.tmp/ArmPkg/Library/GccLto/*.a
26 cp -a debian $@.tmp
27 echo "git clone git://git.proxmox.com/git/pve-edk2-firmware.git\\ngit checkout $(shell git rev-parse HEAD)" > $@.tmp/debian/SOURCE
28 mv $@.tmp $@
29
30 .PHONY: deb
31 deb: $(DEBS)
32 $(AMD64_DEB) $(AARCH64_DEB) $(RISCV_DEB): $(VIRTUAL_DEB)
33 $(VIRTUAL_DEB): $(BUILDDIR)
34 cd $(BUILDDIR); dpkg-buildpackage -b -uc -us
35 lintian $(DEBS)
36 @echo $(DEBS)
37
38 $(ORIG_SRC_TAR): $(BUILDDIR)
39 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
40
41 $(DSC): $(BUILDDIR) $(ORIG_SRC_TAR)
42 cd $(BUILDDIR); dpkg-buildpackage -S -uc -us -d
43
44 sbuild: $(DSC)
45 sbuild $(DSC)
46
47 .PHONY: dsc
48 dsc: $(DSC)
49 $(MAKE) clean
50 $(MAKE) $(DSC)
51 lintian $(DSC)
52
53 .PHONY: submodule
54 submodule:
55 test -e edk2/Maintainers.txt || git submodule update --init --recursive
56
57 $(SRCDIR)/Readme.md: submodule
58
59 .PHONY: update_modules
60 update_modules: submodule
61 git submodule foreach 'git pull --ff-only origin master'
62
63 .PHONY: upload
64 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
65 upload: $(DEBS)
66 tar cf - $(DEBS)|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)
67
68 .PHONY: distclean clean
69 distclean: clean
70 clean:
71 rm -rf *.deb $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.changes *.dsc *.buildinfo *.build
72
73 .PHONY: dinstall
74 dinstall: $(VIRTUAL_DEB) $(AMD64_DEB)
75 dpkg -i $^