]> git.proxmox.com Git - pve-lxc-syscalld.git/blame - Makefile
bump version to 0.9.2-1
[pve-lxc-syscalld.git] / Makefile
CommitLineData
641af2dd
WB
1include /usr/share/dpkg/architecture.mk
2include /usr/share/dpkg/pkg-info.mk
3
4include defines.mk
5
6GITVERSION:=$(shell git rev-parse HEAD)
7
8SUBDIRS := etc
9
10ifeq ($(BUILD_MODE), release)
11CARGO_BUILD_ARGS += --release
12COMPILEDIR := target/release
13else
14COMPILEDIR := target/debug
15endif
16
17SERVICE_BIN := pve-lxc-syscalld
18
19COMPILED_BINS := \
20 $(addprefix $(COMPILEDIR)/,$(SERVICE_BIN))
21
439edd6e
WB
22DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
23DSC=rust-$(PACKAGE)_$(DEB_VERSION).dsc
641af2dd
WB
24
25all: cargo-build $(SUBDIRS)
26
27.PHONY: $(SUBDIRS)
28$(SUBDIRS):
29 $(MAKE) -C $@
30
31.PHONY: cargo-build
32cargo-build:
33 cargo build $(CARGO_BUILD_ARGS)
34
2bf7e188
WB
35.PHONY: test
36test:
4b827823 37 cargo test $(CARGO_BUILD_ARGS)
3510be76
WB
38
39.PHONY: check
40check: test
41
42.PHONY: san
43san:
44 cargo +nightly fmt -- --check
2f7071e0 45 cargo clippy
3510be76 46 cargo test
2bf7e188 47
641af2dd
WB
48$(COMPILED_BINS): cargo-build
49
50install: $(COMPILED_BINS)
31d748b3 51 install -dm755 $(DESTDIR)$(LIBEXECDIR)/pve-lxc-syscalld
641af2dd 52 $(foreach i,$(SERVICE_BIN), \
31d748b3 53 install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/pve-lxc-syscalld/ ;)
641af2dd 54
439edd6e
WB
55.PHONY: build
56build:
57 rm -rf build
58 debcargo package \
59 --config debian/debcargo.toml \
60 --changelog-ready \
61 --no-overlay-write-back \
62 --directory build \
63 pve-lxc-syscalld \
64 $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//')
65 sed -e '1,/^$$/ ! d' build/debian/control > build/debian/control.src
66 cat build/debian/control.src build/debian/control.in > build/debian/control
67 rm build/debian/control.in build/debian/control.src
68 rm build/Cargo.lock
69 find build/debian -name "*.hint" -delete
6318298d 70 echo system >build/rust-toolchain
641af2dd 71 $(foreach i,$(SUBDIRS), \
439edd6e 72 $(MAKE) -C build/$(i) clean ;)
641af2dd
WB
73
74.PHONY: deb
be1da45a
WB
75deb: $(DEB)
76$(DEB): build
439edd6e 77 cd build; dpkg-buildpackage -b -us -uc --no-pre-clean --build-profiles=nodoc
be1da45a 78 lintian $(DEB)
641af2dd
WB
79
80.PHONY: dsc
81dsc: $(DSC)
439edd6e
WB
82$(DSC): build
83 cd build; dpkg-buildpackage -S -us -uc -d -nc
641af2dd
WB
84 lintian $(DSC)
85
64a9f93c
WB
86.PHONY: dinstall
87dinstall:
88 $(MAKE) deb
89 sudo -k dpkg -i $(DEB)
90
641af2dd
WB
91clean:
92 $(foreach i,$(SUBDIRS), \
93 $(MAKE) -C $(i) clean ;)
94 cargo clean
439edd6e 95 rm -rf *.deb *.dsc *.tar.gz *.buildinfo *.changes build