Files
xen/tools/python/Makefile
T
Andrew Cooper 86229197cf tools/python: Improve .gitignore and clean Makefile rule
Ignore all intermediate python files, and use find in the clean rule as there
are no Makefiles in subdirectories to participate in a recursive clean.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-07-10 11:30:32 +01:00

37 lines
988 B
Makefile

XEN_ROOT = $(CURDIR)/../..
include $(XEN_ROOT)/tools/Rules.mk
.PHONY: all
all: build
XENPATH = "xen/util/path.py"
genpath-target = $(call buildmakevars2file,$(XENPATH))
$(eval $(genpath-target))
.PHONY: build
build: genpath genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
$(XEN_ROOT)/tools/libxl/idl.py
PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
$(XEN_ROOT)/tools/libxl/libxl_types.idl \
xen/lowlevel/xl/_pyxl_types.h \
xen/lowlevel/xl/_pyxl_types.c
CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build
.PHONY: install
install:
CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
.PHONY: test
test:
export LD_LIBRARY_PATH=$$(readlink -f ../libxc):$$(readlink -f ../xenstore); $(PYTHON) test.py -b -u
.PHONY: clean
clean:
find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -delete
rm -rf build/
rm -f $(XENPATH) $(DEPS)
-include $(DEPS)