]>
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 | |
0cd8eaa0 | 8 | include $(SRC_PATH)/rules.mak |
834574ea | 9 | |
00134a62 SW |
10 | PO_PATH=$(SRC_PATH)/po |
11 | ||
12 | VERSION=$(shell cat $(SRC_PATH)/VERSION) | |
13 | SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po)) | |
14 | OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS)) | |
15 | ||
16 | vpath %.po $(PO_PATH) | |
834574ea AL |
17 | |
18 | all: | |
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 | |
22 | update: $(SRCS) | |
23 | ||
24 | build: $(OBJS) | |
25 | ||
26 | clean: | |
27 | $(RM) $(OBJS) | |
28 | ||
29 | install: $(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 |
b920cad6 MT |
40 | $(call quiet-command, ( cd $(SRC_PATH) && \ |
41 | xgettext -o - --from-code=UTF-8 --foreign-user \ | |
1fa44923 SW |
42 | --package-name=QEMU --package-version=$(VERSION) \ |
43 | [email protected] -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 $@ $< > [email protected] && mv [email protected] $@, " GEN $@") |
834574ea | 48 | |
f8475655 | 49 | .PHONY: clean all |