aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-06-07 11:53:01 +0200
committerMattias Andrée <maandree@kth.se>2024-06-07 11:53:01 +0200
commitca34d991ad527fec5edde186bb8479982ac52c03 (patch)
tree3d82e92736a73a3276027d1d67ec6bb350ccc173 /Makefile
parentUpdate clawsrc and make python and st exclusive to zenith (diff)
downloaddotfiles-ca34d991ad527fec5edde186bb8479982ac52c03.tar.gz
dotfiles-ca34d991ad527fec5edde186bb8479982ac52c03.tar.bz2
dotfiles-ca34d991ad527fec5edde186bb8479982ac52c03.tar.xz
Minor fixes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 27 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f543b59..3dc2d09 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,15 @@
.POSIX:
-update:
+update: update-common update-private update-work
+
+update-common:
+@for PKGDIR in *; do \
if test -d "$${PKGDIR}"; then \
PKG="$$(printf '%s@\n' "$${PKGDIR}" | cut -d @ -f 1)"; \
HOST="$$(printf '%s@\n' "$${PKGDIR}" | cut -d @ -f 2 | tr A-Z a-z)"; \
if test -z "$${HOST}" || test "$${HOST}" = "$$(hostname | tr A-Z a-z)"; then \
if ./check-installed "$${PKG}" 2>/dev/null; then \
- if ! ./check-installed "$$(readlink -- "$${PKG}")" 2>/dev/null; then \
+ if ! ./check-installed "$$(readlink -- "$${PKGDIR}")" 2>/dev/null; then \
printf -- '\033[1mcd %s && %s install\033[m\n' "$${PKGDIR}" '$(MAKE)'; \
(cd -- "$${PKGDIR}" && $(MAKE) install); \
fi; \
@@ -18,9 +20,32 @@ update:
fi; \
fi; \
done
+
+update-private:
+if test -f .private/pkgs/Makefile || test -f .private/pkgs/makefile; then \
cd -- .private/pkgs && $(MAKE); \
fi
+
+update-work:
+if test -f .work/pkgs/Makefile || test -f .work/pkgs/makefile; then \
cd -- .work/pkgs && $(MAKE); \
fi
+
+.DEFAULT:
+ +@for PKGDIR in $@; do \
+ if test -d "$${PKGDIR}"; then \
+ PKG="$$(printf '%s@\n' "$${PKGDIR}" | cut -d @ -f 1)"; \
+ HOST="$$(printf '%s@\n' "$${PKGDIR}" | cut -d @ -f 2 | tr A-Z a-z)"; \
+ if test -z "$${HOST}" || test "$${HOST}" = "$$(hostname | tr A-Z a-z)"; then \
+ if ./check-installed "$${PKG}" 2>/dev/null; then \
+ if ! ./check-installed "$$(readlink -- "$${PKGDIR}")" 2>/dev/null; then \
+ printf -- '\033[1mcd %s && %s install\033[m\n' "$${PKGDIR}" '$(MAKE)'; \
+ (cd -- "$${PKGDIR}" && $(MAKE) install); \
+ fi; \
+ else\
+ printf -- '\033[1mcd %s && %s uninstall\033[m\n' "$${PKGDIR}" '$(MAKE)'; \
+ (cd -- "$${PKGDIR}" && $(MAKE) uninstall || :); \
+ fi; \
+ fi; \
+ fi; \
+ done