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