mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-16 20:00:11 +01:00
35c7c1e805
* `make -C locale` updates all the sources * `make -C locale compile` can compile the binaries, but the preferred way is `python3 setup.py compile_catalog`.
44 lines
1.2 KiB
Makefile
44 lines
1.2 KiB
Makefile
|
|
FILES = ../fdroid $(wildcard ../fdroidserver/*.py) \
|
|
$(wildcard /usr/lib/python3.*/argparse.py) \
|
|
$(wildcard /usr/lib/python3.*/optparse.py) \
|
|
$(wildcard /usr/lib/python3.*/getopt.py)
|
|
|
|
# these are the supported languages
|
|
ALL_LINGUAS = de es pt_BR pt_PT tr zh_Hans zh_Hant
|
|
POFILES = $(wildcard */LC_MESSAGES/fdroidserver.po)
|
|
MOFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.mo)
|
|
|
|
TEMPLATE = fdroidserver.pot
|
|
|
|
VERSION = $(shell git describe)
|
|
|
|
# refresh everything from the source code
|
|
update: $(POFILES)
|
|
|
|
# generate .mo files from the .po files
|
|
compile: $(MOFILES)
|
|
|
|
clean:
|
|
-rm -f -- $(MOFILES)
|
|
-rm -f -- $(POFILES:=~)
|
|
|
|
$(TEMPLATE): $(FILES)
|
|
xgettext --join-existing --from-code=UTF-8 \
|
|
--language=Python --keyword=_ \
|
|
--sort-output --add-location=file --output=$(TEMPLATE) \
|
|
--package-name="fdroidserver" --package-version=$(VERSION) \
|
|
--foreign-user \
|
|
--msgid-bugs-address=https://gitlab.com/fdroid/fdroidserver/issues \
|
|
$(FILES)
|
|
sed -i 's,CHARSET,UTF-8,' $(TEMPLATE)
|
|
|
|
%.po: $(TEMPLATE)
|
|
msgmerge --sort-output --add-location=file --update $@ $(TEMPLATE)
|
|
|
|
%/LC_MESSAGES/fdroidserver.mo: %/LC_MESSAGES/fdroidserver.po
|
|
msgfmt --check -o $@ $(@:mo=po)
|
|
|
|
|
|
.PHONY = compile clean update
|