1# Makefile.pylibfdt 2# 3 4PYLIBFDT_srcs = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_SRCS)) \ 5 $(PYLIBFDT_srcdir)/libfdt.i 6PYMODULE = $(PYLIBFDT_objdir)/_libfdt.so 7 8define run_setup 9 SOURCES="$(1)" CPPFLAGS="$(CPPFLAGS)" OBJDIR="$(PYLIBFDT_objdir)" 10 VERSION="$(dtc_version)" 11 $(PYLIBFDT_objdir)/setup.py --quiet $(2) 12endef 13 14$(PYMODULE): $(PYLIBFDT_srcs) 15 @$(VECHO) PYMOD $@ 16 $(call run_setup, $^, build_ext --inplace) 17 mv _libfdt.so $@ 18 19install_pylibfdt: $(PYMODULE) 20 $(VECHO) INSTALL-PYLIB; \ 21 $(call run_setup, $(PYLIBFDT_srcs), \ 22 install $(if $(SETUP_PREFIX),--prefix=$(SETUP_PREFIX))) 23 24PYLIBFDT_cleanfiles = libfdt_wrap.c libfdt.py libfdt.pyc _libfdt.so 25