]> git.proxmox.com Git - qemu-server.git/blame - Makefile
switch to 'ha-manager set'
[qemu-server.git] / Makefile
CommitLineData
2aa7ef3e 1RELEASE=4.3
1e3baf05 2
6b0ddb3c 3VERSION=4.0
1e3baf05 4PACKAGE=qemu-server
bb476da6 5PKGREL=94
1e3baf05 6
4841125d
DM
7CFLAGS= -O2 -Werror -Wall -Wtype-limits -Wl,-z,relro
8
1e3baf05
DM
9DESTDIR=
10PREFIX=/usr
11BINDIR=${PREFIX}/bin
12SBINDIR=${PREFIX}/sbin
13BINDIR=${PREFIX}/bin
14LIBDIR=${PREFIX}/lib/${PACKAGE}
15VARLIBDIR=/var/lib/${PACKAGE}
16MANDIR=${PREFIX}/share/man
17DOCDIR=${PREFIX}/share/doc
1e3baf05 18MAN1DIR=${MANDIR}/man1/
358297e0 19MAN5DIR=${MANDIR}/man5/
f3e76e36 20BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
1e3baf05
DM
21export PERLDIR=${PREFIX}/share/perl5
22PERLINCDIR=${PERLDIR}/asm-x86_64
23
24ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
2354a8bb
DM
25GITVERSION:=$(shell cat .git/refs/heads/master)
26
1e3baf05
DM
27DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
28
f625f7f6
DM
29# this requires package pve-doc-generator
30export NOVIEW=1
31include /usr/share/pve-doc-generator/pve-doc-generator.mk
32
1e3baf05
DM
33all: ${DEB}
34
35.PHONY: dinstall
36dinstall: deb
37 dpkg -i ${DEB}
38
39control: control.in
40 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/<$< >$@
41
1e3baf05
DM
42vzsyscalls.ph: vzsyscalls.h
43 h2ph -d . vzsyscalls.h
44
45vmtar: vmtar.c utils.c
4841125d 46 gcc ${CFLAGS} -o vmtar vmtar.c
1e3baf05
DM
47
48sparsecp: sparsecp.c utils.c
4841125d 49 gcc ${CFLAGS} -o sparsecp sparsecp.c
1e3baf05 50
f3e76e36
DM
51qm.bash-completion:
52 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp
53 mv $@.tmp $@
1e3baf05 54
cc7b93ec
DM
55qmrestore.bash-completion:
56 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp
57 mv $@.tmp $@
3e16d5fc 58
b6329a72 59PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract sparsecp vmtar control qm.conf.5 qm.bash-completion qmrestore.bash-completion
1e3baf05
DM
60
61.PHONY: install
62install: ${PKGSOURCES}
63 install -d ${DESTDIR}/${SBINDIR}
1e3baf05
DM
64 install -d ${DESTDIR}${LIBDIR}
65 install -d ${DESTDIR}${VARLIBDIR}
358297e0
DM
66 install -d ${DESTDIR}/${MAN1DIR}
67 install -d ${DESTDIR}/${MAN5DIR}
1e3baf05
DM
68 install -d ${DESTDIR}/usr/share/man/man5
69 install -d ${DESTDIR}/usr/share/${PACKAGE}
70 install -m 0644 pve-usb.cfg ${DESTDIR}/usr/share/${PACKAGE}
f8e83f05 71 install -m 0644 pve-q35.cfg ${DESTDIR}/usr/share/${PACKAGE}
f3e76e36 72 install -m 0644 -D qm.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qm
cc7b93ec 73 install -m 0644 -D qmrestore.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qmrestore
dbea4415 74 install -m 0644 -D bootsplash.jpg ${DESTDIR}/usr/share/${PACKAGE}
1e3baf05
DM
75 make -C PVE install
76 install -m 0755 qm ${DESTDIR}${SBINDIR}
1e3baf05 77 install -m 0755 qmrestore ${DESTDIR}${SBINDIR}
1e3baf05 78 install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge
208ba94e 79 install -m 0755 pve-bridge-hotplug ${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug
011c5817 80 install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown
1e3baf05
DM
81 install -s -m 0755 vmtar ${DESTDIR}${LIBDIR}
82 install -s -m 0755 sparsecp ${DESTDIR}${LIBDIR}
4841125d 83 install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf
3e16d5fc 84 install -m 0755 qmextract ${DESTDIR}${LIBDIR}
358297e0
DM
85 install -m 0644 qm.1 ${DESTDIR}/${MAN1DIR}
86 gzip -9 ${DESTDIR}/${MAN1DIR}/qm.1
87 install -m 0644 qmrestore.1 ${DESTDIR}/${MAN1DIR}
88 gzip -9 ${DESTDIR}/${MAN1DIR}/qmrestore.1
89 install -m 0644 qm.conf.5 ${DESTDIR}/${MAN5DIR}
90 gzip -9 ${DESTDIR}/${MAN5DIR}/qm.conf.5
c881ad2f 91 cd ${DESTDIR}/${MAN5DIR}; ln -s qm.conf.5.gz vm.conf.5.gz
1e3baf05 92
ffc0bacf 93.PHONY: deb
1e3baf05 94deb ${DEB}: ${PKGSOURCES}
ffc0bacf 95 rm -f *.deb
81425ee8
DM
96 rm -rf build
97 mkdir build
98 make DESTDIR=${CURDIR}/build install
1e3baf05 99 perl -I. ./qm verifyapi
81425ee8
DM
100 install -d -m 0755 build/DEBIAN
101 install -m 0644 control build/DEBIAN
dd9d6fb6 102 install -m 0644 triggers build/DEBIAN
4841125d 103 echo "/etc/modules-load.d/qemu-server.conf" >>build/DEBIAN/conffiles
81425ee8
DM
104 install -D -m 0644 copyright build/${DOCDIR}/${PACKAGE}/copyright
105 install -m 0644 changelog.Debian build/${DOCDIR}/${PACKAGE}/
106 gzip -9 build/${DOCDIR}/${PACKAGE}/changelog.Debian
2354a8bb 107 echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/${PACKAGE}/SOURCE
81425ee8
DM
108 dpkg-deb --build build
109 mv build.deb ${DEB}
485e8e1d 110 lintian ${DEB}
1e3baf05
DM
111
112.PHONY: upload
dae9b620 113upload: ${DEB}
0622ddfb 114 tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload
1e3baf05
DM
115
116.PHONY: clean
117clean:
f625f7f6 118 make cleanup-docgen
b6329a72 119 rm -rf build *.deb control vzsyscalls.ph _h2ph_pre.ph ${PACKAGE}-*.tar.gz dist *.1 *.5 *.pod vmtar sparsecp *.tmp *.bash-completion
1e3baf05
DM
120 find . -name '*~' -exec rm {} ';'
121
122
123.PHONY: distclean
124distclean: clean