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