block: Rename raw-{posix,win32} to file-*.c
[qemu.git] / po / Makefile
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 # The default target must come before any include statements.
8 all:
9
10 .PHONY: all build clean install update
11
12 %.mo: %.po
13 $(call quiet-command, msgfmt -o $@ $<,"GEN","$@")
14
15 -include ../config-host.mak
16 include $(SRC_PATH)/rules.mak
17
18 PO_PATH=$(SRC_PATH)/po
19
20 VERSION=$(shell cat $(SRC_PATH)/VERSION)
21 SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po))
22 OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS))
23
24 vpath %.po $(PO_PATH)
25
26 all:
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."
29
30 update: $(SRCS)
31
32 build: $(OBJS)
33
34 clean:
35 rm -f $(OBJS)
36
37 install: $(OBJS)
38 for obj in $(OBJS); do \
39 base=`basename $$obj .mo`; \
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
44 $(PO_PATH)/messages.po: $(SRC_PATH)/ui/gtk.c
45 $(call quiet-command, ( cd $(SRC_PATH) && \
46 xgettext -o - --from-code=UTF-8 --foreign-user \
47 --package-name=QEMU --package-version=$(VERSION) \
48 --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C ui/gtk.c | \
49 sed -e s/CHARSET/UTF-8/) >$@,"GEN","$@")
50
51 $(PO_PATH)/%.po: $(PO_PATH)/messages.po
52 $(call quiet-command, msgmerge -q $@ $< > $@.bak && mv $@.bak $@,"GEN","$@")