diff options
author | Mattias Andrée <maandree@kth.se> | 2021-06-25 16:42:47 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-06-25 16:42:47 +0200 |
commit | fb0db5d269ff178322dc23ae6c18049f3f8b9772 (patch) | |
tree | 0d716908ea2b33adb4853491e3c5d8a3d9cb6f6b /Makefile | |
parent | m (diff) | |
download | dotfiles-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 '')
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 |