3 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
4 GITVERSION
:=$(shell git rev-parse HEAD
)
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
29 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
))
31 export PROXMOX_PKG_VERSION
=${PKGVER}
32 export PROXMOX_PKG_RELEASE
=${PKGREL}
33 export PROXMOX_PKG_REPOID
=${GITVERSION}
35 export PROXMOX_JSDIR
:= $(JSDIR
)
37 DEB
=${PACKAGE}_
${PKGVER}-${PKGREL}_
${ARCH}.deb
38 DSC
=${PACKAGE}_
${PKGVER}-${PKGREL}.dsc
42 all: cargo-build
$(SUBDIRS
)
49 cargo
test $(CARGO_BUILD_ARGS
)
51 # always re-create this dir
52 # but also copy the local target/ dir as a build-cache
56 rsync
-a debian Makefile defines.mk Cargo.toml src
$(SUBDIRS
) build
/
57 test -d target
&& rsync
-a target build
/ || true
62 cd build
; dpkg-buildpackage
-b
-us
-uc
68 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
76 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
77 find .
-name
'*~' -exec
rm {} ';'
85 cargo build
$(CARGO_BUILD_ARGS
)
87 $(COMPILED_BINS
): cargo-build
89 install: $(COMPILED_BINS
)
90 install -dm755
$(DESTDIR
)$(BINDIR
)
91 $(foreach i
,$(USR_BIN
), \
92 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
93 install -dm755
$(DESTDIR
)$(SBINDIR
)
94 $(foreach i
,$(USR_SBIN
), \
95 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ;)
96 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
97 $(foreach i
,$(SERVICE_BIN
), \
98 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
99 $(MAKE
) -C www
install