]> git.proxmox.com Git - pve-container.git/blame - src/Makefile
add new pve-container units
[pve-container.git] / src / Makefile
CommitLineData
f76a2828
DM
1PACKAGE=pve-container
2
3PREFIX=${DESTDIR}/usr
4BINDIR=${PREFIX}/bin
1e1fad99 5LIBDIR=${PREFIX}/lib
f76a2828
DM
6SBINDIR=${PREFIX}/sbin
7MANDIR=${PREFIX}/share/man
8DOCDIR=${PREFIX}/share/doc/${PACKAGE}
bf9f492f
DM
9LXC_SCRIPT_DIR=${PREFIX}/share/lxc
10LXC_TMPL_DIR=${LXC_SCRIPT_DIR}/templates
11LXC_HOOK_DIR=${LXC_SCRIPT_DIR}/hooks
12LXC_COMMON_CONFIG_DIR=${LXC_SCRIPT_DIR}/config/common.conf.d
bb453632 13SERVICEDIR=${DESTDIR}/lib/systemd/system
f76a2828
DM
14PODDIR=${DOCDIR}/pod
15MAN1DIR=${MANDIR}/man1/
81bee809 16MAN5DIR=${MANDIR}/man5/
68e8f3c5 17BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
f76a2828
DM
18export PERLDIR=${PREFIX}/share/perl5
19
5bdebcfa
DM
20# this require package pve-doc-generator
21export NOVIEW=1
22include /usr/share/pve-doc-generator/pve-doc-generator.mk
81bee809 23
5bdebcfa 24all:
f76a2828 25
068adb4e 26pct.bash-completion:
6c2e9377 27 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::pct; PVE::CLI::pct->generate_bash_completions();" >$@.tmp
dc2ba725 28 mv $@.tmp $@
068adb4e 29
a9333515
FG
30.PHONY: check
31check: test
32 make -C test
33
f76a2828 34.PHONY: install
5bdebcfa 35install: pct lxc-pve.conf lxc-pve-prestart-hook lxc-pve-autodev-hook lxc-pve-poststop-hook lxcnetaddbr pct.1 pct.conf.5 pve-update-lxc-config pct.bash-completion
6c2e9377 36 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::pct; PVE::CLI::pct->verify_api();"
f76a2828
DM
37 install -d ${SBINDIR}
38 install -m 0755 pct ${SBINDIR}
4968d0f7 39 install -m 0755 pve-update-lxc-config ${SBINDIR}
bf9f492f
DM
40 install -d ${LXC_SCRIPT_DIR}
41 install -m 0755 lxcnetaddbr ${LXC_SCRIPT_DIR}
1e1fad99 42 install -m 0755 lxc-pve-reboot-trigger ${LXC_SCRIPT_DIR}
395139e2 43 install -m 0755 pve-container-stop-wrapper ${LXC_SCRIPT_DIR}
1e1fad99
WB
44 install -d -m0755 ${SERVICEDIR}/lxc@.service.d
45 install -m0644 pve-reboot.conf ${SERVICEDIR}/lxc@.service.d/
395139e2
FG
46 install -m0644 pve-container@.service ${SERVICEDIR}/
47 install -m0644 'system-pve\x2dcontainer.slice' ${SERVICEDIR}/
bf9f492f 48 install -d ${LXC_HOOK_DIR}
deaf7667 49 install -m 0755 lxc-pve-prestart-hook ${LXC_HOOK_DIR}
50df544c 50 install -m 0755 lxc-pve-autodev-hook ${LXC_HOOK_DIR}
32e6d659 51 install -m 0755 lxc-pve-poststop-hook ${LXC_HOOK_DIR}
bf9f492f
DM
52 install -d ${LXC_COMMON_CONFIG_DIR}
53 install -m 0644 lxc-pve.conf ${LXC_COMMON_CONFIG_DIR}/01-pve.conf
68e8f3c5 54 install -m 0644 -D pct.bash-completion ${BASHCOMPLDIR}/pct
f76a2828
DM
55 make -C PVE install
56 install -d ${MAN1DIR}
81bee809 57 install -d ${MAN5DIR}
5bdebcfa
DM
58 install -m 0644 pct.1 ${MAN1DIR}
59 gzip -9 ${MAN1DIR}/pct.1
60 install -m 0644 pct.conf.5 ${MAN5DIR}
61 gzip -9 ${MAN5DIR}/pct.conf.5
167db1d1 62 cd ${MAN5DIR}; ln -s pct.conf.5.gz ct.conf.5.gz
f76a2828 63
1e180f97
DM
64.PHONY: test
65test:
66 make -C test test
67
f76a2828
DM
68.PHONY: clean
69clean:
1e180f97 70 make -C test clean
5bdebcfa
DM
71 make cleanup-docgen
72 rm -rf *.1 *.5 *.tmp *.bash-completion
f76a2828
DM
73 find . -name '*~' -exec rm {} ';'
74
75.PHONY: distclean
76distclean: clean
77