2 target = $(shell rustc -vV | grep host | awk '{print $$2}')
3 architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
12 rustup target add $(target)
15 cargo build --profile $(profile) --target $(target)
18 @$(eval filename := $(app_name)-$(target)-$(channel))
22 $(MAKE) -e channel=$(channel) -e target=$@ release
24 $(MAKE) -e target=$@ build
28 @$(eval filename := $(app_name)-$(target)-$(channel))
29 cargo generate-rpm --profile $(profile) --target $(target)
30 mv target/$(target)/generate-rpm/*.rpm $(filename).rpm
31 sha256sum $(filename).rpm > $(filename).rpm.sha256
32 rsync -avz $(filename).rpm deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
33 rsync -avz $(filename).rpm.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
36 @$(eval filename := $(app_name)-$(target)-$(channel))
37 tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name)
38 sha256sum $(filename).tar.gz > $(filename).tar.gz.sha256
39 rsync -avz $(filename).tar.gz deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
40 rsync -avz $(filename).tar.gz.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name)
42 package: $(architectures)
45 ifeq ($(GIT_REF),refs/heads/main)
46 $(MAKE) -e profile=release -e channel=unstable package
47 else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
48 $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package
51 .PHONY: default build $(architectures) rpm package prepare set_rust ci release