]>
Commit | Line | Data |
---|---|---|
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 | ||
4 | VERSION=$(shell cat ../VERSION) | |
f8475655 AJ |
5 | SRCS=$(filter-out messages.po,$(wildcard *.po)) |
6 | OBJS=$(patsubst %.po,%.mo,$(SRCS)) | |
834574ea AL |
7 | |
8 | SRC_PATH=.. | |
9 | ||
10 | -include ../config-host.mak | |
11 | ||
12 | vpath %.po $(SRC_PATH)/po | |
13 | ||
14 | all: | |
18e12d49 SW |
15 | @echo "Use 'make update' to update translation files or use 'make build'" |
16 | @echo "or 'make install' to build and install the translation files." | |
834574ea AL |
17 | |
18 | update: $(SRCS) | |
19 | ||
20 | build: $(OBJS) | |
21 | ||
22 | clean: | |
23 | $(RM) $(OBJS) | |
24 | ||
25 | install: $(OBJS) | |
26 | for obj in $(OBJS); do \ | |
27 | base=`basename $$obj .mo`; \ | |
28 | $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \ | |
29 | $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \ | |
30 | done | |
31 | ||
a23da659 | 32 | %.mo: %.po |
834574ea AL |
33 | @msgfmt -o $@ $(SRC_PATH)/po/`basename $@ .mo`.po |
34 | ||
35 | messages.po: $(SRC_PATH)/ui/gtk.c | |
1b33b354 | 36 | @xgettext -o $@ --foreign-user --package-name=QEMU --package-version=$(VERSION) [email protected] -k_ -C $< |
834574ea | 37 | |
f8475655 | 38 | %.po: messages.po |
834574ea AL |
39 | @msgmerge $@ $< > [email protected] && mv [email protected] $@ |
40 | ||
f8475655 | 41 | .PHONY: clean all |