aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRubén Beltrán del Río <jj@r.bdr.sh>2026-01-16 15:42:23 +0100
committerRubén Beltrán del Río <jj@r.bdr.sh>2026-01-16 21:02:47 +0100
commit90b12c34debaa4aa816d4e6862cdb4e39c7181e4 (patch)
tree5f7e6a78ca0d83542e9f56f456ded072cf969bc4 /Makefile
parent439cd0d998571506dd7971fe1e357d09cb2ff36e (diff)
Add flatpak building
Add flatpak
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 28 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index ae184c7..f179087 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@ architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
app_name := map
deploy_host := deploy@build.r.bdr.sh
deploy_path := /srv/http/build.r.bdr.sh/$(app_name)
+install_path := /usr/local/bin/$(app_name)
define sign_and_deploy
@./scripts/sign.sh "$(1)" "$(channel)" "$(architecture)"
@@ -17,11 +18,18 @@ set_rust:
rustup default stable
prepare:
+ifneq ($(skip_prepare),1)
rustup target add $(target)
+endif
+
+# Build ########################################################################
build: prepare
+ @$(eval target_dir := ./target/$(target)/$(profile)/map)
cargo build --profile $(profile) --target $(target)
+# Code Quality #################################################################
+
test:
cargo test
@@ -34,15 +42,15 @@ format:
lint:
cargo fmt -- --check && cargo clippy
+# Packaging ####################################################################
+
+package: $(architectures)
+
release: rpm tar deb
@$(eval filename := $(app_name)-$(target)-$(channel))
-$(architectures):
-ifneq ($(channel),)
- $(MAKE) -e channel=$(channel) -e target=$@ release
-else
- $(MAKE) -e target=$@ build
-endif
+flatpak:
+ @flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir ./build-aux/systems.tranquil.Map.yml
deb: build
ifeq ($(findstring linux,$(target)),linux)
@@ -65,15 +73,12 @@ tar: build
tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name)
@$(call sign_and_deploy,$(filename).tar.gz)
-package: $(architectures)
+# Distribution #################################################################
-mac:
- @$(eval mac_architectures := x86_64-apple-darwin aarch64-apple-darwin)
-ifeq ($(tag),)
- $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=unstable package
-else
- $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=$(tag) package
-endif
+install: build
+ @cp target/$(target)/$(profile)/ $(install_path)
+
+# CI ###########################################################################
ci: lint coverage
ifeq ($(GIT_REF),refs/heads/main)
@@ -82,4 +87,12 @@ else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
$(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package
endif
-.PHONY: default build $(architectures) rpm package prepare set_rust ci release test coverage format
+$(architectures):
+ifneq ($(channel),)
+ $(MAKE) -e channel=$(channel) -e target=$@ release
+else
+ $(MAKE) -e target=$@ build
+endif
+
+
+.PHONY: default build $(architectures) rpm package prepare set_rust ci release test coverage format flatpak