File: Makefile

package info (click to toggle)
fdroidserver 2.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,948 kB
  • sloc: python: 34,139; xml: 2,186; sh: 1,362; java: 293; makefile: 54; javascript: 23
file content (56 lines) | stat: -rw-r--r-- 1,641 bytes parent folder | download | duplicates (3)
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

FILES = $(wildcard ../fdroidserver/*.py) \
	$(wildcard /usr/lib/python3.*/argparse.py) \
	../fdroid

# these are the supported languages
ALL_LINGUAS = $(shell sed -En 's,include locale/([^/]+)/.*,\1,p' ../MANIFEST.in)
POFILES = $(wildcard */LC_MESSAGES/fdroidserver.po)
MOFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.mo)

TEMPLATE = fdroidserver.pot

VERSION = $(shell git describe)

OPTS = --no-wrap --sort-output --add-location=file

default:
	@printf "Build the translation files using: ./setup.py compile_catalog\n\n"

message:
	@printf "\nYou probably want to use this instead: ./setup.py compile_catalog\n\n"

# refresh everything from the source code
update: $(POFILES)

# generate .mo files from the .po files
compile: message $(MOFILES)

clean:
	-rm -f -- $(MOFILES)
	-rm -f -- $(POFILES:=~)

# to remove obsolete source strings, run xgettext without --join-existing
$(TEMPLATE): $(FILES)
	xgettext --join-existing --from-code=UTF-8 \
		--language=Python --keyword=_ \
		$(OPTS) --output=$(TEMPLATE) \
		--package-name="fdroidserver" --package-version=$(VERSION) \
		--foreign-user \
		--msgid-bugs-address=https://gitlab.com/fdroid/fdroidserver/issues \
		$(FILES)
	msguniq $(OPTS) --use-first \
		--output-file=$(TEMPLATE) $(TEMPLATE)
	sed -i 's,CHARSET,UTF-8,' $(TEMPLATE)

%.po: $(TEMPLATE)
	msgattrib --set-obsolete --ignore-file=$(TEMPLATE) -o $@ $@
	msgattrib $(OPTS) --no-obsolete --output-file=$@ $@
	msguniq $(OPTS) --use-first --output-file=$@ $@
	msgmerge $(OPTS) --update $@ $(TEMPLATE)

%/LC_MESSAGES/fdroidserver.mo: %/LC_MESSAGES/fdroidserver.po
	msgfmt --check -o $@ $(@:mo=po)


.PHONY = compile clean update