1 include /usr
/share
/dpkg
/default.mk
4 PACKAGE
:= $(DEB_SOURCE
)
5 ARCH
:= $(DEB_BUILD_ARCH
)
7 SUBDIRS
:= etc www docs
9 # Binaries usable by users
11 proxmox-backup-client \
14 # Binaries usable by admins
15 USR_SBIN
:= proxmox-backup-manager
17 # Binaries for services:
22 ifeq ($(BUILD_MODE
), release
)
23 CARGO_BUILD_ARGS
+= --release
24 COMPILEDIR
:= target
/release
26 COMPILEDIR
:= target
/debug
29 ifeq ($(valgrind
), yes
)
30 CARGO_BUILD_ARGS
+= --features valgrind
36 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
))
38 DEBS
= ${PACKAGE}-server_
${DEB_VERSION}_
${ARCH}.deb
${PACKAGE}-client_
${DEB_VERSION}_
${ARCH}.deb
40 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
42 DSC
= ${PACKAGE}_
${DEB_VERSION}.dsc
46 all: cargo-build
$(SUBDIRS
)
53 #cargo test test_broadcast_future
54 #cargo test $(CARGO_BUILD_ARGS)
55 $(CARGO
) test $(tests
) $(CARGO_BUILD_ARGS
)
58 $(CARGO
) doc
--no-deps
$(CARGO_BUILD_ARGS
)
60 # always re-create this dir
64 rsync
-a debian Makefile defines.mk Cargo.toml \
67 $(foreach i
,$(SUBDIRS
), \
68 $(MAKE
) -C build
/$(i
) clean ;)
70 .PHONY
: proxmox-backup-docs
71 proxmox-backup-docs
: $(DOC_DEB
)
73 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
76 # copy the local target/ dir as a build-cache
80 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
86 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
92 $(foreach i
,$(SUBDIRS
), \
93 $(MAKE
) -C
$(i
) clean ;)
95 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
96 find .
-name
'*~' -exec
rm {} ';'
102 # make sure we build binaries before docs
107 $(CARGO
) build
$(CARGO_BUILD_ARGS
)
109 $(COMPILED_BINS
): cargo-build
113 cargo clippy
-- -A clippy
::all -D clippy
::correctness
115 install: $(COMPILED_BINS
)
116 install -dm755
$(DESTDIR
)$(BINDIR
)
117 $(foreach i
,$(USR_BIN
), \
118 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
119 install -dm755
$(DESTDIR
)$(SBINDIR
)
120 $(foreach i
,$(USR_SBIN
), \
121 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ;)
122 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
123 $(foreach i
,$(SERVICE_BIN
), \
124 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
125 $(MAKE
) -C www
install
126 $(MAKE
) -C docs
install
130 # check if working directory is clean
131 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
132 tar cf
- ${DEBS} | ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist buster