aboutsummaryrefslogtreecommitdiff
path: root/pylibfdt/Makefile.pylibfdt
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-03-17 16:14:30 -0600
committerDavid Gibson <david@gibson.dropbear.id.au>2017-03-21 16:21:58 +1100
commit50f2507016315e0b9499dd58876ffc1acf91cc5a (patch)
tree50111f461c8fa7ebfc8b9285c02b6ad1a0365791 /pylibfdt/Makefile.pylibfdt
parentcdbb2b6c7a3a5aabf6f942f1b5f5b1d997555b07 (diff)
downloaddtc-50f2507016315e0b9499dd58876ffc1acf91cc5a.zip
dtc-50f2507016315e0b9499dd58876ffc1acf91cc5a.tar.gz
dtc-50f2507016315e0b9499dd58876ffc1acf91cc5a.tar.bz2
Add an initial Python library for libfdt
Add Python bindings for a bare-bones set of libfdt functions. These allow navigating the tree and reading node names and properties. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'pylibfdt/Makefile.pylibfdt')
-rw-r--r--pylibfdt/Makefile.pylibfdt17
1 files changed, 17 insertions, 0 deletions
diff --git a/pylibfdt/Makefile.pylibfdt b/pylibfdt/Makefile.pylibfdt
new file mode 100644
index 0000000..0d8c010
--- /dev/null
+++ b/pylibfdt/Makefile.pylibfdt
@@ -0,0 +1,17 @@
+# Makefile.pylibfdt
+#
+
+PYLIBFDT_srcs = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_SRCS))
+WRAP = $(PYLIBFDT_objdir)/libfdt_wrap.c
+PYMODULE = $(PYLIBFDT_objdir)/_libfdt.so
+
+$(PYMODULE): $(PYLIBFDT_srcs) $(WRAP)
+ @$(VECHO) PYMOD $@
+ python $(PYLIBFDT_objdir)/setup.py "$(CPPFLAGS)" $^
+ mv _libfdt.so $(PYMODULE)
+
+$(WRAP): $(PYLIBFDT_srcdir)/libfdt.swig
+ @$(VECHO) SWIG $@
+ $(SWIG) -python -o $@ $<
+
+PYLIBFDT_cleanfiles = libfdt_wrap.c libfdt.py libfdt.pyc _libfdt.so