2 target = $(shell rustc -vV | grep host | awk '{print $$2}')
3 architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
5 long_app_name := lyricli
13 rustup target add $(target)
16 @export $$(cat .env | xargs) > /dev/null 2>&1 && cargo build --profile $(profile) --target $(target)
19 @$(eval filename := $(app_name)-$(target)-$(channel))
23 $(MAKE) -e channel=$(channel) -e target=$@ release
25 $(MAKE) -e target=$@ build
29 ifeq ($(findstring linux,$(target)),linux)
30 @$(eval filename := $(app_name)-$(target)-$(channel))
31 @export $$(cat .env | xargs) > /dev/null 2>&1 && cargo deb --profile $(profile) --target $(target)
32 mv target/$(target)/debian/*.deb $(filename).deb
33 sha256sum $(filename).deb > $(filename).deb.sha256
34 rsync -avz $(filename).deb deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
35 rsync -avz $(filename).deb.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
39 ifeq ($(findstring linux,$(target)),linux)
40 @$(eval filename := $(app_name)-$(target)-$(channel))
41 @export $$(cat .env | xargs) > /dev/null 2>&1 && cargo generate-rpm --profile $(profile) --target $(target)
42 mv target/$(target)/generate-rpm/*.rpm $(filename).rpm
43 sha256sum $(filename).rpm > $(filename).rpm.sha256
44 rsync -avz $(filename).rpm deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
45 rsync -avz $(filename).rpm.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
49 @$(eval filename := $(app_name)-$(target)-$(channel))
50 tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name)
51 sha256sum $(filename).tar.gz > $(filename).tar.gz.sha256
52 rsync -avz $(filename).tar.gz deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
53 rsync -avz $(filename).tar.gz.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
55 package: $(architectures)
58 override architectures := x86_64-apple-darwin aarch64-apple-darwin
60 $(MAKE) -e profile=release -e architectures='$(architectures)' -e channel=unstable package
62 $(MAKE) -e profile=release -e architectures='$(architectures)' -e channel=$(tag) package
67 ifeq ($(GIT_REF),refs/heads/main)
68 $(MAKE) -e profile=release -e channel=unstable package
69 else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
70 $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package
73 .PHONY: default build $(architectures) rpm package prepare set_rust ci release