]> git.proxmox.com Git - qemu-server.git/blame - Makefile
correctly handle empty description in pending section
[qemu-server.git] / Makefile
CommitLineData
6b0ddb3c 1RELEASE=4.0
1e3baf05 2
6b0ddb3c 3VERSION=4.0
1e3baf05 4PACKAGE=qemu-server
ef00f33b 5PKGREL=15
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
18PODDIR=${PREFIX}/share/doc/${PACKAGE}/pod
19MAN1DIR=${MANDIR}/man1/
20export PERLDIR=${PREFIX}/share/perl5
21PERLINCDIR=${PERLDIR}/asm-x86_64
22
23ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
2354a8bb
DM
24GITVERSION:=$(shell cat .git/refs/heads/master)
25
1e3baf05
DM
26DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
27
1e3baf05
DM
28all: ${DEB}
29
30.PHONY: dinstall
31dinstall: deb
32 dpkg -i ${DEB}
33
34control: control.in
35 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/<$< >$@
36
1e3baf05
DM
37vzsyscalls.ph: vzsyscalls.h
38 h2ph -d . vzsyscalls.h
39
40vmtar: vmtar.c utils.c
4841125d 41 gcc ${CFLAGS} -o vmtar vmtar.c
1e3baf05
DM
42
43sparsecp: sparsecp.c utils.c
4841125d 44 gcc ${CFLAGS} -o sparsecp sparsecp.c
1e3baf05
DM
45
46%.1.gz: %.1.pod
47 rm -f $@
48 cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@
49
50%.5.gz: %.5.pod
51 rm -f $@
52 cat $<|pod2man -n $* -s 5 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@
53
54%.1.pod: %
55 podselect $*>$@
56
57qm.1.pod: qm PVE/QemuServer.pm
58 perl -I. ./qm printmanpod >$@
59
3e16d5fc
DM
60qmrestore.1.pod: qmrestore
61 perl -I. ./qmrestore printmanpod >$@
62
1e3baf05
DM
63vm.conf.5.pod: gen-vmconf-pod.pl PVE/QemuServer.pm
64 perl -I. ./gen-vmconf-pod.pl >$@
65
4841125d 66PKGSOURCES=qm qm.1.gz qm.1.pod qmrestore qmrestore.1.pod qmrestore.1.gz qmextract sparsecp vmtar control vm.conf.5.pod vm.conf.5.gz
1e3baf05
DM
67
68.PHONY: install
69install: ${PKGSOURCES}
70 install -d ${DESTDIR}/${SBINDIR}
71 install -d ${DESTDIR}/etc/${PACKAGE}
72 install -d ${DESTDIR}${LIBDIR}
73 install -d ${DESTDIR}${VARLIBDIR}
74 install -d ${DESTDIR}${PODDIR}
75 install -d ${DESTDIR}/usr/share/man/man1
76 install -d ${DESTDIR}/usr/share/man/man5
77 install -d ${DESTDIR}/usr/share/${PACKAGE}
78 install -m 0644 pve-usb.cfg ${DESTDIR}/usr/share/${PACKAGE}
f8e83f05 79 install -m 0644 pve-q35.cfg ${DESTDIR}/usr/share/${PACKAGE}
1e3baf05
DM
80 make -C PVE install
81 install -m 0755 qm ${DESTDIR}${SBINDIR}
1e3baf05 82 install -m 0755 qmrestore ${DESTDIR}${SBINDIR}
1e3baf05 83 install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge
011c5817 84 install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown
1e3baf05
DM
85 install -s -m 0755 vmtar ${DESTDIR}${LIBDIR}
86 install -s -m 0755 sparsecp ${DESTDIR}${LIBDIR}
4841125d 87 install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf
3e16d5fc 88 install -m 0755 qmextract ${DESTDIR}${LIBDIR}
1e3baf05
DM
89 install -m 0644 qm.1.gz ${DESTDIR}/usr/share/man/man1/
90 install -m 0644 qm.1.pod ${DESTDIR}/${PODDIR}
1e3baf05 91 install -m 0644 qmrestore.1.gz ${DESTDIR}/usr/share/man/man1/
3e16d5fc 92 install -m 0644 qmrestore.1.pod ${DESTDIR}/${PODDIR}
1e3baf05
DM
93 install -m 0644 vm.conf.5.pod ${DESTDIR}/${PODDIR}
94 install -m 0644 vm.conf.5.gz ${DESTDIR}/usr/share/man/man5/
95
96.PHONY: deb ${DEB}
97deb ${DEB}: ${PKGSOURCES}
81425ee8
DM
98 rm -rf build
99 mkdir build
100 make DESTDIR=${CURDIR}/build install
1e3baf05 101 perl -I. ./qm verifyapi
81425ee8
DM
102 install -d -m 0755 build/DEBIAN
103 install -m 0644 control build/DEBIAN
dd9d6fb6 104 install -m 0644 triggers build/DEBIAN
4841125d 105 echo "/etc/modules-load.d/qemu-server.conf" >>build/DEBIAN/conffiles
81425ee8
DM
106 install -D -m 0644 copyright build/${DOCDIR}/${PACKAGE}/copyright
107 install -m 0644 changelog.Debian build/${DOCDIR}/${PACKAGE}/
108 gzip -9 build/${DOCDIR}/${PACKAGE}/changelog.Debian
2354a8bb 109 echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/${PACKAGE}/SOURCE
81425ee8
DM
110 dpkg-deb --build build
111 mv build.deb ${DEB}
485e8e1d 112 lintian ${DEB}
1e3baf05
DM
113
114.PHONY: upload
115upload:
116 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
117 mkdir -p /pve/${RELEASE}/extra
118 rm -rf /pve/${RELEASE}/extra/${PACKAGE}_*.deb
119 rm -rf /pve/${RELEASE}/extra/Packages*
120 cp ${DEB} /pve/${RELEASE}/extra
121 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
122 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
123
124.PHONY: clean
125clean:
3e16d5fc 126 rm -rf build *.deb control vzsyscalls.ph _h2ph_pre.ph ${PACKAGE}-*.tar.gz dist *.1.gz *.pod vmtar sparsecp
1e3baf05
DM
127 find . -name '*~' -exec rm {} ';'
128
129
130.PHONY: distclean
131distclean: clean