print ""; \
}' $(MAKEFILE_LIST)
-.PHONY: _all
-_all: lint test/installer test/system
- @$(call print_success,All checks passed!)
-
.PHONY: vars
vars: ##H Display all Makefile variables (simple)
$(info === Makefile Variables (file/command/line origin) ===)
) \
)
+
define print_err
printf "\033[1;31m%s\033[0m\n" "$(1)"
endef
-ruff check $(LINT_LOCS_PY)
@$(call print_success,OK.)
+
# --- Test Config ---
PWD := $(shell pwd)
COV_ROOT := $(PWD)/.coverage
.PHONY: test/purity
-test/purity: check/deps ##H Run logic tests with native shell (As Shipped Integrity Check)
+test/purity: check/deps ##H Run logic tests (with native /bin/sh)
@echo "running system tests (native /bin/sh)..."
@export GPG_TTY=$$(tty); \
[ -n "$(DEBUG)$(V)" ] && export GCRYPT_DEBUG=1; \
done
.PHONY: test/system
-test/system: check/deps ##H Run coverage tests (Dynamic Bash)
+test/system: check/deps ##H Run logic tests (with bash & coverage)
@echo "running system tests (coverage/bash)..."
@rm -rf $(COV_SYSTEM)
@mkdir -p $(COV_SYSTEM)
echo "Error: No coverage report found for $(2) in $(1)" ; \
exit 1)
+
.PHONY: test/cov _test_cov_internal
test/cov: ##H Show coverage gaps
$(MAKE) _test_cov_internal
exit $$err
+
# Version from git describe (or fallback)
__VERSION__ := $(shell git describe --tags --always --dirty 2>/dev/null || echo "@@DEV_VERSION@@")
+
+.PHONY: generate
+generate: ##H Autogen man docs & shell completions
+ @$(call print_info,Generating documentation and completions...)
+ python3 completions/gen_docs.py
+ @$(call print_success,Generated.)
+
+
.PHONY: install/, install
install/: install
install: ##H Install system-wide
install/user: ##H make install prefix=~/.local
$(MAKE) install prefix=~/.local
+
.PHONY: check/install
check/install: ##H Verify installation works
bash ./tests/verify-system-install.sh
+
.PHONY: uninstall/, uninstall
uninstall/: uninstall
uninstall: ##H Uninstall
.PHONY: clean
clean: ##H Clean up
rm -rf .coverage .build_tmp
-
-# --- Autogeneration ---
-.PHONY: generate
-generate: ##H Autogenerate README usage & completions
- @$(call print_info,Generating documentation and completions...)
- python3 completions/gen_docs.py
- @$(call print_success,Generated.)
if not os.path.exists(template_path):
print(f"Error: Template not found at {template_path}", file=sys.stderr)
sys.exit(1)
-
+
with open(template_path, "r") as f:
template_content = f.read()
def update_bash_completion(path, template_path, commands):
os.makedirs(os.path.dirname(path), exist_ok=True)
-
+
with open(template_path, "r") as f:
template = f.read()
-
+
cmd_str = " ".join(commands)
content = template.replace("{commands}", cmd_str)
-
+
with open(path, "w") as f:
f.write(content)
def update_zsh_completion(path, template_path, commands):
os.makedirs(os.path.dirname(path), exist_ok=True)
-
+
with open(template_path, "r") as f:
template = f.read()
-
+
cmd_str = " ".join(commands)
content = template.replace("{commands}", cmd_str)
-
+
with open(path, "w") as f:
f.write(content)
def update_fish_completion(path, template_path, commands):
os.makedirs(os.path.dirname(path), exist_ok=True)
-
+
with open(template_path, "r") as f:
template = f.read()
-
+
cmd_str = " ".join(commands)
content = template.replace("{not_sc_list}", cmd_str)
-
+
with open(path, "w") as f:
f.write(content)
)
print(f"Detected commands: {' '.join(comp_commands)}")
-
+
# Bash
bash_path = os.path.join(root_dir, "completions/bash/git-remote-gcrypt")
bash_tmpl = os.path.join(templates_dir, "bash.in")
fish_tmpl = os.path.join(templates_dir, "fish.in")
print(f"Updating Fish completions at: {fish_path}")
update_fish_completion(fish_path, fish_tmpl, comp_commands)
-
+
readme_path = os.path.join(root_dir, "README.rst")
readme_tmpl = os.path.join(templates_dir, "README.rst.in")
update_readme(readme_path, readme_tmpl)