# Red Bear OS integration — runs before repo cook and disk image creation # Ensures all custom recipe symlinks, patches, assets, and firmware are staged. REDBEAR_TAG=$(BUILD)/redbear.tag REDBEAR_FP=$(REDBEAR_TAG).fp REDBEAR_INPUTS = local/scripts/integrate-redbear.sh local/recipes local/Assets local/firmware # FORCE is retained so Make evaluates this recipe on every build. The fingerprint # check inside the recipe decides whether the expensive integration actually # runs. Removing FORCE would break detection of newly-added files under # local/recipes/ because Make's mtime model cannot track directory-tree growth. $(REDBEAR_TAG): FORCE ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) make $@ else @current=$$(find $(REDBEAR_INPUTS) -type f -printf '%P %s %T@\n' 2>/dev/null | sort | sha256sum | cut -d' ' -f1); \ stored=""; \ if [ -f "$(REDBEAR_FP)" ]; then stored=$$(cat "$(REDBEAR_FP)" 2>/dev/null); fi; \ if [ "$$current" = "$$stored" ] && [ -f "$@" ]; then \ touch "$@"; \ else \ echo "Red Bear: integration inputs changed (or first run), executing integrate-redbear.sh..."; \ bash -c 'export REDBEAR_TAG="$$1"; exec bash local/scripts/integrate-redbear.sh' _ '$(REDBEAR_TAG)'; \ echo "$$current" > "$(REDBEAR_FP)"; \ fi endif redbear: $(REDBEAR_TAG) redbear_clean: rm -f "$(REDBEAR_TAG)" "$(REDBEAR_FP)" # Source archival — exports versioned source archives # for all recipes with source/ directories to sources// # Runs after `make all` and also standalone via `make sources` SOURCES_DIR=$(BUILD)/../sources/$(TARGET) SOURCES_TAG=$(SOURCES_DIR)/.sources-tag # Standalone: archive what's cached (no rebuild needed) sources: @echo "Archiving source packages..." bash local/scripts/archive-sources.sh --all @mkdir -p "$(SOURCES_DIR)" @touch "$(SOURCES_TAG)" @echo "Sources archived: $$(wc -l < $(SOURCES_DIR)/packages.txt 2>/dev/null || echo 0) packages" # Hook: run after full build $(BUILD)/harddrive.img: sources FORCE: