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