]> git.proxmox.com Git - qemu-server.git/blame - Makefile
bwlimit: add parameter to QemuMigrate::sync_disks
[qemu-server.git] / Makefile
CommitLineData
36ca08b7 1VERSION=5.0
1e3baf05 2PACKAGE=qemu-server
272db0fb 3PKGREL=49
1e3baf05 4
01557677 5CFLAGS+=-O2 -Werror -Wall -Wextra -Wpedantic -Wtype-limits -Wl,-z,relro -std=gnu11
4c17b2e3
DC
6JSON_CFLAGS=$(shell pkg-config --cflags json-c)
7JSON_LIBS=$(shell pkg-config --libs json-c)
4841125d 8
1e3baf05
DM
9DESTDIR=
10PREFIX=/usr
11BINDIR=${PREFIX}/bin
12SBINDIR=${PREFIX}/sbin
13BINDIR=${PREFIX}/bin
14LIBDIR=${PREFIX}/lib/${PACKAGE}
4c17b2e3 15SERVICEDIR=/lib/systemd/system
1e3baf05
DM
16VARLIBDIR=/var/lib/${PACKAGE}
17MANDIR=${PREFIX}/share/man
18DOCDIR=${PREFIX}/share/doc
1e3baf05 19MAN1DIR=${MANDIR}/man1/
358297e0 20MAN5DIR=${MANDIR}/man5/
4c17b2e3 21MAN8DIR=${MANDIR}/man8/
f3e76e36 22BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
efcd6784 23ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
1e3baf05
DM
24export PERLDIR=${PREFIX}/share/perl5
25PERLINCDIR=${PERLDIR}/asm-x86_64
26
27ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
b20c8f7e 28GITVERSION:=$(shell git rev-parse HEAD)
2354a8bb 29
1e3baf05 30DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
303c67ba
TL
31DBG_DEB=${PACKAGE}-dbgsym_${VERSION}-${PKGREL}_${ARCH}.deb
32
33DEBS=${DEB} ${DBG_DEB}
1e3baf05 34
f625f7f6
DM
35# this requires package pve-doc-generator
36export NOVIEW=1
37include /usr/share/pve-doc-generator/pve-doc-generator.mk
38
88c9e280
TL
39export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
40
41all:
1e3baf05
DM
42
43.PHONY: dinstall
44dinstall: deb
45 dpkg -i ${DEB}
46
4c17b2e3
DC
47qmeventd: qmeventd.c
48 $(CC) $(CFLAGS) ${JSON_CFLAGS} -o $@ $< ${JSON_LIBS}
49
f3e76e36 50qm.bash-completion:
3227a101 51 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp
f3e76e36 52 mv $@.tmp $@
1e3baf05 53
cc7b93ec 54qmrestore.bash-completion:
3227a101 55 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp
cc7b93ec 56 mv $@.tmp $@
3e16d5fc 57
efcd6784
CE
58qm.zsh-completion:
59 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_zsh_completions();" >$@.tmp
60 mv $@.tmp $@
61
62qmrestore.zsh-completion:
63 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_zsh_completions();" >$@.tmp
64 mv $@.tmp $@
65
66PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract qm.conf.5 qm.bash-completion qmrestore.bash-completion \
67 qm.zsh-completion qmrestore.zsh-completion qmeventd qmeventd.8
1e3baf05
DM
68
69.PHONY: install
70install: ${PKGSOURCES}
71 install -d ${DESTDIR}/${SBINDIR}
1e3baf05
DM
72 install -d ${DESTDIR}${LIBDIR}
73 install -d ${DESTDIR}${VARLIBDIR}
4c17b2e3 74 install -d ${DESTDIR}${SERVICEDIR}
358297e0
DM
75 install -d ${DESTDIR}/${MAN1DIR}
76 install -d ${DESTDIR}/${MAN5DIR}
4c17b2e3 77 install -d ${DESTDIR}/${MAN8DIR}
1e3baf05
DM
78 install -d ${DESTDIR}/usr/share/man/man5
79 install -d ${DESTDIR}/usr/share/${PACKAGE}
80 install -m 0644 pve-usb.cfg ${DESTDIR}/usr/share/${PACKAGE}
f8e83f05 81 install -m 0644 pve-q35.cfg ${DESTDIR}/usr/share/${PACKAGE}
f3e76e36 82 install -m 0644 -D qm.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qm
cc7b93ec 83 install -m 0644 -D qmrestore.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qmrestore
efcd6784
CE
84 install -m 0644 -D qm.zsh-completion ${DESTDIR}/${ZSHCOMPLDIR}/_qm
85 install -m 0644 -D qmrestore.zsh-completion ${DESTDIR}/${ZSHCOMPLDIR}/_qmrestore
dbea4415 86 install -m 0644 -D bootsplash.jpg ${DESTDIR}/usr/share/${PACKAGE}
1e3baf05
DM
87 make -C PVE install
88 install -m 0755 qm ${DESTDIR}${SBINDIR}
1e3baf05 89 install -m 0755 qmrestore ${DESTDIR}${SBINDIR}
4c17b2e3
DC
90 install -m 0755 qmeventd ${DESTDIR}${SBINDIR}
91 install -m 0644 qmeventd.service ${DESTDIR}${SERVICEDIR}
1e3baf05 92 install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge
208ba94e 93 install -m 0755 pve-bridge-hotplug ${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug
011c5817 94 install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown
4841125d 95 install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf
3e16d5fc 96 install -m 0755 qmextract ${DESTDIR}${LIBDIR}
358297e0 97 install -m 0644 qm.1 ${DESTDIR}/${MAN1DIR}
9d699c49 98 gzip -9 -n -f ${DESTDIR}/${MAN1DIR}/qm.1
4c17b2e3
DC
99 install -m 0644 qmeventd.8 ${DESTDIR}/${MAN8DIR}
100 gzip -9 -n -f ${DESTDIR}/${MAN8DIR}/qmeventd.8
358297e0 101 install -m 0644 qmrestore.1 ${DESTDIR}/${MAN1DIR}
9d699c49 102 gzip -9 -n -f ${DESTDIR}/${MAN1DIR}/qmrestore.1
358297e0 103 install -m 0644 qm.conf.5 ${DESTDIR}/${MAN5DIR}
9d699c49
EK
104 gzip -9 -n -f ${DESTDIR}/${MAN5DIR}/qm.conf.5
105 cd ${DESTDIR}/${MAN5DIR}; ln -s -f qm.conf.5.gz vm.conf.5.gz
1e3baf05 106
ffc0bacf 107.PHONY: deb
303c67ba
TL
108deb: ${DEBS}
109${DBG_DEB}: ${DEB}
88c9e280 110${DEB}:
81425ee8 111 rm -rf build
88c9e280 112 rsync -a * build
88c9e280 113 echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
a183ab0d 114 cd build; dpkg-buildpackage -b -us -uc
303c67ba 115 lintian ${DEBS}
1e3baf05 116
88c9e280
TL
117.PHONY: test
118test:
119 PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi
35c78505
FG
120 make -C test
121
1e3baf05 122.PHONY: upload
dae9b620 123upload: ${DEB}
303c67ba 124 tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist stretch
1e3baf05
DM
125
126.PHONY: clean
88c9e280 127clean:
f625f7f6 128 make cleanup-docgen
4c17b2e3 129 rm -rf build *.deb *.buildinfo *.changes qmeventd
1e3baf05
DM
130 find . -name '*~' -exec rm {} ';'
131
132
133.PHONY: distclean
134distclean: clean