]> git.r.bdr.sh - rbdr/lyricli/blame_incremental - Makefile
Remove the openssl stuff
[rbdr/lyricli] / 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 := lrc
5long_app_name := lyricli
6host_architecture := $(target)
7
8default: build
9
10set_rust:
11 rustup default stable
12
13prepare:
14 rustup target add $(target)
15
16build: prepare
17# I need an actually configurable way to make this work. Right now i'm only
18# cross compiling in the CI, and I know what I'm running, but
19ifeq ($(host_architecture), x86_64-unknown-linux-gnu)
20ifeq ($(target), aarch64-unknown-linux-gnu)
21 LD_LIBRARY_PATH=/usr/local/aarch64-linux-gnu/lib:${LD_LIBRARY_PATH}
22endif
23endif
24 @export $$(cat .env | xargs) > /dev/null 2>&1 && cargo build --profile $(profile) --target $(target)
25
26release: rpm tar deb
27 @$(eval filename := $(app_name)-$(target)-$(channel))
28
29$(architectures):
30ifneq ($(channel),)
31 $(MAKE) -e channel=$(channel) -e target=$@ release
32else
33 $(MAKE) -e target=$@ build
34endif
35
36deb: build
37ifeq ($(findstring linux,$(target)),linux)
38 @$(eval filename := $(app_name)-$(target)-$(channel))
39 @export $$(cat .env | xargs) > /dev/null 2>&1 && cargo deb --profile $(profile) --target $(target)
40 mv target/$(target)/debian/*.deb $(filename).deb
41 sha256sum $(filename).deb > $(filename).deb.sha256
42 rsync -avz $(filename).deb deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
43 rsync -avz $(filename).deb.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
44endif
45
46rpm: build
47ifeq ($(findstring linux,$(target)),linux)
48 @$(eval filename := $(app_name)-$(target)-$(channel))
49 @export $$(cat .env | xargs) > /dev/null 2>&1 && cargo generate-rpm --profile $(profile) --target $(target)
50 mv target/$(target)/generate-rpm/*.rpm $(filename).rpm
51 sha256sum $(filename).rpm > $(filename).rpm.sha256
52 rsync -avz $(filename).rpm deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
53 rsync -avz $(filename).rpm.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
54endif
55
56tar: build
57 @$(eval filename := $(app_name)-$(target)-$(channel))
58 tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name)
59 sha256sum $(filename).tar.gz > $(filename).tar.gz.sha256
60 rsync -avz $(filename).tar.gz deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
61 rsync -avz $(filename).tar.gz.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(long_app_name)
62
63package: $(architectures)
64
65mac:
66 @$(eval mac_architectures := x86_64-apple-darwin aarch64-apple-darwin)
67ifeq ($(tag),)
68 $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=unstable package
69else
70 $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=$(tag) package
71endif
72
73
74ci:
75ifeq ($(GIT_REF),refs/heads/main)
76 $(MAKE) -e profile=release -e channel=unstable $(target)
77else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
78 $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) $(target)
79endif
80
81.PHONY: default build $(architectures) rpm package prepare set_rust ci release