]> git.proxmox.com Git - qemu-server.git/blame - Makefile
restore_vma_archive: do not overwrite global signal handlers
[qemu-server.git] / Makefile
CommitLineData
36ca08b7 1VERSION=5.0
1e3baf05 2PACKAGE=qemu-server
4d481008 3PKGREL=15
1e3baf05 4
4841125d
DM
5CFLAGS= -O2 -Werror -Wall -Wtype-limits -Wl,-z,relro
6
1e3baf05
DM
7DESTDIR=
8PREFIX=/usr
9BINDIR=${PREFIX}/bin
10SBINDIR=${PREFIX}/sbin
11BINDIR=${PREFIX}/bin
12LIBDIR=${PREFIX}/lib/${PACKAGE}
13VARLIBDIR=/var/lib/${PACKAGE}
14MANDIR=${PREFIX}/share/man
15DOCDIR=${PREFIX}/share/doc
1e3baf05 16MAN1DIR=${MANDIR}/man1/
358297e0 17MAN5DIR=${MANDIR}/man5/
f3e76e36 18BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
1e3baf05
DM
19export PERLDIR=${PREFIX}/share/perl5
20PERLINCDIR=${PERLDIR}/asm-x86_64
21
22ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
2354a8bb
DM
23GITVERSION:=$(shell cat .git/refs/heads/master)
24
1e3baf05
DM
25DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
26
f625f7f6
DM
27# this requires package pve-doc-generator
28export NOVIEW=1
29include /usr/share/pve-doc-generator/pve-doc-generator.mk
30
88c9e280
TL
31export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
32
33all:
1e3baf05
DM
34
35.PHONY: dinstall
36dinstall: deb
37 dpkg -i ${DEB}
38
f3e76e36 39qm.bash-completion:
3227a101 40 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp
f3e76e36 41 mv $@.tmp $@
1e3baf05 42
cc7b93ec 43qmrestore.bash-completion:
3227a101 44 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp
cc7b93ec 45 mv $@.tmp $@
3e16d5fc 46
424f9940 47PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract qm.conf.5 qm.bash-completion qmrestore.bash-completion
1e3baf05
DM
48
49.PHONY: install
50install: ${PKGSOURCES}
51 install -d ${DESTDIR}/${SBINDIR}
1e3baf05
DM
52 install -d ${DESTDIR}${LIBDIR}
53 install -d ${DESTDIR}${VARLIBDIR}
358297e0
DM
54 install -d ${DESTDIR}/${MAN1DIR}
55 install -d ${DESTDIR}/${MAN5DIR}
1e3baf05
DM
56 install -d ${DESTDIR}/usr/share/man/man5
57 install -d ${DESTDIR}/usr/share/${PACKAGE}
58 install -m 0644 pve-usb.cfg ${DESTDIR}/usr/share/${PACKAGE}
f8e83f05 59 install -m 0644 pve-q35.cfg ${DESTDIR}/usr/share/${PACKAGE}
f3e76e36 60 install -m 0644 -D qm.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qm
cc7b93ec 61 install -m 0644 -D qmrestore.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qmrestore
dbea4415 62 install -m 0644 -D bootsplash.jpg ${DESTDIR}/usr/share/${PACKAGE}
1e3baf05
DM
63 make -C PVE install
64 install -m 0755 qm ${DESTDIR}${SBINDIR}
1e3baf05 65 install -m 0755 qmrestore ${DESTDIR}${SBINDIR}
1e3baf05 66 install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge
208ba94e 67 install -m 0755 pve-bridge-hotplug ${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug
011c5817 68 install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown
4841125d 69 install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf
3e16d5fc 70 install -m 0755 qmextract ${DESTDIR}${LIBDIR}
358297e0 71 install -m 0644 qm.1 ${DESTDIR}/${MAN1DIR}
befb7c46 72 gzip -9 -n ${DESTDIR}/${MAN1DIR}/qm.1
358297e0 73 install -m 0644 qmrestore.1 ${DESTDIR}/${MAN1DIR}
befb7c46 74 gzip -9 -n ${DESTDIR}/${MAN1DIR}/qmrestore.1
358297e0 75 install -m 0644 qm.conf.5 ${DESTDIR}/${MAN5DIR}
befb7c46 76 gzip -9 -n ${DESTDIR}/${MAN5DIR}/qm.conf.5
c881ad2f 77 cd ${DESTDIR}/${MAN5DIR}; ln -s qm.conf.5.gz vm.conf.5.gz
1e3baf05 78
ffc0bacf 79.PHONY: deb
e448dcf3 80deb: ${DEB}
88c9e280 81${DEB}:
81425ee8 82 rm -rf build
88c9e280 83 rsync -a * build
88c9e280 84 echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
a183ab0d 85 cd build; dpkg-buildpackage -b -us -uc
485e8e1d 86 lintian ${DEB}
1e3baf05 87
88c9e280
TL
88.PHONY: test
89test:
90 PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi
35c78505
FG
91 make -C test
92
1e3baf05 93.PHONY: upload
dae9b620 94upload: ${DEB}
36ca08b7 95 tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload --product pve --dist stretch
1e3baf05
DM
96
97.PHONY: clean
88c9e280 98clean:
f625f7f6 99 make cleanup-docgen
88c9e280 100 rm -rf build *.deb *.buildinfo *.changes
1e3baf05
DM
101 find . -name '*~' -exec rm {} ';'
102
103
104.PHONY: distclean
105distclean: clean