feat(makefile): add module build targets and helper scripts

Split module image build into build-modules-sdk and
build-modules-images; build-modules
now depends on both. Factor container engine detection and version
parsing into
scripts/container-env.sh and scripts/pyproject-version.sh respectively.
Add Makefile
variables for SDK/module paths and image naming, update help output, and
simplify
clean target to remove common caches and .pyc files.
This commit is contained in:
abel
2026-03-10 12:50:16 +01:00
parent 3d394ddbab
commit 712b91ccb3
3 changed files with 66 additions and 40 deletions

19
scripts/container-env.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Resolve the container engine based on FUZZFORGE_ENGINE env var.
# Usage: source scripts/container-env.sh
# Exports: CONTAINER_CMD
if [ "${FUZZFORGE_ENGINE}" = "podman" ]; then
if [ -n "${SNAP}" ]; then
echo "Using Podman with isolated storage (Snap detected)"
CONTAINER_CMD="podman --root ~/.fuzzforge/containers/storage --runroot ~/.fuzzforge/containers/run"
else
echo "Using Podman"
CONTAINER_CMD="podman"
fi
else
echo "Using Docker"
CONTAINER_CMD="docker"
fi
export CONTAINER_CMD

12
scripts/pyproject-version.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Extract the version from a pyproject.toml file.
# Usage: pyproject-version.sh <path/to/pyproject.toml> [default]
# Prints the version string, or the default (0.0.1) if not found.
PYPROJECT="${1:?Usage: pyproject-version.sh <pyproject.toml> [default]}"
DEFAULT="${2:-0.0.1}"
version=$(grep -m1 '^version\s*=' "${PYPROJECT}" 2>/dev/null \
| sed 's/^version\s*=\s*//;s/"//g;s/\s*$//')
echo "${version:-${DEFAULT}}"