File: Makefile

package info (click to toggle)
keyman 18.0.246-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,316 kB
  • sloc: python: 52,784; cpp: 21,289; sh: 7,633; ansic: 4,823; xml: 3,617; perl: 959; makefile: 139; javascript: 138
file content (67 lines) | stat: -rw-r--r-- 2,040 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make

default:
	./build.sh clean build

install:
	./build.sh install

uninstall: # run as sudo
	./build.sh uninstall

clean:
	./build.sh clean

check:
	./build.sh test

dist: clean version
	# TODO: remove this if when we no longer support Ubuntu 22.04 Jammy
	if dpkg --compare-versions "$(lsb_release -r -s)" lt 24.04; then \
		python3 setup.py sdist ; \
	else \
		python3 -m build --outdir build --sdist ; \
	fi

deb: dist
	@VERSION=$(shell echo `basename dist/*.gz .tar.gz|cut -d "-" -f2` > /tmp/keyman_version)
	@echo VERSION is $(shell cat /tmp/keyman_version)
	@mkdir -p make_deb
	cd make_deb && tar xf ../dist/keyman_config-$(shell cat /tmp/keyman_version).tar.gz && \
		mv keyman_config-$(shell cat /tmp/keyman_version) keyman-config-$(shell cat /tmp/keyman_version) && \
		tar cfz keyman-config_$(shell cat /tmp/keyman_version).orig.tar.gz keyman-config-$(shell cat /tmp/keyman_version) && \
		cd keyman-config-$(shell cat /tmp/keyman_version) && cp -a ../../../debian . && dch -v$(shell cat /tmp/keyman_version)-1 ""
	cd make_deb/keyman-config-$(shell cat /tmp/keyman_version) && debuild -us -uc
	rm /tmp/keyman_version

man:
	./build-help.sh --man --no-reconf

version_reconf:
	cd .. && ./scripts/reconf.sh

version: version_reconf
	$(eval VERSION := $(shell python3 -c "from keyman_config import __releaseversion__; print(__releaseversion__)"))

# i18n

POFILES := $(shell find locale -name \*.po)
MOFILES := $(POFILES:.po=/LC_MESSAGES/keyman-config.mo)

update-template: version
	xgettext --package-name "keyman" --package-version "$(VERSION)" \
		--msgid-bugs-address "<support@keyman.com>" --copyright-holder "SIL Global" \
		--language=Python --directory=. --output-dir=locale --output=keyman-config.pot \
		--add-comments=i18n: --sort-by-file --width=98 \
		keyman_config/*.py km-*

update-po: $(POFILES)

locale/%.po: locale/keyman-config.pot
	msgmerge --update --width=98 $@ $^

$(MOFILES): %/LC_MESSAGES/keyman-config.mo: %.po
	mkdir -p $(dir $@)
	msgfmt -v --check --output-file=$@ $^

compile-po: $(MOFILES)