-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (57 loc) · 1.63 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
PACKAGE=proxmox-resource-scheduling
BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
BUILDDIR_TMP ?= $(BUILDDIR).tmp
DEB=librust-$(PACKAGE)-dev_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
DSC=rust-$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
ifeq ($(BUILD_MODE), release)
CARGO_BUILD_ARGS += --release
COMPILEDIR := target/release
else
COMPILEDIR := target/debug
endif
all: cargo-build $(SUBDIRS)
.PHONY: cargo-build
cargo-build:
cargo build $(CARGO_BUILD_ARGS)
.PHONY: build
build:
rm -rf $(BUILDDIR) $(BUILDDIR_TMP); mkdir $(BUILDDIR_TMP)
rm -f debian/control
debcargo package \
--config debian/debcargo.toml \
--changelog-ready \
--no-overlay-write-back \
--directory $(BUILDDIR_TMP) \
$(PACKAGE) \
$(DEB_VERSION_UPSTREAM)
cp $(BUILDDIR_TMP)/debian/control debian/control
rm -f $(BUILDDIR_TMP)/Cargo.lock
find $(BUILDDIR_TMP)/debian -name "*.hint" -delete
mv $(BUILDDIR_TMP) $(BUILDDIR)
.PHONY: deb
deb: $(DEB)
$(DEB): build
cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
lintian $(DEB)
.PHONY: dsc
dsc: $(DSC)
$(DSC): build
cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
lintian $(DSC)
sbuild: $(DSC)
sbuild $(DSC)
.PHONY: dinstall
dinstall: $(DEB)
dpkg -i $(DEB)
.PHONY: upload
upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
upload: $(DEB)
tar cf - $(DEB) | ssh -X [email protected] -- upload --product devel --dist $(UPLOAD_DIST) --arch $(DEB_BUILD_ARCH)
.PHONY: distclean
distclean: clean
.PHONY: clean
clean:
cargo clean
rm -rf *.deb *.buildinfo *.changes *.dsc *.build rust-$(PACKAGE)_*.tar.?z $(BUILDDIR) $(BUILDDIR_TMP)