From 520203cfb54091dae7647a51a5910bb094fd1c4f Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 4 Nov 2025 08:42:57 -0600 Subject: feat:Makefile: Add dependency installation target Add a new `install-deps` target to the Makefile for setting up required dependencies, specifically `xterm-color`, using MELPA package repository. Enhance test process by including package initialization in `EMACS_TEST` command. --- Makefile | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 84901aa..8a43771 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,14 @@ TEST_UTIL_FILES = $(wildcard $(TEST_DIR)/testutil-*.el) # Emacs batch flags EMACS_BATCH = $(EMACS) --batch --no-site-file --no-site-lisp -EMACS_TEST = $(EMACS_BATCH) -L $(PROJECT_ROOT) -L $(TEST_DIR) +EMACS_TEST = $(EMACS_BATCH) \ + --eval "(require 'package)" \ + --eval "(add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\") t)" \ + --eval "(package-initialize)" \ + -L $(PROJECT_ROOT) -L $(TEST_DIR) .PHONY: help test test-all test-unit test-integration test-file test-name \ - validate-parens validate compile lint \ + validate-parens validate compile lint install-deps \ clean clean-compiled clean-tests # Default target @@ -57,6 +61,9 @@ help: @echo " make compile - Byte-compile wttrin.el" @echo " make lint - Run all linters (checkdoc, package-lint, elisp-lint)" @echo "" + @echo " Setup:" + @echo " make install-deps - Install required dependencies (xterm-color)" + @echo "" @echo " Utilities:" @echo " make clean - Remove test artifacts and compiled files" @echo " make clean-compiled - Remove .elc/.eln files only" @@ -193,6 +200,20 @@ lint: echo "✓ All linting checks passed" || \ echo "⚠ Linting issues found" +# ============================================================================ +# Setup Targets +# ============================================================================ + +install-deps: + @echo "Installing dependencies..." + @$(EMACS) --batch \ + --eval "(require 'package)" \ + --eval "(add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\") t)" \ + --eval "(package-initialize)" \ + --eval "(unless package-archive-contents (package-refresh-contents))" \ + --eval "(package-install 'xterm-color)" + @echo "✓ Dependencies installed" + # ============================================================================ # Utility Targets # ============================================================================ -- cgit v1.2.3