buildsys: split packaging and source build-systems
[pve-access-control.git] / src / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2 include /usr/share/dpkg/architecture.mk
3
4 PACKAGE=libpve-access-control
5
6 BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
7
8 DESTDIR=
9 PREFIX=/usr
10 BINDIR=${PREFIX}/bin
11 SBINDIR=${PREFIX}/sbin
12 MANDIR=${PREFIX}/share/man
13 DOCDIR=${PREFIX}/share/doc/${PACKAGE}
14 MAN1DIR=${MANDIR}/man1/
15 BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
16 ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
17
18 export PERLDIR=${PREFIX}/share/perl5
19 -include /usr/share/pve-doc-generator/pve-doc-generator.mk
20
21 all:
22
23 pveum.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
27 pveum.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
32 install: 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
45 test:
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
51 distclean: clean
52 clean:
53 make cleanup-docgen
54 find . -name '*~' -exec rm {} ';'