summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-09-06 13:40:12 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-09-06 13:40:12 +0200
commit79f65037ba66f7b66f36d0ea2895a7ba06ed2496 (patch)
tree9720e392d8443d6c70c0eaa2de2a18f1925045b2
parent954800fe5907b085870f07b7d771ffd83b42c67d (diff)
Add an install rule
-rw-r--r--Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d0bfcaf..2cd2405 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,10 @@ CFLAGS = -Wall -Wextra -Wpedantic -std=c23 \
-I$$(brew --prefix gettext)/include \
-L$$(brew --prefix gettext)/lib \
-lintl
-PODIR = /usr/local/share/locale
+
+PREFIX = /usr/local
+DPREFIX = $(DESTDIR)$(PREFIX)
+PODIR = $(DPREFIX)/share/locale
all: tiktok
@@ -15,7 +18,17 @@ extract:
find po -name '*.po' -exec msgmerge {} po/tiktok.pot -o {} \;
translations:
- find po -name '*.po' | while read -r file; do msgfmt "$$file" -o "$${file%po}mo"; done
+ find po -name '*.po' | \
+ while read -r file; do msgfmt "$$file" -o "$${file%po}mo"; done
+
+install:
+ mkdir -p "$(DPREFIX)/bin" "$(DPREFIX)/share/man/man1"
+ find po -type d -maxdepth 2 -mindepth 2 | while read -r path; \
+ do \
+ mkdir -p "$(PODIR)/$${path#*/}"; \
+ msgfmt "$$path/tiktok.po" -o "$(PODIR)/$${path#*/}/tiktok.mo"; \
+ done
+ cp tiktok "$(DPREFIX)/bin"
clean:
rm tiktok