]>
Commit | Line | Data |
---|---|---|
a04ba49c RBR |
1 | profile := dev |
2 | target = $(shell rustc -vV | grep host | awk '{print $$2}') | |
3 | architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu | |
d620665f RBR |
4 | |
5 | default: build | |
6 | ||
5c7a9258 RBR |
7 | set_rust: |
8 | rustup default stable | |
9 | ||
a04ba49c RBR |
10 | prepare: |
11 | rustup target add $(target) | |
d620665f | 12 | |
a04ba49c RBR |
13 | build: prepare |
14 | cargo build --profile $(profile) --target $(target) | |
15 | ||
c4b892b1 | 16 | release: |
b6798535 | 17 | @echo "Releasing target/$(target)/$(profile) to $(channel)" |
c4b892b1 | 18 | |
a04ba49c RBR |
19 | $(architectures): |
20 | $(MAKE) -e target=$@ rpm | |
c4b892b1 RBR |
21 | ifneq ($(channel),) |
22 | $(MAKE) -e channel=$(channel) -e target=$@ release | |
23 | endif | |
a04ba49c RBR |
24 | |
25 | rpm: build | |
26 | ||
27 | package: $(architectures) | |
28 | ||
c4b892b1 RBR |
29 | ci: |
30 | ifeq ($(GIT_REF),refs/heads/main) | |
31 | @$(eval channel=unstable) | |
32 | else ifneq (,$(findstring refs/tags/,$(GIT_REF))) | |
33 | @$(eval channel=$(subst refs/tags/,,$(GIT_REF))) | |
34 | endif | |
35 | ifneq ($(channel),) | |
d62c4ea8 | 36 | $(MAKE) -e profile=release -e channel=$(channel) package |
5fecbf65 RBR |
37 | else |
38 | @echo "Channel was $(channel)" | |
c4b892b1 RBR |
39 | endif |
40 | ||
41 | .PHONY: default build $(architectures) rpm package prepare set_rust ci release |