aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-09-14 22:07:29 -0300
committerEuAndreh <eu@euandre.org>2021-09-14 22:07:29 -0300
commite22fa5d3d78008f53227014afb6b1a6622d5c1d4 (patch)
tree2ac167c91a0f7c90f48046e51b68f54290869b9f /Makefile
parentTODOs.md: Add #task-e9b72107-7dad-0844-d993-503259c729b5 (diff)
downloadgit-permalink-e22fa5d3d78008f53227014afb6b1a6622d5c1d4.tar.gz
git-permalink-e22fa5d3d78008f53227014afb6b1a6622d5c1d4.tar.xz
Rework how translation is done
Instead of variables on the code itself, each language gets its own file.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 21 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 5880e6e..4f91b3a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,29 @@
.POSIX:
-PREFIX = /usr/local
-MANPREFIX = $(PREFIX)/share/man
DATE = 2021-07-16
VERSION = 0.2.3
NAME = git-permalink
MAILING_LIST = public-inbox
TRANSLATIONS = pt fr eo
CONTRIBLANGS =
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+LIBEXECDIR = $(PREFIX)/libexec
+SHAREDIR = $(PREFIX)/share
+LOCALEDIR = $(SHAREDIR)/locale
+MANDIR = $(SHAREDIR)/man
+
+.SUFFIXES:
.SUFFIXES: .in
.in:
- sed -e 's/@VERSION@/$(VERSION)/g' -e 's/@DATE@/$(DATE)/g' < $< > $@
+ sed \
+ -e 's:@VERSION@:$(VERSION):g' \
+ -e 's:@DATE@:$(DATE):g' \
+ -e 's:@NAME@:$(NAME):g' \
+ -e 's:@LIBEXECDIR@:$(LIBEXECDIR):g' \
+ -e 's:@LOCALEDIR@:$(LOCALEDIR):g' \
+ < $< > $@
if [ -x $< ]; then chmod +x $@; fi
@@ -24,7 +36,7 @@ manpages.in = $(manpages.en.in) \
manpages = $(manpages.in:.in=)
-all: src/git-permalink $(manpages)
+all: src/git-permalink src/load-locale-messages.sh $(manpages)
check: all
sh tests/cli-opts.sh
@@ -35,13 +47,13 @@ clean:
src/git-permalink tests/destdirs/ tests/prefix/ tests/remotes/
install: all
- mkdir -p $(DESTDIR)$(PREFIX)/bin
- cp src/git-permalink $(DESTDIR)$(PREFIX)/bin
- sh doc/manpages.sh -ip $(DESTDIR)$(MANPREFIX) $(manpages)
+ mkdir -p $(DESTDIR)$(BINDIR)
+ cp src/git-permalink $(DESTDIR)$(BINDIR)
+ sh doc/manpages.sh -ip $(DESTDIR)$(MANDIR) $(manpages)
uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/git-permalink
- sh doc/manpages.sh -up $(DESTDIR)$(MANPREFIX) $(manpages)
+ rm -f $(DESTDIR)$(BINDIR)/git-permalink
+ sh doc/manpages.sh -up $(DESTDIR)$(MANDIR) $(manpages)
#