]> git.proxmox.com Git - pmg-log-tracker.git/blame - Makefile
buildsys: only get git revision if actually used
[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
1bd70412
SI
6DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb
7DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb
8DSC=rust-$(PACKAGE)_$(DEB_VERSION).dsc
839951d6 9
e029c60d
WB
10ifeq ($(BUILD_MODE), release)
11CARGO_BUILD_ARGS += --release
12COMPILEDIR := target/release
13else
14COMPILEDIR := target/debug
15endif
839951d6 16
e029c60d
WB
17all: cargo-build $(SUBDIRS)
18
19.PHONY: cargo-build
20cargo-build:
21 cargo build $(CARGO_BUILD_ARGS)
22
23.PHONY: build
24build:
25 rm -rf build
ea087800 26 rm -rf debian/control
e029c60d
WB
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
ea087800 36 cp build/debian/control debian/control
62a47d34 37 echo "git clone git://git.proxmox.com/git/pmg-log-tracker.git\\ngit checkout $(shell git rev-parse HEAD)" > build/debian/SOURCE
839951d6 38
61b8223f 39.PHONY: deb
e029c60d 40deb: $(DEB)
cc80c54d 41$(DEB) $(DBG_DEB): build
e029c60d
WB
42 cd build; dpkg-buildpackage -b -us -uc --no-pre-clean --build-profiles=nodoc
43 lintian $(DEB)
61b8223f 44
e5f30e2e 45.PHONY: dsc
e029c60d 46dsc: $(DSC)
5ed9f5ca
SI
47 $(MAKE) $(DSC)
48 lintian $(DSC)
49
e029c60d
WB
50$(DSC): build
51 cd build; dpkg-buildpackage -S -us -uc -d -nc
5ed9f5ca
SI
52
53.PHONY: sbuild
54sbuild: $(DSC)
55 sbuild $(DSC)
e5f30e2e 56
61b8223f 57.PHONY: dinstall
71e42fc1
TL
58dinstall: $(DEB)
59 dpkg -i $(DEB)
61b8223f
DM
60
61.PHONY: upload
71e42fc1
TL
62upload: $(DEB) $(DBG_DEB)
63 tar cf - $(DEB) $(DBG_DEB)| ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist bullseye --arch $(DEB_BUILD_ARCH)
839951d6 64
c41a37e8
DM
65.PHONY: distclean
66distclean: clean
839951d6 67
c41a37e8
DM
68.PHONY: clean
69clean:
5ed9f5ca 70 rm -rf *.deb $(PACKAGE)-* *.buildinfo *.changes *.dsc rust-$(PACKAGE)_*.tar.?z build/ *build
c41a37e8 71 find . -name '*~' -exec rm {} ';'