]>
Commit | Line | Data |
---|---|---|
f6be0ca5 | 1 | include /usr/share/dpkg/default.mk |
95259824 | 2 | |
06299321 | 3 | PACKAGE = pve-qemu-kvm |
95259824 WB |
4 | |
5 | SRCDIR := qemu | |
06299321 | 6 | BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM} |
280d157f | 7 | ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz |
95259824 | 8 | |
d2494dd2 | 9 | GITVERSION := $(shell git rev-parse HEAD) |
95259824 | 10 | |
280d157f | 11 | DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc |
06299321 TL |
12 | DEB = ${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb |
13 | DEB_DBG = ${PACKAGE}-dbg_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb | |
95259824 WB |
14 | DEBS = $(DEB) $(DEB_DBG) |
15 | ||
95259824 WB |
16 | all: $(DEBS) |
17 | ||
18 | .PHONY: submodule | |
19 | submodule: | |
d7722e1a | 20 | test -f "${SRCDIR}/configure" || git submodule update --init --recursive |
95259824 | 21 | |
cb2b3190 | 22 | PC_BIOS_FW_PURGE_LIST_IN = \ |
6facdf3a | 23 | hppa-firmware.img \ |
cb2b3190 TL |
24 | openbios-ppc \ |
25 | openbios-sparc32 \ | |
26 | openbios-sparc64 \ | |
27 | palcode-clipper \ | |
28 | s390-ccw.img \ | |
29 | s390-netboot.img \ | |
30 | u-boot.e500 \ | |
31 | .*\.dtb \ | |
32 | qemu_vga.ndrv \ | |
33 | slof.bin \ | |
34 | opensbi-riscv.*-generic-fw_dynamic.bin \ | |
35 | ||
36 | BLOB_PURGE_SED_CMDS = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "/$(FILE)/d") | |
37 | BLOB_PURGE_FILTER = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "$(FILE)") | |
38 | ||
06299321 | 39 | $(BUILDDIR): keycodemapdb | submodule |
817b7667 SR |
40 | # check if qemu/ was used for a build |
41 | # if so, please run 'make distclean' in the submodule and try again | |
42 | test ! -f $(SRCDIR)/build/config.status | |
4f56d292 TL |
43 | rm -rf $@.tmp $@ |
44 | cp -a $(SRCDIR) $@.tmp | |
45 | cp -a debian $@.tmp/debian | |
46 | rm -rf $@.tmp/ui/keycodemapdb | |
47 | cp -a keycodemapdb $@.tmp/ui/ | |
cb2b3190 TL |
48 | find $@.tmp/pc-bios -type f | grep $(BLOB_PURGE_FILTER) | xargs rm -f |
49 | sed -i $(BLOB_PURGE_SED_CMDS) $@.tmp/pc-bios/meson.build | |
4f56d292 TL |
50 | echo "git clone git://git.proxmox.com/git/pve-qemu.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE |
51 | mv $@.tmp $@ | |
06299321 | 52 | |
95259824 WB |
53 | .PHONY: deb kvm |
54 | deb kvm: $(DEBS) | |
55 | $(DEB_DBG): $(DEB) | |
06299321 TL |
56 | $(DEB): $(BUILDDIR) |
57 | cd $(BUILDDIR); dpkg-buildpackage -b -us -uc -j | |
58 | lintian $(DEBS) | |
95259824 | 59 | |
2d17b4b4 FE |
60 | sbuild: $(DSC) |
61 | sbuild $(DSC) | |
62 | ||
280d157f FE |
63 | $(ORIG_SRC_TAR): $(BUILDDIR) |
64 | tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR) | |
65 | ||
66 | .PHONY: dsc | |
cd148033 TL |
67 | dsc: |
68 | rm -rf *.dsc $(BUILDDIR) | |
69 | $(MAKE) $(DSC) | |
70 | lintian $(DSC) | |
71 | ||
280d157f | 72 | $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR) |
280d157f | 73 | cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d |
280d157f | 74 | |
6838f038 WB |
75 | .PHONY: update |
76 | update: | |
06299321 TL |
77 | cd $(SRCDIR) && git submodule deinit ui/keycodemapdb || true |
78 | rm -rf $(SRCDIR)/ui/keycodemapdb | |
79 | mkdir $(SRCDIR)/ui/keycodemapdb | |
80 | cd $(SRCDIR) && git submodule update --init ui/keycodemapdb | |
6838f038 WB |
81 | rm -rf keycodemapdb |
82 | mkdir keycodemapdb | |
06299321 | 83 | cp -R $(SRCDIR)/ui/keycodemapdb/* keycodemapdb/ |
6838f038 WB |
84 | git add keycodemapdb |
85 | ||
95259824 | 86 | .PHONY: upload |
f6be0ca5 | 87 | upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) |
95259824 | 88 | upload: $(DEBS) |
f6be0ca5 | 89 | tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST) |
95259824 | 90 | |
06299321 | 91 | .PHONY: distclean clean |
95259824 | 92 | distclean: clean |
95259824 | 93 | clean: |
19a11f24 | 94 | rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.build *.buildinfo *.changes |
95259824 WB |
95 | |
96 | .PHONY: dinstall | |
97 | dinstall: $(DEBS) | |
98 | dpkg -i $(DEBS) |