forked from pkgix/pkgix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (40 loc) · 1.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# Makefile for pkgix
#
PROGNAME = pkgix
DESTDIR = /usr/local
PREFIX = $(DESTDIR)
LOCALEDIR = share/locale
MANDIR = share/man
export PROGNAME
export DESTDIR
export PREFIX
export MANDIR
MSGFMT = msgfmt -c
TRANSLATIONS = $(shell cd po && for po in *.po; do echo "$(LOCALEDIR)/$${po%%.po}/LC_MESSAGES/$(PROGNAME).mo"; done)
all: translations doc
translations: $(TRANSLATIONS)
doc:
$(MAKE) -C doc man
.PHONY: all translations doc
$(LOCALEDIR)/%/LC_MESSAGES/$(PROGNAME).mo: po/%.po
mkdir -p $(shell dirname "$@")
$(MSGFMT) -o $@ $<
.PHONY: check
check:
tests/tests.sh runtests Makefile-check.log
$(RM) Makefile-check.log
.PHONY: clean
clean:
rm -rf $(LOCALEDIR)
$(MAKE) -C doc clean-man
install-translations: translations
for mo in $(TRANSLATIONS); do \
install -Dm 0644 $$mo "$(DESTDIR)/$$mo" ;\
done
install: install-translations
$(MAKE) -C doc install-gzipped-man
install -Dm 0755 bin/$(PROGNAME) "$(DESTDIR)/bin/$(PROGNAME)"
sed -i 's:^TEXTDOMAINDIR=.*$$:TEXTDOMAINDIR="$(PREFIX)/$(LOCALEDIR)":' "$(DESTDIR)/bin/$(PROGNAME)"
install -Dm 0644 share/$(PROGNAME)/helper-inc.sh "$(DESTDIR)/share/$(PROGNAME)/helper-inc.sh"
.PHONY: install-translations install