2025-12-12 15:42:25 +01:00
|
|
|
.PHONY: install uninstall \
|
|
|
|
|
build build-no-cache build-no-cache-all build-missing \
|
|
|
|
|
delete-volumes purge \
|
|
|
|
|
test test-unit test-e2e test-integration test-env-virtual test-env-nix \
|
|
|
|
|
setup setup-venv setup-nix
|
2025-12-05 19:32:42 +01:00
|
|
|
|
2025-12-11 14:48:36 +01:00
|
|
|
# Distro
|
|
|
|
|
# Options: arch debian ubuntu fedora centos
|
2025-12-12 12:15:40 +01:00
|
|
|
DISTROS ?= arch debian ubuntu fedora centos
|
2025-12-13 15:05:34 +01:00
|
|
|
PKGMGR_DISTRO ?= arch
|
|
|
|
|
export PKGMGR_DISTRO
|
2025-12-11 14:48:36 +01:00
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-11 14:48:36 +01:00
|
|
|
# Base images
|
2025-12-09 05:31:55 +01:00
|
|
|
# (kept for documentation/reference; actual build logic is in scripts/build)
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-09 05:31:55 +01:00
|
|
|
BASE_IMAGE_ARCH := archlinux:latest
|
|
|
|
|
BASE_IMAGE_DEBIAN := debian:stable-slim
|
|
|
|
|
BASE_IMAGE_UBUNTU := ubuntu:latest
|
|
|
|
|
BASE_IMAGE_FEDORA := fedora:latest
|
|
|
|
|
BASE_IMAGE_CENTOS := quay.io/centos/centos:stream9
|
2025-12-08 00:24:22 +01:00
|
|
|
|
2025-12-09 05:31:55 +01:00
|
|
|
# Make them available in scripts
|
|
|
|
|
export BASE_IMAGE_ARCH
|
|
|
|
|
export BASE_IMAGE_DEBIAN
|
|
|
|
|
export BASE_IMAGE_UBUNTU
|
|
|
|
|
export BASE_IMAGE_FEDORA
|
|
|
|
|
export BASE_IMAGE_CENTOS
|
2025-12-08 00:24:22 +01:00
|
|
|
|
2025-12-09 17:53:10 +01:00
|
|
|
# PYthon Unittest Pattern
|
|
|
|
|
TEST_PATTERN := test_*.py
|
|
|
|
|
export TEST_PATTERN
|
2025-12-12 22:59:46 +01:00
|
|
|
export PYTHONPATH := src
|
2025-12-09 17:53:10 +01:00
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-12 15:42:25 +01:00
|
|
|
# System install
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-12 15:42:25 +01:00
|
|
|
install:
|
|
|
|
|
@echo "Building and installing distro-native package-manager for this system..."
|
2025-12-12 21:30:03 +01:00
|
|
|
@bash scripts/installation/init.sh
|
2025-04-01 15:37:07 +02:00
|
|
|
|
2025-12-12 15:42:25 +01:00
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# PKGMGR setup
|
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# Default: keep current auto-detection behavior
|
|
|
|
|
setup: setup-nix setup-venv
|
|
|
|
|
|
2025-12-12 22:59:46 +01:00
|
|
|
# Explicit: developer setup (Python venv + shell RC + install)
|
2025-12-12 18:07:25 +01:00
|
|
|
setup-venv: setup-nix
|
2025-12-12 15:42:25 +01:00
|
|
|
@bash scripts/setup/venv.sh
|
|
|
|
|
|
|
|
|
|
# Explicit: Nix shell mode (no venv, no RC changes)
|
|
|
|
|
setup-nix:
|
|
|
|
|
@bash scripts/setup/nix.sh
|
|
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-09 05:31:55 +01:00
|
|
|
# Docker build targets (delegated to scripts/build)
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-12 12:15:40 +01:00
|
|
|
build:
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh --target virgin
|
|
|
|
|
@bash scripts/build/image.sh
|
|
|
|
|
|
2025-12-12 18:07:25 +01:00
|
|
|
build-missing-virgin:
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh --target virgin --missing
|
2025-12-12 18:07:25 +01:00
|
|
|
|
|
|
|
|
build-missing: build-missing-virgin
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh --missing
|
2025-12-12 12:15:40 +01:00
|
|
|
|
2025-12-05 22:33:49 +01:00
|
|
|
build-no-cache:
|
2025-12-12 16:40:21 +01:00
|
|
|
@bash scripts/build/image.sh --target virgin --no-cache
|
|
|
|
|
@bash scripts/build/image.sh --no-cache
|
2025-12-05 22:33:49 +01:00
|
|
|
|
2025-12-12 12:15:40 +01:00
|
|
|
build-no-cache-all:
|
|
|
|
|
@set -e; \
|
|
|
|
|
for d in $(DISTROS); do \
|
|
|
|
|
echo "=== build-no-cache: $$d ==="; \
|
2025-12-13 14:34:15 +01:00
|
|
|
PKGMGR_DISTRO="$$d" $(MAKE) build-no-cache; \
|
2025-12-12 12:15:40 +01:00
|
|
|
done
|
2025-12-08 13:35:20 +01:00
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-09 05:31:55 +01:00
|
|
|
# Test targets (delegated to scripts/test)
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
2025-12-08 01:40:36 +01:00
|
|
|
|
2025-12-09 16:18:15 +01:00
|
|
|
test-unit: build-missing
|
2025-12-10 21:09:18 +01:00
|
|
|
@bash scripts/test/test-unit.sh
|
2025-12-08 01:40:36 +01:00
|
|
|
|
2025-12-09 16:18:15 +01:00
|
|
|
test-integration: build-missing
|
2025-12-10 21:09:18 +01:00
|
|
|
@bash scripts/test/test-integration.sh
|
2025-12-08 11:43:39 +01:00
|
|
|
|
2025-12-09 16:18:15 +01:00
|
|
|
test-e2e: build-missing
|
2025-12-09 05:31:55 +01:00
|
|
|
@bash scripts/test/test-e2e.sh
|
2025-12-05 22:33:49 +01:00
|
|
|
|
2025-12-12 12:15:40 +01:00
|
|
|
test-env-virtual: build-missing
|
|
|
|
|
@bash scripts/test/test-env-virtual.sh
|
|
|
|
|
|
|
|
|
|
test-env-nix: build-missing
|
|
|
|
|
@bash scripts/test/test-env-nix.sh
|
|
|
|
|
|
2025-12-10 16:57:02 +01:00
|
|
|
# Combined test target for local + CI (unit + integration + e2e)
|
2025-12-12 12:15:40 +01:00
|
|
|
test: test-env-virtual test-unit test-integration test-e2e
|
2025-12-08 00:24:22 +01:00
|
|
|
|
2025-12-11 15:29:51 +01:00
|
|
|
delete-volumes:
|
2025-12-13 14:34:15 +01:00
|
|
|
@docker volume rm "pkgmgr_nix_store_${PKGMGR_DISTRO}" "pkgmgr_nix_cache_${PKGMGR_DISTRO}" || echo "No volumes to delete."
|
2025-12-11 15:29:51 +01:00
|
|
|
|
|
|
|
|
purge: delete-volumes build-no-cache
|
|
|
|
|
|
2025-12-08 00:24:22 +01:00
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# Uninstall target
|
|
|
|
|
# ------------------------------------------------------------
|
2025-04-27 22:38:52 +02:00
|
|
|
uninstall:
|
2025-12-09 05:31:55 +01:00
|
|
|
@bash scripts/uninstall.sh
|