aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-06-25 16:42:47 +0200
committerMattias Andrée <maandree@kth.se>2021-06-25 16:42:47 +0200
commitfb0db5d269ff178322dc23ae6c18049f3f8b9772 (patch)
tree0d716908ea2b33adb4853491e3c5d8a3d9cb6f6b /Makefile
parentm (diff)
downloaddotfiles-fb0db5d269ff178322dc23ae6c18049f3f8b9772.tar.gz
dotfiles-fb0db5d269ff178322dc23ae6c18049f3f8b9772.tar.bz2
dotfiles-fb0db5d269ff178322dc23ae6c18049f3f8b9772.tar.xz
Let main Makefile select package manager
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 36ff3a8..d8e10bb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,16 @@
+.POSIX:
+
+CHECK_INSTALLED = pacman -Qq -- </dev/null >/dev/null
+
update:
@for PKG in *; do \
if test -d "$${PKG}"; then \
- if pacman -Qq -- $${PKG} </dev/null >/dev/null 2>/dev/null ; then \
+ if $(CHECK_INSTALLED) $${PKG} 2>/dev/null ; then \
printf -- '\033[1mmake -C %s install\033[m\n' "$${PKG}"; \
- make -C "$${PKG}" install; \
+ make -C "$${PKG}" CHECK_INSTALLED="$(CHECK_INSTALLED)" install; \
else\
printf -- '\033[1mmake -C %s uninstall\033[m\n' "$${PKG}"; \
- make -C "$${PKG}" uninstall; \
+ make -C "$${PKG}" CHECK_INSTALLED="$(CHECK_INSTALLED)" uninstall; \
fi; \
fi; \
done