2019-01-31 15:43:09 +03:00
i n c l u d e d e f i n e s . m k
2018-11-30 15:39:40 +03:00
2018-12-01 15:44:13 +03:00
ARCH := $( shell dpkg-architecture -qDEB_BUILD_ARCH)
GITVERSION := $( shell git rev-parse HEAD)
2019-01-31 15:43:09 +03:00
# Binaries usable by users
USR_BIN := \
proxmox-backup-client \
catar
# Binaries usable by admins
USR_SBIN := proxmox-backup-manager
# Binaries for services:
SERVICE_BIN := \
proxmox-backup-api \
proxmox-backup-proxy
COMPILEDIR := target/release
COMPILED_BINS := \
$( addprefix $( COMPILEDIR) /,$( USR_BIN) $( USR_SBIN) $( SERVICE_BIN) )
2018-12-05 16:38:37 +03:00
export PROXMOX_PKG_VERSION = ${ PKGVER }
export PROXMOX_PKG_RELEASE = ${ PKGREL }
export PROXMOX_PKG_REPOID = ${ GITVERSION }
2018-12-01 15:44:13 +03:00
2019-01-31 15:43:09 +03:00
export PROXMOX_JSDIR := $( JSDIR)
2018-12-01 15:44:13 +03:00
DEB = ${ PACKAGE } _${ PKGVER } -${ PKGREL } _${ ARCH } .deb
DESTDIR =
2018-11-30 15:39:40 +03:00
2018-12-05 16:38:37 +03:00
all :
cargo build
2018-11-30 15:39:40 +03:00
2018-12-19 15:54:22 +03:00
test :
cargo test
2018-12-01 15:44:13 +03:00
.PHONY : deb
deb ${DEB} :
2018-11-30 15:39:40 +03:00
rm -rf build
# build here to cache results
cargo build --release
2019-01-31 15:43:09 +03:00
$( MAKE) -C www
rsync -a debian Cargo.toml src www etc target build
2018-11-30 15:39:40 +03:00
cd build; dpkg-buildpackage -b -us -uc
2018-12-01 15:44:13 +03:00
distclean : clean
2018-11-30 15:39:40 +03:00
clean :
2019-01-31 15:43:09 +03:00
$( MAKE) -C www clean
2018-11-30 15:39:40 +03:00
cargo clean
2018-11-30 19:09:50 +03:00
rm -rf *.deb *.buildinfo *.changes build
find . -name '*~' -exec rm { } ';'
2018-12-01 15:44:13 +03:00
.PHONY : dinstall
dinstall : ${DEB }
dpkg -i ${ DEB }
2019-01-31 15:43:09 +03:00
.PHONY : build -release
build-release :
cargo build --release
$(COMPILED_BINS) : build -release
install : $( COMPILED_BINS )
install -dm755 $( DESTDIR) $( BINDIR)
$( foreach i,$( USR_BIN) , \
install -m755 $( COMPILEDIR) /$( i) $( DESTDIR) $( BINDIR) / ; )
install -dm755 $( DESTDIR) $( SBINDIR)
$( foreach i,$( USR_SBIN) , \
install -m755 $( COMPILEDIR) /$( i) $( DESTDIR) $( SBINDIR) / ; )
install -dm755 $( DESTDIR) $( LIBDIR) /proxmox-backup
$( foreach i,$( SERVICE_BIN) , \
install -m755 $( COMPILEDIR) /$( i) $( DESTDIR) $( LIBDIR) /proxmox-backup/ ; )
$( MAKE) -C www install