]>
Commit | Line | Data |
---|---|---|
e5f30e2e TL |
1 | include /usr/share/dpkg/pkg-info.mk |
2 | include /usr/share/dpkg/architecture.mk | |
61b8223f | 3 | |
e5f30e2e | 4 | PACKAGE=pmg-log-tracker |
61b8223f | 5 | |
e5f30e2e | 6 | GITVERSION:=$(shell git rev-parse HEAD) |
61b8223f | 7 | |
e5f30e2e | 8 | DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb |
0594496c | 9 | DSC=rust-${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc |
839951d6 | 10 | |
e029c60d WB |
11 | ifeq ($(BUILD_MODE), release) |
12 | CARGO_BUILD_ARGS += --release | |
13 | COMPILEDIR := target/release | |
14 | else | |
15 | COMPILEDIR := target/debug | |
16 | endif | |
839951d6 | 17 | |
e029c60d WB |
18 | all: cargo-build $(SUBDIRS) |
19 | ||
20 | .PHONY: cargo-build | |
21 | cargo-build: | |
22 | cargo build $(CARGO_BUILD_ARGS) | |
23 | ||
24 | .PHONY: build | |
25 | build: | |
26 | rm -rf build | |
27 | debcargo package \ | |
28 | --config debian/debcargo.toml \ | |
29 | --changelog-ready \ | |
30 | --no-overlay-write-back \ | |
31 | --directory build \ | |
32 | $(PACKAGE) \ | |
33 | $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//') | |
34 | rm build/Cargo.lock | |
35 | find build/debian -name "*.hint" -delete | |
839951d6 | 36 | |
61b8223f | 37 | .PHONY: deb |
e029c60d WB |
38 | deb: $(DEB) |
39 | $(DEB): build | |
40 | cd build; dpkg-buildpackage -b -us -uc --no-pre-clean --build-profiles=nodoc | |
41 | lintian $(DEB) | |
61b8223f | 42 | |
e5f30e2e | 43 | .PHONY: dsc |
e029c60d WB |
44 | dsc: $(DSC) |
45 | $(DSC): build | |
46 | cd build; dpkg-buildpackage -S -us -uc -d -nc | |
47 | lintian $(DSC) | |
e5f30e2e | 48 | |
61b8223f DM |
49 | .PHONY: dinstall |
50 | dinstall: ${DEB} | |
51 | dpkg -i ${DEB} | |
52 | ||
53 | .PHONY: upload | |
54 | upload: ${DEB} ${DBG_DEB} | |
e5f30e2e | 55 | tar cf - ${DEB} ${DBG_DEB}| ssh repoman@repo.proxmox.com -- upload --product pmg --dist stretch --arch ${DEB_BUILD_ARCH} |
839951d6 | 56 | |
c41a37e8 DM |
57 | .PHONY: distclean |
58 | distclean: clean | |
839951d6 | 59 | |
c41a37e8 DM |
60 | .PHONY: clean |
61 | clean: | |
813c4657 | 62 | rm -rf *.deb ${PACKAGE}-* *.buildinfo *.changes *.dsc rust-${PACKAGE}_*.tar.?z build/ |
c41a37e8 | 63 | find . -name '*~' -exec rm {} ';' |