aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 14 insertions, 10 deletions
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 >/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