Makefile: generate .mo files

This commit is contained in:
Mingcong Bai 2016-08-24 21:49:20 +08:00
parent 7a9206d607
commit ebf464d7a1

View File

@ -10,18 +10,26 @@ LN=ln
MKDIR=mkdir -p MKDIR=mkdir -p
PYTHON=python3 PYTHON=python3
RM=rm -f -v RM=rm -f -v
MSGFMT=msgfmt
all: all:
for pofiles in en ja zh_CN zh_TW; do \
$(MSGFMT) "po/$$pofiles.po" -o "po/$$pofiles.mo" ; \
done
install: install:
$(MKDIR) "$(DESTDIR)$(PREFIX)/share/danmaku2ass" $(MKDIR) "$(DESTDIR)$(PREFIX)/share/danmaku2ass"
$(INSTALL) -Dm0755 danmaku2ass.py "$(DESTDIR)$(PREFIX)/share/danmaku2ass/danmaku2ass.py" $(INSTALL) -Dm0755 danmaku2ass.py "$(DESTDIR)$(PREFIX)/share/danmaku2ass/danmaku2ass.py"
$(CP) -R locale "$(DESTDIR)$(PREFIX)/share/" for locale in en ja zh_CN zh_TW; do \
$(MKDIR) "$(DESTDIR)$(PREFIX)/share/locale/$$locale/LC_MESSAGES" ; \
$(CP) "po/$$locale.mo" "$(DESTDIR)$(PREFIX)/share/locale/$$locale/LC_MESSAGES/danmaku2ass.mo" ; \
done
$(MKDIR) "$(DESTDIR)$(PREFIX)/bin" $(MKDIR) "$(DESTDIR)$(PREFIX)/bin"
$(LN) -s "$(PREFIX)/share/danmaku2ass/danmaku2ass.py" "$(DESTDIR)$(PREFIX)/bin/danmaku2ass" $(LN) -s "$(PREFIX)/share/danmaku2ass/danmaku2ass.py" "$(DESTDIR)$(PREFIX)/bin/danmaku2ass"
clean: clean:
$(RM) -R __pycache__ $(RM) -R __pycache__
$(RM) po/*.mo
uninstall: uninstall:
$(RM) -R "$(DESTDIR)$(PREFIX)/bin/danmaku2ass" "$(DESTDIR)$(PREFIX)/share/danmaku2ass" $(RM) -R "$(DESTDIR)$(PREFIX)/bin/danmaku2ass" "$(DESTDIR)$(PREFIX)/share/danmaku2ass"