-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (56 loc) · 1.92 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
INSTALL = install
RM = rm
PREFIX = /usr
VERSION = 0.1
SCRIPTS = \
src/download.sh \
src/erase.sh \
src/gmtkbabel \
src/set_format.sh \
src/set_frequency.sh
all: build
build: update-po
for l in $(shell cat po/LINGUAS); do \
msgfmt po/$$l.po -o po/$$l.mo; \
done
gzip -9c gmtkbabel.1 > gmtkbabel.1.gz
update-po: $(SCRIPTS)
xgettext --language=shell --from-code=utf-8 \
--copyright-holder="David Paleino <d.paleino@gmail.com>" \
--package-name="gmtkbabel" \
--package-version="$(VERSION)" \
--msgid-bugs-address="d.paleino@gmail.com" \
$(SCRIPTS) -o po/gmtkbabel.pot
for l in $(shell cat po/LINGUAS); do \
msgmerge --update --backup=none po/$$l.po po/gmtkbabel.pot; \
done
installdirs:
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/gmtkbabel/
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin/
$(INSTALL) -d $(DESTDIR)/etc
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/man/man1/
for l in $(shell cat po/LINGUAS); do \
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES/; \
done
install: build installdirs
$(INSTALL) src/gmtkbabel $(DESTDIR)$(PREFIX)/bin/
$(INSTALL) -m 644 src/*.sh $(DESTDIR)$(PREFIX)/share/gmtkbabel/
$(INSTALL) -m 644 gmtkbabel.conf $(DESTDIR)/etc/
for l in $(shell cat po/LINGUAS); do \
$(INSTALL) -m 644 po/$$l.mo \
$(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES/gmtkbabel.mo; \
done
$(INSTALL) -m 644 gmtkbabel.1.gz $(DESTDIR)$(PREFIX)/share/man/man1/
uninstall:
$(RM) -rf $(DESTDIR)$(PREFIX)/share/gmtkbabel/
$(RM) -rf $(DESTDIR)$(PREFIX)/bin/gmtkbabel
find $(DESTDIR)$(PREFIX)/share/locale -name "gmtkbabel.mo" -delete
$(RM) -rf $(DESTDIR)$(PREFIX)/share/man/man1/gmtkbabel.1.gz
clean:
$(RM) -rf po/*.mo
$(RM) -rf gmtkbabel.1.gz
dist:
git tag -s -f -m "$(VERSION) release" $(VERSION)
git tag -s -f -m "Latest release" latest
git archive --format=tar --prefix=gmtkbabel-$(VERSION)/ $(VERSION) | \
gzip -9 > gmtkbabel-$(VERSION).tar.gz