From 233394bd9a179623be96ac0ee49f9f018b3e378b Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:58:46 +0900 Subject: modified Makefile, modified bin/mw --- Makefile | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 27620f9..a0c2bf1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man -DEPENDENCIES = neomutt curl isync msmtp pass ca-certificates gettext +DEPENDENCIES = neomutt curl msmtp pass gettext +NON_EXEC_DEPS = isync ca-certificates check-dependencies: @for dep in $(DEPENDENCIES); do \ @@ -11,6 +12,33 @@ check-dependencies: exit 1; \ fi; \ done + @for dep in $(NON_EXEC_DEPS); do \ + if command -v pacman >/dev/null 2>&1; then \ + if ! pacman -Q $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + elif command -v dpkg >/dev/null 2>&1; then \ + if ! dpkg -s $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + elif command -v rpm >/dev/null 2>&1; then \ + if ! rpm -q $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + elif command -v zypper >/dev/null 2>&1; then \ + if ! zypper se -i $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + else \ + echo "Error: Unsupported package manager. Cannot verify installation of $$dep."; \ + exit 1; \ + fi; \ + done + @echo "All dependencies are installed." install-dependencies: @if command -v apt-get >/dev/null 2>&1; then \ -- cgit v1.2.3