Statistics
| Branch: | Revision:

root / po / Makefile @ 834574ea

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
VERSION=$(shell cat ../VERSION)
5
TRANSLATIONS=de_DE it
6
SRCS=$(addsuffix .po, $(TRANSLATIONS))
7
OBJS=$(addsuffix .mo, $(TRANSLATIONS))
8

    
9
SRC_PATH=..
10

    
11
-include ../config-host.mak
12

    
13
vpath %.po $(SRC_PATH)/po
14

    
15
all:
16
	@echo Use 'make update' to update translation files
17
	@echo or us 'make build' or 'make install' to build and install
18
	@echo the translation files
19

    
20
update: $(SRCS)
21

    
22
build: $(OBJS)
23

    
24
clean:
25
	$(RM) $(OBJS)
26

    
27
install: $(OBJS)
28
	for obj in $(OBJS); do \
29
	    base=`basename $$obj .mo`; \
30
	    $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \
31
	    $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \
32
	done
33

    
34
%.mo:
35
	@msgfmt -o $@ $(SRC_PATH)/po/`basename $@ .mo`.po
36

    
37
messages.po: $(SRC_PATH)/ui/gtk.c
38
	@xgettext -o $@ --foreign-user --package-name=QEMU --package-version=1.0.50 --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C $<
39

    
40
de_DE.po: messages.po $(SRC_PATH)/ui/gtk.c
41
	@msgmerge $@ $< > $@.bak && mv $@.bak $@
42

    
43
it.po: messages.po $(SRC_PATH)/ui/gtk.c
44
	@msgmerge $@ $< > $@.bak && mv $@.bak $@
45

    
46
.PHONY: $(SRCS) clean all