]> git.proxmox.com Git - mirror_qemu.git/blame - po/Makefile
spapr_pci: Fix broken naming of PCI bus
[mirror_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
bcc55f32
SW
7# The default target must come before any include statements.
8all:
9
10.PHONY: all build clean install update
11
a697d240 12%.mo: %.po
0bdb12c7 13 $(call quiet-command, msgfmt -o $@ $<,"GEN","$@")
a697d240 14
834574ea 15-include ../config-host.mak
0cd8eaa0 16include $(SRC_PATH)/rules.mak
834574ea 17
00134a62
SW
18PO_PATH=$(SRC_PATH)/po
19
20VERSION=$(shell cat $(SRC_PATH)/VERSION)
21SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po))
22OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS))
23
24vpath %.po $(PO_PATH)
834574ea
AL
25
26all:
18e12d49
SW
27 @echo "Use 'make update' to update translation files or use 'make build'"
28 @echo "or 'make install' to build and install the translation files."
834574ea
AL
29
30update: $(SRCS)
31
32build: $(OBJS)
33
34clean:
891f8dcd 35 rm -f $(OBJS)
834574ea
AL
36
37install: $(OBJS)
38 for obj in $(OBJS); do \
ba278776 39 base=$$(basename $$obj .mo); \
834574ea
AL
40 $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \
41 $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \
42 done
43
00134a62 44$(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c
b920cad6 45 $(call quiet-command, ( cd $(SRC_PATH) && \
6598f0cd 46 xgettext -o - --from-code=UTF-8 --foreign-user --no-location \
1fa44923
SW
47 --package-name=QEMU --package-version=$(VERSION) \
48 --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \
0bdb12c7 49 sed -e s/CHARSET/UTF-8/) >$@,"GEN","$@")
834574ea 50
00134a62 51$(PO_PATH)/%.po: $(PO_PATH)/messages.po
0bdb12c7 52 $(call quiet-command, msgmerge -q $@ $< > $@.bak && mv $@.bak $@,"GEN","$@")