]> git.proxmox.com Git - qemu.git/blame - po/Makefile
hw/i386/Makefile.obj: use $(PYTHON) to run .py scripts consistently
[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
0cd8eaa0 8include $(SRC_PATH)/rules.mak
834574ea 9
00134a62
SW
10PO_PATH=$(SRC_PATH)/po
11
12VERSION=$(shell cat $(SRC_PATH)/VERSION)
13SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po))
14OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS))
15
16vpath %.po $(PO_PATH)
834574ea
AL
17
18all:
18e12d49
SW
19 @echo "Use 'make update' to update translation files or use 'make build'"
20 @echo "or 'make install' to build and install the translation files."
834574ea
AL
21
22update: $(SRCS)
23
24build: $(OBJS)
25
26clean:
27 $(RM) $(OBJS)
28
29install: $(OBJS)
30 for obj in $(OBJS); do \
31 base=`basename $$obj .mo`; \
32 $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \
33 $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \
34 done
35
a23da659 36%.mo: %.po
0cd8eaa0 37 $(call quiet-command, msgfmt -o $@ $<, " GEN $@")
834574ea 38
00134a62 39$(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c
0cd8eaa0 40 $(call quiet-command, cd $(SRC_PATH) && \
1fa44923
SW
41 (xgettext -o - --from-code=UTF-8 --foreign-user \
42 --package-name=QEMU --package-version=$(VERSION) \
43 --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \
0cd8eaa0 44 sed -e s/CHARSET/UTF-8/) >$@, " GEN $@")
834574ea 45
00134a62 46$(PO_PATH)/%.po: $(PO_PATH)/messages.po
0cd8eaa0 47 $(call quiet-command, msgmerge -q $@ $< > $@.bak && mv $@.bak $@, " GEN $@")
834574ea 48
f8475655 49.PHONY: clean all