]> git.proxmox.com Git - pve-qemu.git/blame - Makefile
squash related patches
[pve-qemu.git] / Makefile
CommitLineData
f6be0ca5 1include /usr/share/dpkg/default.mk
95259824 2
06299321 3PACKAGE = pve-qemu-kvm
95259824
WB
4
5SRCDIR := qemu
3c995a42 6BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
280d157f 7ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
95259824 8
d2494dd2 9GITVERSION := $(shell git rev-parse HEAD)
95259824 10
280d157f 11DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
3c995a42
TL
12DEB = $(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
13DEB_DBG = $(PACKAGE)-dbg_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
95259824
WB
14DEBS = $(DEB) $(DEB_DBG)
15
95259824
WB
16all: $(DEBS)
17
18.PHONY: submodule
19submodule:
3c995a42 20 test -f "$(SRCDIR)/configure" || git submodule update --init --recursive
95259824 21
cb2b3190 22PC_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
36BLOB_PURGE_SED_CMDS = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "/$(FILE)/d")
37BLOB_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
54deb 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
60sbuild: $(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
67dsc:
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
76update:
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 87upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
95259824 88upload: $(DEBS)
3c995a42 89 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
95259824 90
06299321 91.PHONY: distclean clean
95259824 92distclean: clean
95259824 93clean:
19a11f24 94 rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.build *.buildinfo *.changes
95259824
WB
95
96.PHONY: dinstall
97dinstall: $(DEBS)
98 dpkg -i $(DEBS)