]> git.r.bdr.sh - rbdr/blog/blame_incremental - Makefile
Change PGP key
[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
4app_name := blog
5
6default: build
7
8set_rust:
9 rustup default stable
10
11prepare:
12 rustup target add $(target)
13
14build: prepare
15 cargo build --profile $(profile) --target $(target)
16
17release: rpm tar
18 @$(eval filename := $(app_name)-$(target)-$(channel))
19 rsync -avz $(filename).tar.gz deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
20 rsync -avz $(filename).asc deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
21
22$(architectures):
23ifneq ($(channel),)
24 $(MAKE) -e channel=$(channel) -e target=$@ release
25else
26 $(MAKE) -e target=$@ build
27endif
28
29rpm: build
30
31tar: build
32 @$(eval filename := $(app_name)-$(target)-$(channel))
33 tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name)
34 gpg --armor --output $(filename).asc --detach-sig $(filename).tar.gz
35
36package: $(architectures)
37
38ci:
39ifeq ($(GIT_REF),refs/heads/main)
40 $(MAKE) -e profile=release -e channel=unstable package
41else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
42 $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package
43endif
44
45.PHONY: default build $(architectures) rpm package prepare set_rust ci release