summaryrefslogtreecommitdiffstats
path: root/scripts/dtc/Makefile
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-03-06 00:01:22 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-12 18:43:25 +0100
commite748e6c601934b084f66b0230f4c2fced52a085e (patch)
tree7d20001572e12c70af40423d3257ca7737002ebc /scripts/dtc/Makefile
parent14c290dabe37f29f24d1a7b4d7681f64f2250e9d (diff)
downloadbarebox-e748e6c601934b084f66b0230f4c2fced52a085e.tar.gz
barebox-e748e6c601934b084f66b0230f4c2fced52a085e.tar.xz
scripts: Add dtc
This adds the devicetree compiler to barebox. This is taken without changes from Linux v3.8 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/dtc/Makefile')
-rw-r--r--scripts/dtc/Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
new file mode 100644
index 0000000000..2a48022c41
--- /dev/null
+++ b/scripts/dtc/Makefile
@@ -0,0 +1,31 @@
+# scripts/dtc makefile
+
+hostprogs-y := dtc
+always := $(hostprogs-y)
+
+dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
+ srcpos.o checks.o util.o
+dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
+
+# Source files need to get at the userspace version of libfdt_env.h to compile
+
+HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt
+
+HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC)
+
+HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
+
+# dependencies on generated files need to be listed explicitly
+$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
+
+# generated files need to be cleaned explicitly
+clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h