2023-05-19 14:24:32 +03:00
|
|
|
include /usr/share/dpkg/default.mk
|
2017-04-05 11:49:19 +03:00
|
|
|
|
2019-05-22 18:12:12 +03:00
|
|
|
PACKAGE = pve-qemu-kvm
|
2017-04-05 11:49:19 +03:00
|
|
|
|
|
|
|
SRCDIR := qemu
|
2023-05-22 14:53:03 +03:00
|
|
|
BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
|
2023-05-19 14:30:23 +03:00
|
|
|
ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
|
2017-04-05 11:49:19 +03:00
|
|
|
|
2017-11-29 12:25:06 +03:00
|
|
|
GITVERSION := $(shell git rev-parse HEAD)
|
2017-04-05 11:49:19 +03:00
|
|
|
|
2023-05-19 14:30:23 +03:00
|
|
|
DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
|
2023-05-22 14:53:03 +03:00
|
|
|
DEB = $(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
|
2023-05-22 14:51:22 +03:00
|
|
|
DEB_DBG = $(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
|
2017-04-05 11:49:19 +03:00
|
|
|
DEBS = $(DEB) $(DEB_DBG)
|
|
|
|
|
|
|
|
all: $(DEBS)
|
|
|
|
|
|
|
|
.PHONY: submodule
|
|
|
|
submodule:
|
2023-10-17 15:10:07 +03:00
|
|
|
ifeq ($(shell test -f "$(SRCDIR)/configure" && echo 1 || echo 0), 0)
|
|
|
|
git submodule update --init --recursive
|
|
|
|
cd $(SRCDIR); meson subprojects download
|
|
|
|
endif
|
2017-04-05 11:49:19 +03:00
|
|
|
|
2023-05-22 13:00:03 +03:00
|
|
|
PC_BIOS_FW_PURGE_LIST_IN = \
|
2023-05-22 13:01:05 +03:00
|
|
|
hppa-firmware.img \
|
2024-04-25 18:21:27 +03:00
|
|
|
hppa-firmware64.img \
|
2023-05-22 13:00:03 +03:00
|
|
|
openbios-ppc \
|
|
|
|
openbios-sparc32 \
|
|
|
|
openbios-sparc64 \
|
|
|
|
palcode-clipper \
|
|
|
|
s390-ccw.img \
|
|
|
|
s390-netboot.img \
|
|
|
|
u-boot.e500 \
|
2024-04-25 18:21:26 +03:00
|
|
|
.*[a-zA-Z0-9]\.dtb \
|
|
|
|
.*[a-zA-Z0-9]\.dts \
|
2023-05-22 13:00:03 +03:00
|
|
|
qemu_vga.ndrv \
|
|
|
|
slof.bin \
|
|
|
|
opensbi-riscv.*-generic-fw_dynamic.bin \
|
|
|
|
|
|
|
|
BLOB_PURGE_SED_CMDS = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "/$(FILE)/d")
|
|
|
|
BLOB_PURGE_FILTER = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "$(FILE)")
|
|
|
|
|
2023-10-17 15:10:08 +03:00
|
|
|
$(BUILDDIR): submodule
|
2021-02-11 19:11:11 +03:00
|
|
|
# check if qemu/ was used for a build
|
|
|
|
# if so, please run 'make distclean' in the submodule and try again
|
|
|
|
test ! -f $(SRCDIR)/build/config.status
|
2023-05-22 11:55:57 +03:00
|
|
|
rm -rf $@.tmp $@
|
|
|
|
cp -a $(SRCDIR) $@.tmp
|
|
|
|
cp -a debian $@.tmp/debian
|
2023-05-24 11:37:07 +03:00
|
|
|
rm -rf $@.tmp/roms/edk2 # packaged separately
|
2023-05-22 13:00:03 +03:00
|
|
|
find $@.tmp/pc-bios -type f | grep $(BLOB_PURGE_FILTER) | xargs rm -f
|
|
|
|
sed -i $(BLOB_PURGE_SED_CMDS) $@.tmp/pc-bios/meson.build
|
2023-05-22 11:55:57 +03:00
|
|
|
echo "git clone git://git.proxmox.com/git/pve-qemu.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
|
|
|
|
mv $@.tmp $@
|
2019-05-22 18:12:12 +03:00
|
|
|
|
2017-04-05 11:49:19 +03:00
|
|
|
.PHONY: deb kvm
|
|
|
|
deb kvm: $(DEBS)
|
|
|
|
$(DEB_DBG): $(DEB)
|
2019-05-22 18:12:12 +03:00
|
|
|
$(DEB): $(BUILDDIR)
|
2024-04-12 15:26:40 +03:00
|
|
|
cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
|
2019-05-22 18:12:12 +03:00
|
|
|
lintian $(DEBS)
|
2017-04-05 11:49:19 +03:00
|
|
|
|
2023-05-19 14:31:05 +03:00
|
|
|
sbuild: $(DSC)
|
|
|
|
sbuild $(DSC)
|
|
|
|
|
2023-05-19 14:30:23 +03:00
|
|
|
$(ORIG_SRC_TAR): $(BUILDDIR)
|
|
|
|
tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
|
|
|
|
|
|
|
|
.PHONY: dsc
|
2023-05-22 11:30:49 +03:00
|
|
|
dsc:
|
|
|
|
rm -rf *.dsc $(BUILDDIR)
|
|
|
|
$(MAKE) $(DSC)
|
|
|
|
lintian $(DSC)
|
|
|
|
|
2023-05-19 14:30:23 +03:00
|
|
|
$(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
|
|
|
|
cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
|
|
|
|
|
2017-04-05 11:49:19 +03:00
|
|
|
.PHONY: upload
|
2023-05-19 14:24:32 +03:00
|
|
|
upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
|
2017-04-05 11:49:19 +03:00
|
|
|
upload: $(DEBS)
|
2023-05-22 14:53:03 +03:00
|
|
|
tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
|
2017-04-05 11:49:19 +03:00
|
|
|
|
2019-05-22 18:12:12 +03:00
|
|
|
.PHONY: distclean clean
|
2017-04-05 11:49:19 +03:00
|
|
|
distclean: clean
|
|
|
|
clean:
|
2023-05-19 14:22:00 +03:00
|
|
|
rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.build *.buildinfo *.changes
|
2017-04-05 11:49:19 +03:00
|
|
|
|
|
|
|
.PHONY: dinstall
|
|
|
|
dinstall: $(DEBS)
|
|
|
|
dpkg -i $(DEBS)
|