File indexing completed on 2024-03-24 05:11:08

0001 ARCH?=$(shell flatpak --default-arch)
0002 INSTALL_SOURCE?=--install-deps-from=flathub
0003 REPO=repo
0004 
0005 all: $(REPO)/config $(foreach file, $(wildcard *.*.*.json), $(subst .json,.app,$(file))) $(foreach file, $(wildcard *.*.*.remoteapp), $(subst .remoteapp,.app,$(file)))
0006 
0007 %.app: %.json
0008         flatpak-builder $(INSTALL_SOURCE) --force-clean --arch=$(ARCH) --ccache --repo=$(REPO) --subject="Build of $<, `date`" ${ARGS} ${EXPORT_ARGS} app $<
0009 
0010 %.app: %.remoteapp
0011         ./build.sh $<
0012 
0013 %.test: %.app
0014         flatpak-builder --run app $(subst .app,.json,$<) $(COMMAND)
0015 
0016 %.flatpak: %.app
0017         flatpak build-bundle ${REPO} $@ $*
0018 
0019 export:
0020         flatpak build-update-repo --prune --prune-depth=20 --generate-static-deltas $(REPO) ${EXPORT_ARGS}
0021 
0022 $(REPO)/config:
0023         ostree init --mode=archive-z2 --repo=$(REPO)
0024 
0025 remotes:
0026         flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo $(ARGS)
0027 
0028 check: $(REPO)/config $(foreach file, $(wildcard *.*.*.json), $(subst .json,.check,$(file)))
0029 
0030 %.check: %.json
0031         json-glib-validate $<
0032         flatpak-builder --force-clean --arch=$(ARCH) --download-only ${ARGS} app $<
0033 
0034 clean:
0035         rm -rf $(TMP) .flatpak-builder