stagex/Makefile

56 lines
1.2 KiB
Makefile
Raw Normal View History

2023-12-12 17:45:39 +00:00
export PLATFORM := linux/amd64
2023-12-10 18:05:50 +00:00
export BUILDER := $(shell which docker)
2024-02-08 17:09:58 +00:00
export REGISTRY_LOCAL := stagex-local
export REGISTRY_REMOTE := stagex
2024-01-30 00:23:48 +00:00
export NOCACHE ?= 0
2024-01-28 10:24:33 +00:00
export MIRRORS := \
2024-01-30 00:23:48 +00:00
git.distrust.co \
hub.docker.com
ifeq ($(NOCACHE), 1)
NOCACHE_FLAG=--no-cache
else
NOCACHE_FLAG=
endif
export NOCACHE_FLAG
2023-12-12 17:45:39 +00:00
clean_logs := $(shell rm *.log 2>&1 >/dev/null || :)
include src/macros.mk
2024-02-08 17:09:58 +00:00
include src/packages.mk
2024-02-13 16:18:14 +00:00
include src/groups.mk
2024-02-13 16:56:08 +00:00
src/packages.mk: out/sxctl/index.json $(shell find packages/*/Containerfile | tr '\n' ' ')
env -C out/sxctl tar -cf - . | docker load
docker run \
--rm \
--volume .:/src \
--user $(shell id -u):$(shell id -g) \
stagex/sxctl -baseDir=/src gen make
2024-02-13 15:43:23 +00:00
touch $@
2023-12-12 17:45:39 +00:00
DEFAULT_GOAL := default
.PHONY: default
default: compat digests.txt
2024-02-12 21:41:51 +00:00
.PHONY: all
all: $(shell find src/*/* -type d -exec sh -c 'basename {} | tr "\n" " "' \; )
2023-12-15 20:32:54 +00:00
2024-02-09 06:28:41 +00:00
.PHONY: compat
compat:
./src/compat.sh
.PHONY: digests
digests:
@for each in $$(find out -iname "index.json"| sort); do \
printf \
2024-02-10 10:53:50 +00:00
"%s %s\n" \
$$(cat $$each | jq -r '.manifests[].digest | sub ("sha256:";"")') \
"$$(basename $$(dirname $$each))"; \
2024-02-09 06:28:41 +00:00
done
digests.txt: all
mv $@ .$@.old
$(MAKE) digests > $@
diff $@.old $@
out/graph.svg: Makefile
2023-12-15 20:32:54 +00:00
$(MAKE) -Bnd | make2graph | dot -Tsvg -o graph.svg