]>
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 | |
43780806 | 4 | app_name := blog |
d620665f RBR |
5 | |
6 | default: build | |
7 | ||
5c7a9258 RBR |
8 | set_rust: |
9 | rustup default stable | |
10 | ||
a04ba49c RBR |
11 | prepare: |
12 | rustup target add $(target) | |
d620665f | 13 | |
a04ba49c RBR |
14 | build: prepare |
15 | cargo build --profile $(profile) --target $(target) | |
16 | ||
43780806 | 17 | release: rpm tar |
4dfd8d3d RBR |
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) | |
7a481daf | 20 | rsync -avz $(filename).rpm deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) |
c4b892b1 | 21 | |
a04ba49c | 22 | $(architectures): |
c4b892b1 RBR |
23 | ifneq ($(channel),) |
24 | $(MAKE) -e channel=$(channel) -e target=$@ release | |
43780806 RBR |
25 | else |
26 | $(MAKE) -e target=$@ build | |
c4b892b1 | 27 | endif |
a04ba49c RBR |
28 | |
29 | rpm: build | |
57351e33 | 30 | cargo generate-rpm --profile $(profile) --target $(target) |
a04ba49c | 31 | |
43780806 | 32 | tar: build |
4dfd8d3d RBR |
33 | @$(eval filename := $(app_name)-$(target)-$(channel)) |
34 | tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name) | |
43780806 | 35 | |
a04ba49c RBR |
36 | package: $(architectures) |
37 | ||
c4b892b1 RBR |
38 | ci: |
39 | ifeq ($(GIT_REF),refs/heads/main) | |
b12f5ad8 | 40 | $(MAKE) -e profile=release -e channel=unstable package |
c4b892b1 | 41 | else ifneq (,$(findstring refs/tags/,$(GIT_REF))) |
b12f5ad8 | 42 | $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package |
c4b892b1 RBR |
43 | endif |
44 | ||
45 | .PHONY: default build $(architectures) rpm package prepare set_rust ci release |