From 0f1df0db903ba576fd17b08197d3066af7a61e5f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Nov 2023 23:23:40 +0100 Subject: A lot of changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d8e10bb..1c80c03 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,22 @@ .POSIX: -CHECK_INSTALLED = pacman -Qq -- /dev/null - update: - @for PKG in *; do \ + +@for PKG in *; do \ if test -d "$${PKG}"; then \ - if $(CHECK_INSTALLED) $${PKG} 2>/dev/null ; then \ - printf -- '\033[1mmake -C %s install\033[m\n' "$${PKG}"; \ - make -C "$${PKG}" CHECK_INSTALLED="$(CHECK_INSTALLED)" install; \ + if ./check-installed "$${PKG}" 2>/dev/null; then \ + if ! ./check-installed "$$(readlink -- "$${PKG}")" 2>/dev/null; then \ + printf -- '\033[1mcd %s && %s install\033[m\n' "$${PKG}" '$(MAKE)'; \ + (cd -- "$${PKG}" && $(MAKE) install); \ + fi; \ else\ - printf -- '\033[1mmake -C %s uninstall\033[m\n' "$${PKG}"; \ - make -C "$${PKG}" CHECK_INSTALLED="$(CHECK_INSTALLED)" uninstall; \ + printf -- '\033[1mcd %s && %s uninstall\033[m\n' "$${PKG}" '$(MAKE)'; \ + (cd -- "$${PKG}" && $(MAKE) uninstall || :); \ fi; \ fi; \ done - -.PHONY: update + +if test -f .private/pkgs/Makefile || test -f .private/pkgs/makefile; then \ + cd -- .private/pkgs && $(MAKE); \ + fi + +if test -f .work/pkgs/Makefile || test -f .work/pkgs/makefile; then \ + cd -- .work/pkgs && $(MAKE); \ + fi -- cgit v1.2.3-70-g09d2