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.
4 # Set SRC_PATH for in-tree builds without configuration.
7 # The default target must come before any include statements.
10 .PHONY: all build clean install update
12 -include ../config-host.mak
13 include $(SRC_PATH)/rules.mak
15 PO_PATH=$(SRC_PATH)/po
17 VERSION=$(shell cat $(SRC_PATH)/VERSION)
18 SRCS=$(filter-out $(PO_PATH)/messages.po,$(wildcard $(PO_PATH)/*.po))
19 OBJS=$(patsubst $(PO_PATH)/%.po,%.mo,$(SRCS))
24 @echo "Use 'make update' to update translation files or use 'make build'"
25 @echo "or 'make install' to build and install the translation files."
35 for obj in $(OBJS); do \
36 base=`basename $$obj .mo`; \
37 $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \
38 $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \
42 $(call quiet-command, msgfmt -o $@ $<, " GEN $@")
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) \
49 sed -e s/CHARSET/UTF-8/) >$@, " GEN $@")
51 $(PO_PATH)/%.po: $(PO_PATH)/messages.po