improve Makefile

This commit is contained in:
Dietmar Maurer 2018-12-01 13:44:13 +01:00
parent f4c514c13d
commit 209bb43336
1 changed files with 14 additions and 2 deletions

View File

@ -1,14 +1,22 @@
VERSION=0.1
PACKAGE=api-test-server PACKAGE=api-test-server
PKGVER=0.1
PKGREL=1 PKGREL=1
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
GITVERSION:=$(shell git rev-parse HEAD)
DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
DESTDIR=
all: target/release/api-test-server all: target/release/api-test-server
target/release/api-test-server: target/release/api-test-server:
cargo build --release cargo build --release
deb: .PHONY: deb
deb ${DEB}:
rm -rf build rm -rf build
# build here to cache results # build here to cache results
cargo build --release cargo build --release
@ -16,9 +24,13 @@ deb:
cd build; dpkg-buildpackage -b -us -uc cd build; dpkg-buildpackage -b -us -uc
distclean: clean
clean: clean:
cargo clean cargo clean
rm -rf *.deb *.buildinfo *.changes build rm -rf *.deb *.buildinfo *.changes build
find . -name '*~' -exec rm {} ';' find . -name '*~' -exec rm {} ';'
.PHONY: dinstall
dinstall: ${DEB}
dpkg -i ${DEB}