root / po / Makefile @ 00134a62
History | View | Annotate | Download (1.2 kB)
1 |
# This makefile is very special as it's meant to build as part of the build |
---|---|
2 |
# process and also within the source tree to update the translation files. |
3 |
|
4 |
# Set SRC_PATH for in-tree builds without configuration. |
5 |
SRC_PATH=.. |
6 |
|
7 |
-include ../config-host.mak |
8 |
|
9 |
PO_PATH=$(SRC_PATH)/po |
10 |
|
11 |
VERSION=$(shell cat $(SRC_PATH)/VERSION) |
12 |
SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po)) |
13 |
OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS)) |
14 |
|
15 |
vpath %.po $(PO_PATH) |
16 |
|
17 |
all: |
18 |
@echo "Use 'make update' to update translation files or use 'make build'" |
19 |
@echo "or 'make install' to build and install the translation files." |
20 |
|
21 |
update: $(SRCS) |
22 |
|
23 |
build: $(OBJS) |
24 |
|
25 |
clean: |
26 |
$(RM) $(OBJS) |
27 |
|
28 |
install: $(OBJS) |
29 |
for obj in $(OBJS); do \ |
30 |
base=`basename $$obj .mo`; \ |
31 |
$(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \ |
32 |
$(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \ |
33 |
done |
34 |
|
35 |
%.mo: %.po |
36 |
@msgfmt -o $@ $< |
37 |
|
38 |
$(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c |
39 |
@xgettext -o $@ --foreign-user --package-name=QEMU --package-version=$(VERSION) --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C $< |
40 |
|
41 |
$(PO_PATH)/%.po: $(PO_PATH)/messages.po |
42 |
@msgmerge $@ $< > $@.bak && mv $@.bak $@ |
43 |
|
44 |
.PHONY: clean all |