]> git.proxmox.com Git - pve-edk2-firmware.git/blob - Makefile
buildsys: fix dsc and source tarball generation
[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 .PHONY: dsc
37 dsc: $(DSC)
38 $(MAKE) clean
39 $(MAKE) $(DSC)
40 lintian $(DSC)
41
42 .PHONY: submodule
43 submodule:
44 test -e edk2/Maintainers.txt || git submodule update --init --recursive
45
46 $(SRCDIR)/Readme.md: submodule
47
48 .PHONY: update_modules
49 update_modules: submodule
50 git submodule foreach 'git pull --ff-only origin master'
51
52 .PHONY: upload
53 upload: $(DEB)
54 tar cf - $(DEB)|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye
55
56 .PHONY: distclean clean
57 distclean: clean
58 clean:
59 rm -rf *.deb $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.changes *.dsc *.buildinfo *.build
60
61 .PHONY: dinstall
62 dinstall: $(DEB)
63 dpkg -i $(DEB)