]> git.proxmox.com Git - pve-container.git/blame - src/Makefile
buildsys: improve clean target
[pve-container.git] / src / Makefile
CommitLineData
f76a2828
DM
1PACKAGE=pve-container
2
3PREFIX=${DESTDIR}/usr
4BINDIR=${PREFIX}/bin
1e1fad99 5LIBDIR=${PREFIX}/lib
500ebd9a 6SBINDIR=${PREFIX}/sbin
f76a2828
DM
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
059f7bb4
WB
12LXC_CONFIG_DIR=${LXC_SCRIPT_DIR}/config
13LXC_COMMON_CONFIG_DIR=${LXC_CONFIG_DIR}/common.conf.d
4776d83a 14LXC_USERNS_CONFIG_DIR=${LXC_CONFIG_DIR}/userns.conf.d
bb453632 15SERVICEDIR=${DESTDIR}/lib/systemd/system
f76a2828
DM
16PODDIR=${DOCDIR}/pod
17MAN1DIR=${MANDIR}/man1/
81bee809 18MAN5DIR=${MANDIR}/man5/
68e8f3c5 19BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
fdb24446 20ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
f76a2828
DM
21export PERLDIR=${PREFIX}/share/perl5
22
5bdebcfa
DM
23# this require package pve-doc-generator
24export NOVIEW=1
25include /usr/share/pve-doc-generator/pve-doc-generator.mk
81bee809 26
5bdebcfa 27all:
f76a2828 28
068adb4e 29pct.bash-completion:
6c2e9377 30 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::pct; PVE::CLI::pct->generate_bash_completions();" >$@.tmp
dc2ba725 31 mv $@.tmp $@
068adb4e 32
fdb24446
CE
33pct.zsh-completion:
34 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::pct; PVE::CLI::pct->generate_zsh_completions();" >$@.tmp
35 mv $@.tmp $@
36
a9333515
FG
37.PHONY: check
38check: test
39 make -C test
40
f76a2828 41.PHONY: install
cc9967d2
TL
42install: pct lxc-pve.conf pct.1 pct.conf.5 pct.bash-completion pct.zsh-completion \
43 pve-userns.seccomp pve-container@.service pve-container-debug@.service \
44 lxc-pve-prestart-hook lxc-pve-autodev-hook lxc-pve-poststop-hook lxcnetaddbr
6c2e9377 45 PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::pct; PVE::CLI::pct->verify_api();"
500ebd9a
WB
46 install -d ${SBINDIR}
47 install -m 0755 pct ${SBINDIR}
bf9f492f
DM
48 install -d ${LXC_SCRIPT_DIR}
49 install -m 0755 lxcnetaddbr ${LXC_SCRIPT_DIR}
395139e2 50 install -m 0755 pve-container-stop-wrapper ${LXC_SCRIPT_DIR}
e4072072 51 install -d -m0755 ${SERVICEDIR}
395139e2 52 install -m0644 pve-container@.service ${SERVICEDIR}/
cc9967d2 53 install -m0644 pve-container-debug@.service ${SERVICEDIR}/
395139e2 54 install -m0644 'system-pve\x2dcontainer.slice' ${SERVICEDIR}/
bf9f492f 55 install -d ${LXC_HOOK_DIR}
deaf7667 56 install -m 0755 lxc-pve-prestart-hook ${LXC_HOOK_DIR}
50df544c 57 install -m 0755 lxc-pve-autodev-hook ${LXC_HOOK_DIR}
32e6d659 58 install -m 0755 lxc-pve-poststop-hook ${LXC_HOOK_DIR}
059f7bb4
WB
59 install -d ${LXC_CONFIG_DIR}
60 install -m 0644 pve-userns.seccomp ${LXC_CONFIG_DIR}/pve-userns.seccomp
bf9f492f
DM
61 install -d ${LXC_COMMON_CONFIG_DIR}
62 install -m 0644 lxc-pve.conf ${LXC_COMMON_CONFIG_DIR}/01-pve.conf
4776d83a
WB
63 install -d ${LXC_USERNS_CONFIG_DIR}
64 install -m 0644 lxc-pve-userns.conf ${LXC_USERNS_CONFIG_DIR}/01-pve.conf
68e8f3c5 65 install -m 0644 -D pct.bash-completion ${BASHCOMPLDIR}/pct
fdb24446 66 install -m 0644 -D pct.zsh-completion ${ZSHCOMPLDIR}/_pct
f76a2828
DM
67 make -C PVE install
68 install -d ${MAN1DIR}
81bee809 69 install -d ${MAN5DIR}
5bdebcfa
DM
70 install -m 0644 pct.1 ${MAN1DIR}
71 gzip -9 ${MAN1DIR}/pct.1
72 install -m 0644 pct.conf.5 ${MAN5DIR}
73 gzip -9 ${MAN5DIR}/pct.conf.5
167db1d1 74 cd ${MAN5DIR}; ln -s pct.conf.5.gz ct.conf.5.gz
02209345 75 install -D -m 0644 10-pve-ct-inotify-limits.conf ${LIBDIR}/sysctl.d/10-pve-ct-inotify-limits.conf
f76a2828 76
059f7bb4
WB
77pve-userns.seccomp: /usr/share/lxc/config/common.seccomp
78 cp $< $@
79 echo 'keyctl errno 38' >> $@
80
1e180f97
DM
81.PHONY: test
82test:
83 make -C test test
84
f76a2828
DM
85.PHONY: clean
86clean:
1e180f97 87 make -C test clean
5bdebcfa 88 make cleanup-docgen
b0873372 89 rm -f *.1 *.5 *.tmp *.bash-completion *.bash-completion
f76a2828
DM
90
91.PHONY: distclean
92distclean: clean
93