]>
Commit | Line | Data |
---|---|---|
1 | include /usr/share/dpkg/default.mk | |
2 | ||
3 | PACKAGE = pve-qemu-kvm | |
4 | ||
5 | SRCDIR := qemu | |
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 | DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc | |
12 | DEB = $(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb | |
13 | DEB_DBG = $(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb | |
14 | DEBS = $(DEB) $(DEB_DBG) | |
15 | ||
16 | all: $(DEBS) | |
17 | ||
18 | .PHONY: submodule | |
19 | submodule: | |
20 | ifeq ($(shell test -f "$(SRCDIR)/configure" && echo 1 || echo 0), 0) | |
21 | git submodule update --init --recursive | |
22 | cd $(SRCDIR); meson subprojects download | |
23 | endif | |
24 | ||
25 | PC_BIOS_FW_PURGE_LIST_IN = \ | |
26 | hppa-firmware.img \ | |
27 | hppa-firmware64.img \ | |
28 | openbios-ppc \ | |
29 | openbios-sparc32 \ | |
30 | openbios-sparc64 \ | |
31 | palcode-clipper \ | |
32 | s390-ccw.img \ | |
33 | s390-netboot.img \ | |
34 | u-boot.e500 \ | |
35 | .*[a-zA-Z0-9]\.dtb \ | |
36 | .*[a-zA-Z0-9]\.dts \ | |
37 | qemu_vga.ndrv \ | |
38 | slof.bin \ | |
39 | opensbi-riscv.*-generic-fw_dynamic.bin \ | |
40 | ||
41 | BLOB_PURGE_SED_CMDS = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "/$(FILE)/d") | |
42 | BLOB_PURGE_FILTER = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "$(FILE)") | |
43 | ||
44 | $(BUILDDIR): submodule | |
45 | # check if qemu/ was used for a build | |
46 | # if so, please run 'make distclean' in the submodule and try again | |
47 | test ! -f $(SRCDIR)/build/config.status | |
48 | rm -rf $@.tmp $@ | |
49 | cp -a $(SRCDIR) $@.tmp | |
50 | cp -a debian $@.tmp/debian | |
51 | rm -rf $@.tmp/roms/edk2 # packaged separately | |
52 | find $@.tmp/pc-bios -type f | grep $(BLOB_PURGE_FILTER) | xargs rm -f | |
53 | sed -i $(BLOB_PURGE_SED_CMDS) $@.tmp/pc-bios/meson.build | |
54 | echo "git clone git://git.proxmox.com/git/pve-qemu.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE | |
55 | mv $@.tmp $@ | |
56 | ||
57 | .PHONY: deb kvm | |
58 | deb kvm: $(DEBS) | |
59 | $(DEB_DBG): $(DEB) | |
60 | $(DEB): $(BUILDDIR) | |
61 | cd $(BUILDDIR); dpkg-buildpackage -b -us -uc | |
62 | lintian $(DEBS) | |
63 | ||
64 | sbuild: $(DSC) | |
65 | sbuild $(DSC) | |
66 | ||
67 | $(ORIG_SRC_TAR): $(BUILDDIR) | |
68 | tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR) | |
69 | ||
70 | .PHONY: dsc | |
71 | dsc: | |
72 | rm -rf *.dsc $(BUILDDIR) | |
73 | $(MAKE) $(DSC) | |
74 | lintian $(DSC) | |
75 | ||
76 | $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR) | |
77 | cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d | |
78 | ||
79 | .PHONY: upload | |
80 | upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) | |
81 | upload: $(DEBS) | |
82 | tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST) | |
83 | ||
84 | .PHONY: distclean clean | |
85 | distclean: clean | |
86 | clean: | |
87 | rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.build *.buildinfo *.changes | |
88 | ||
89 | .PHONY: dinstall | |
90 | dinstall: $(DEBS) | |
91 | dpkg -i $(DEBS) |