]> git.r.bdr.sh - rbdr/page/blame - Makefile
Add build
[rbdr/page] / Makefile
CommitLineData
102424ed
RBR
1profile := dev
2target = $(shell rustc -vV | grep host | awk '{print $$2}')
3architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
4app_name := page
48ea9080
RBR
5
6default: build
7
102424ed
RBR
8set_rust:
9 rustup default stable
48ea9080 10
102424ed
RBR
11prepare:
12 rustup target add $(target)
13
14build: prepare
15 cargo build --profile $(profile) --target $(target)
16
17release: rpm tar
18 rsync -avz $(app_name)-$(target)-$(channel).tar.gz deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
19
20$(architectures):
21ifneq ($(channel),)
22 $(MAKE) -e channel=$(channel) -e target=$@ release
23else
24 $(MAKE) -e target=$@ build
25endif
26
27rpm: build
28
29tar: build
30 tar -czvf $(app_name)-$(target)-$(channel).tar.gz -C target/$(target)/$(profile)/ $(app_name)
31
32package: $(architectures)
33
34ci:
35ifeq ($(GIT_REF),refs/heads/main)
36 $(MAKE) -e profile=release -e channel=unstable package
37else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
38 $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package
39endif
40
41.PHONY: default build $(architectures) rpm package prepare set_rust ci release