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
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
)
36 export PROXMOX_CONFIGDIR
:= $(SYSCONFDIR
)/proxmox-backup
38 DEB
=${PACKAGE}_
${PKGVER}-${PKGREL}_
${ARCH}.deb
39 DSC
=${PACKAGE}_
${PKGVER}-${PKGREL}.dsc
43 all: cargo-build
$(SUBDIRS
)
50 cargo
test $(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 rsync
-a debian Makefile defines.mk Cargo.toml src
$(SUBDIRS
) build
/
61 test -d target
&& rsync
-a target build
/ || true
62 $(foreach i
,$(SUBDIRS
), \
63 $(MAKE
) -C build
/$(i
) clean ;)
68 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
74 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
80 $(foreach i
,$(SUBDIRS
), \
81 $(MAKE
) -C
$(i
) clean ;)
83 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
84 find .
-name
'*~' -exec
rm {} ';'
90 # make sure we build binaries before docs
95 cargo build
$(CARGO_BUILD_ARGS
)
97 $(COMPILED_BINS
): cargo-build
99 install: $(COMPILED_BINS
)
100 install -dm755
$(DESTDIR
)$(BINDIR
)
101 $(foreach i
,$(USR_BIN
), \
102 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
103 install -dm755
$(DESTDIR
)$(SBINDIR
)
104 $(foreach i
,$(USR_SBIN
), \
105 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ;)
106 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
107 $(foreach i
,$(SERVICE_BIN
), \
108 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
109 $(MAKE
) -C www
install
110 $(MAKE
) -C docs
install