Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566# panels — top-level build. Builds each vendored package in a container and# exports its tree into ./.local (bin/ lib/ libexec/ share/ include/).## Backend: docker (or podman if docker missing). Uses buildkit.# Layout: Sources/packages/<name>/{Containerfile, package.toml, fetch/}# Sources/<name> vendored subtree (source of truth)## Targets:# make build base + all packages + export into ./.local# make base build the toolchain image panels/base:local# make build-<pkg> stage vendored source + build panels/<pkg>:local# make export-<pkg> docker-cp panels/<pkg>:local /rootfs -> ./.local# make export export every package image# make clean remove fetch/src staging + ./.local# make list show discovered packages
BUILDER ?= $(shell command -v docker || command -v podman)PROGRESS ?= autoLOCAL := $(CURDIR)/.localPKGS_DIR := Sources/packages
# All packages that have a Containerfile.PKGS := $(notdir $(patsubst %/,%,$(dir $(wildcard $(PKGS_DIR)/*/Containerfile))))# `base` is the toolchain image, never exported to ./.localEXPORTABLE := $(filter-out base,$(PKGS))
.DEFAULT_GOAL := all
.PHONY: all base export clean help list
all: base $(addprefix build-,$(EXPORTABLE)) export
base: @echo "==> build panels/base:local" $(BUILDER) build --progress=$(PROGRESS) -t panels/base:local \ -f $(PKGS_DIR)/base/Containerfile $(PKGS_DIR)/base
# Generate explicit per-package build + export rules (avoids pattern-rule/phony# matching surprises).define PKG_RULES.PHONY: build-$(1) export-$(1)build-$(1): base @echo "==> build panels/$(1):local" @mkdir -p $(PKGS_DIR)/$(1)/fetch rm -rf $(PKGS_DIR)/$(1)/fetch/src cp -a Sources/$(1) $(PKGS_DIR)/$(1)/fetch/src $(BUILDER) build --progress=$(PROGRESS) -t panels/$(1):local \ -f $(PKGS_DIR)/$(1)/Containerfile $(PKGS_DIR)/$(1)export-$(1): build-$(1) @echo "==> export $(1) -> $(LOCAL)" sh $(PKGS_DIR)/export.sh $(BUILDER) panels/$(1):local $(LOCAL)endef$(foreach p,$(EXPORTABLE),$(eval $(call PKG_RULES,$(p))))
export: $(addprefix export-,$(EXPORTABLE))
list: @echo "packages: $(PKGS)"
clean: rm -rf $(LOCAL) rm -rf $(PKGS_DIR)/*/fetch/src
help: @$(MAKE) -pRrq -f Makefile : 2>/dev/null | awk -v RS= -v ORS='' '/^# File|^# Makefile|^[a-zA-Z][a-zA-Z0-9_-]*:/ && !/^\# Not a target/' | head -40