buildsys: split packaging and source build-systems
[pve-access-control.git] / src / Makefile
CommitLineData
197d1016
TL
1include /usr/share/dpkg/pkg-info.mk
2include /usr/share/dpkg/architecture.mk
3
4PACKAGE=libpve-access-control
5
6BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
7
8DESTDIR=
9PREFIX=/usr
10BINDIR=${PREFIX}/bin
11SBINDIR=${PREFIX}/sbin
12MANDIR=${PREFIX}/share/man
13DOCDIR=${PREFIX}/share/doc/${PACKAGE}
14MAN1DIR=${MANDIR}/man1/
15BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
16ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
17
18export PERLDIR=${PREFIX}/share/perl5
19-include /usr/share/pve-doc-generator/pve-doc-generator.mk
20
21all:
22
23pveum.bash-completion: PVE/CLI/pveum.pm
24 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_bash_completions();" >$@.tmp
25 mv $@.tmp $@
26
27pveum.zsh-completion: PVE/CLI/pveum.pm
28 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_zsh_completions();" >$@.tmp
29 mv $@.tmp $@
30
31.PHONY: install
32install: pveum.1 oathkeygen pveum.bash-completion pveum.zsh-completion
33 install -d ${DESTDIR}${BINDIR}
34 install -d ${DESTDIR}${SBINDIR}
35 install -m 0755 pveum ${DESTDIR}${SBINDIR}
36 install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
37 make -C PVE install
38 install -d ${DESTDIR}/${MAN1DIR}
39 install -d ${DESTDIR}/${DOCDIR}
40 install -m 0644 pveum.1 ${DESTDIR}/${MAN1DIR}
41 install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
42 install -m 0644 -D pveum.zsh-completion ${DESTDIR}${ZSHCOMPLDIR}/_pveum
43
44.PHONY: test
45test:
46 perl -I. ./pveum verifyapi
47 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
48 make -C test check
49
50.PHONY: clean distclean
51distclean: clean
52clean:
53 make cleanup-docgen
54 find . -name '*~' -exec rm {} ';'