3 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
4 GITVERSION
:=$(shell git rev-parse HEAD
)
6 SUBDIRS
:= etc www docs
8 # Binaries usable by users
10 proxmox-backup-client \
13 # Binaries usable by admins
14 USR_SBIN
:= proxmox-backup-manager
16 # Binaries for services:
21 ifeq ($(BUILD_MODE
), release
)
22 CARGO_BUILD_ARGS
+= --release
23 COMPILEDIR
:= target
/release
25 COMPILEDIR
:= target
/debug
28 ifeq ($(valgrind
), yes
)
29 CARGO_BUILD_ARGS
+= --features valgrind
33 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
))
35 DEBS
= ${PACKAGE}-server_
${PKGVER}-${PKGREL}_
${ARCH}.deb
${PACKAGE}-client_
${PKGVER}-${PKGREL}_
${ARCH}.deb
37 DOC_DEB
=${PACKAGE}-docs_
${PKGVER}-${PKGREL}_all.deb
41 all: cargo-build
$(SUBDIRS
)
48 #cargo test test_broadcast_future
49 #cargo test $(CARGO_BUILD_ARGS)
50 cargo
test $(tests
) $(CARGO_BUILD_ARGS
)
53 cargo doc
--no-deps
$(CARGO_BUILD_ARGS
)
55 # always re-create this dir
56 # but also copy the local target/ dir as a build-cache
60 cargo build
--release
--lib
61 rsync
-a debian Makefile defines.mk Cargo.toml Cargo.lock \
64 $(foreach i
,$(SUBDIRS
), \
65 $(MAKE
) -C build
/$(i
) clean ;)
67 .PHONY
: proxmox-backup-docs
68 proxmox-backup-docs
: $(DOC_DEB
)
70 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
76 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
82 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
88 $(foreach i
,$(SUBDIRS
), \
89 $(MAKE
) -C
$(i
) clean ;)
91 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
92 find .
-name
'*~' -exec
rm {} ';'
98 # make sure we build binaries before docs
103 cargo build
$(CARGO_BUILD_ARGS
)
105 $(COMPILED_BINS
): cargo-build
109 cargo clippy
-- -A clippy
::all -D clippy
::correctness
111 install: $(COMPILED_BINS
)
112 install -dm755
$(DESTDIR
)$(BINDIR
)
113 $(foreach i
,$(USR_BIN
), \
114 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
115 install -dm755
$(DESTDIR
)$(SBINDIR
)
116 $(foreach i
,$(USR_SBIN
), \
117 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ;)
118 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
119 $(foreach i
,$(SERVICE_BIN
), \
120 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
121 $(MAKE
) -C www
install
122 $(MAKE
) -C docs
install
126 # check if working directory is clean
127 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
128 tar cf
- ${DEBS} | ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist buster