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