]> git.proxmox.com Git - qemu.git/blame - po/Makefile
po/Makefile: Fix generation of messages.po
[qemu.git] / po / Makefile
CommitLineData
834574ea
AL
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
00134a62 4# Set SRC_PATH for in-tree builds without configuration.
834574ea
AL
5SRC_PATH=..
6
7-include ../config-host.mak
8
00134a62
SW
9PO_PATH=$(SRC_PATH)/po
10
11VERSION=$(shell cat $(SRC_PATH)/VERSION)
12SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po))
13OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS))
14
15vpath %.po $(PO_PATH)
834574ea
AL
16
17all:
18e12d49
SW
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."
834574ea
AL
20
21update: $(SRCS)
22
23build: $(OBJS)
24
25clean:
26 $(RM) $(OBJS)
27
28install: $(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
a23da659 35%.mo: %.po
00134a62 36 @msgfmt -o $@ $<
834574ea 37
00134a62 38$(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c
1fa44923
SW
39 @cd $(SRC_PATH) && \
40 (xgettext -o - --from-code=UTF-8 --foreign-user \
41 --package-name=QEMU --package-version=$(VERSION) \
42 --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \
43 sed -e s/CHARSET/UTF-8/) >$@
834574ea 44
00134a62 45$(PO_PATH)/%.po: $(PO_PATH)/messages.po
834574ea
AL
46 @msgmerge $@ $< > $@.bak && mv $@.bak $@
47
f8475655 48.PHONY: clean all