ia64/xen-unstable

view tools/python/Makefile @ 19818:415505139333

Get rid of hardcoded pathes for stubdom and hotplug scripts

- Have the buid system generate a file which exports the install paths
for the hotplug scripts and stubdom / stubdom-dm
- Move file generation code from tools/python/Makefile into a gmake
macro
in Config.mk to avoid maintenance of three duplicates each with its
own
tweaks and bugs
- Export gmake variables into ioemu as shell variables
for upcoming ioemu patches
- Do above as a gmake macro to avoid maintenance of several duplicates
- Adjust hotplug scripts to find the right xen binaries from the
install directory
- Adjust stubdom-dm to use the install directories

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 17:25:51 2009 +0100 (2009-06-23)
parents b55070edb185
children
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 .PHONY: all
5 all: build
7 # For each new supported translation, add its name here, eg 'fr_FR'
8 # to cause the .po file to be built & installed, eg
9 LINGUAS :=
10 POPACKAGE := xen-xm
11 PODIR := xen/xm/messages
12 POTFILE := $(PODIR)/xen-xm.pot
13 I18NSRCFILES = $(shell find xen/xm/ -name '*.py')
14 CATALOGS = $(patsubst %,xen/xm/messages/%.mo,$(LINGUAS))
15 NLSDIR = $(SHAREDIR)/locale
16 XENPATH = "xen/util/path.py"
18 genpath-target = $(call buildmakevars2file,$(XENPATH))
19 $(eval $(genpath-target))
21 .PHONY: build buildpy
22 buildpy: genpath
23 CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build
25 build: buildpy refresh-pot refresh-po $(CATALOGS)
27 # NB we take care to only update the .pot file it strings have
28 # actually changed. This is complicated by the embedded date
29 # string, hence the sed black magic. This avoids the expensive
30 # re-generation of .po files on every single build
31 refresh-pot: $(I18NSRCFILES)
32 xgettext --default-domain=$(POPACKAGE) \
33 --keyword=N_ \
34 --keyword=_ \
35 -o $(POTFILE)-tmp \
36 $(I18NSRCFILES)
37 sed -f remove-potcdate.sed < $(POTFILE) > $(POTFILE)-1
38 sed -f remove-potcdate.sed < $(POTFILE)-tmp > $(POTFILE)-2
39 set -e; if cmp -s $(POTFILE)-1 $(POTFILE)-2; then \
40 rm -f $(POTFILE)-tmp $(POTFILE)-1 $(POTFILE)-2; \
41 else \
42 mv $(POTFILE)-tmp $(POTFILE); \
43 rm -f $(POTFILE)-1 $(POTFILE)-2; \
44 fi
46 refresh-po: $(POTFILE)
47 set -e; for l in $(LINGUAS); do \
48 if $(MSGMERGE) $(PODIR)/$$l.po $(POTFILE) > $(PODIR)/$$l-tmp ; then \
49 mv -f $(PODIR)/$$l-tmp $(PODIR)/$$l.po ; \
50 echo "$(MSGMERGE) of $$l.po succeeded" ; \
51 else \
52 echo "$(MSGMERGE) of $$l.po failed" ; \
53 rm -f $(PODIR)/$$l-tmp ; \
54 fi \
55 done
57 %.mo: %.po
58 $(MSGFMT) -c -o $@ $<
60 .PHONY: install
61 install: install-messages install-dtd
62 CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
63 $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
65 install-dtd: all
66 $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)
67 $(INSTALL_DATA) xen/xm/create.dtd $(DESTDIR)$(SHAREDIR)
69 install-messages: all
70 set -e; if which $(MSGFMT) >/dev/null ; then \
71 $(INSTALL_DIR) $(DESTDIR)$(NLSDIR); \
72 for l in $(LINGUAS); do \
73 $(INSTALL_DIR) $(DESTDIR)$(NLSDIR)/$$l; \
74 $(INSTALL_DIR) $(DESTDIR)$(NLSDIR)/$$l/LC_MESSAGES; \
75 $(INSTALL_DATA) $(PODIR)/$$l.mo \
76 $(DESTDIR)$(NLSDIR)/$$l/LC_MESSAGES/$(POPACKAGE).mo; \
77 done ; \
78 fi
80 .PHONY: test
81 test:
82 export LD_LIBRARY_PATH=$$(readlink -f ../libxc):$$(readlink -f ../xenstore); $(PYTHON) test.py -b -u
84 .PHONY: clean
85 clean:
86 rm -f $(XENPATH)
87 rm -rf build *.pyc *.pyo *.o *.a *~ $(CATALOGS) xen/util/auxbin.pyc
88 rm -f $(DEPS)
90 -include $(DEPS)