mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/6] dtc: compile fdtget
Date: Thu, 31 Jul 2014 14:27:35 +0200	[thread overview]
Message-ID: <1406809657-2489-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1406809657-2489-1-git-send-email-s.hauer@pengutronix.de>

We need fdtget in subsequent patches, so compile it.
Unfortunately this is not straight forward. fdtget needs libfdt,
but the Kernel Build System is not prepared for compiling
libraries for the host or binaries from files in multiple directories.
This patch moves the libfdt files to the dtc toplevel directory and
compiles fdtget as a binary from multiple source files but from
the same directory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 scripts/dtc/Makefile                       | 17 +++++++++++++++--
 scripts/dtc/{libfdt => }/fdt.c             |  0
 scripts/dtc/{libfdt => }/fdt.h             |  0
 scripts/dtc/{libfdt => }/fdt_empty_tree.c  |  0
 scripts/dtc/{libfdt => }/fdt_ro.c          |  0
 scripts/dtc/{libfdt => }/fdt_rw.c          |  0
 scripts/dtc/{libfdt => }/fdt_strerror.c    |  0
 scripts/dtc/{libfdt => }/fdt_sw.c          |  0
 scripts/dtc/{libfdt => }/fdt_wip.c         |  0
 scripts/dtc/{libfdt => }/libfdt.h          |  0
 scripts/dtc/{libfdt => }/libfdt_env.h      |  0
 scripts/dtc/{libfdt => }/libfdt_internal.h |  0
 12 files changed, 15 insertions(+), 2 deletions(-)
 rename scripts/dtc/{libfdt => }/fdt.c (100%)
 rename scripts/dtc/{libfdt => }/fdt.h (100%)
 rename scripts/dtc/{libfdt => }/fdt_empty_tree.c (100%)
 rename scripts/dtc/{libfdt => }/fdt_ro.c (100%)
 rename scripts/dtc/{libfdt => }/fdt_rw.c (100%)
 rename scripts/dtc/{libfdt => }/fdt_strerror.c (100%)
 rename scripts/dtc/{libfdt => }/fdt_sw.c (100%)
 rename scripts/dtc/{libfdt => }/fdt_wip.c (100%)
 rename scripts/dtc/{libfdt => }/libfdt.h (100%)
 rename scripts/dtc/{libfdt => }/libfdt_env.h (100%)
 rename scripts/dtc/{libfdt => }/libfdt_internal.h (100%)

diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 2a48022..a062233 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -1,15 +1,20 @@
 # scripts/dtc makefile
 
-hostprogs-y	:= dtc
+hostprogs-y	:= dtc fdtget
 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
 
+libfdt-objs	= fdt.o fdt_ro.o fdt_strerror.o fdt_wip.o
+libfdt-objs	+= fdt_empty_tree.o fdt_rw.o fdt_sw.o
+
+fdtget-objs	+= fdtget.o $(libfdt-objs) util.o
+
 # Source files need to get at the userspace version of libfdt_env.h to compile
 
-HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt
+HOSTCFLAGS_DTC := -I$(src)
 
 HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC)
 HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC)
@@ -21,6 +26,14 @@ HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
 HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
 HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC)
 
+HOSTCFLAGS_fdt.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fdt_ro.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fdt_strerror.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fdt_wip.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fdt_empty_tree.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fdt_rw.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fdt_sw.o := $(HOSTCFLAGS_DTC)
+
 HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
 HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
 
diff --git a/scripts/dtc/libfdt/fdt.c b/scripts/dtc/fdt.c
similarity index 100%
rename from scripts/dtc/libfdt/fdt.c
rename to scripts/dtc/fdt.c
diff --git a/scripts/dtc/libfdt/fdt.h b/scripts/dtc/fdt.h
similarity index 100%
rename from scripts/dtc/libfdt/fdt.h
rename to scripts/dtc/fdt.h
diff --git a/scripts/dtc/libfdt/fdt_empty_tree.c b/scripts/dtc/fdt_empty_tree.c
similarity index 100%
rename from scripts/dtc/libfdt/fdt_empty_tree.c
rename to scripts/dtc/fdt_empty_tree.c
diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/fdt_ro.c
similarity index 100%
rename from scripts/dtc/libfdt/fdt_ro.c
rename to scripts/dtc/fdt_ro.c
diff --git a/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/fdt_rw.c
similarity index 100%
rename from scripts/dtc/libfdt/fdt_rw.c
rename to scripts/dtc/fdt_rw.c
diff --git a/scripts/dtc/libfdt/fdt_strerror.c b/scripts/dtc/fdt_strerror.c
similarity index 100%
rename from scripts/dtc/libfdt/fdt_strerror.c
rename to scripts/dtc/fdt_strerror.c
diff --git a/scripts/dtc/libfdt/fdt_sw.c b/scripts/dtc/fdt_sw.c
similarity index 100%
rename from scripts/dtc/libfdt/fdt_sw.c
rename to scripts/dtc/fdt_sw.c
diff --git a/scripts/dtc/libfdt/fdt_wip.c b/scripts/dtc/fdt_wip.c
similarity index 100%
rename from scripts/dtc/libfdt/fdt_wip.c
rename to scripts/dtc/fdt_wip.c
diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt.h
similarity index 100%
rename from scripts/dtc/libfdt/libfdt.h
rename to scripts/dtc/libfdt.h
diff --git a/scripts/dtc/libfdt/libfdt_env.h b/scripts/dtc/libfdt_env.h
similarity index 100%
rename from scripts/dtc/libfdt/libfdt_env.h
rename to scripts/dtc/libfdt_env.h
diff --git a/scripts/dtc/libfdt/libfdt_internal.h b/scripts/dtc/libfdt_internal.h
similarity index 100%
rename from scripts/dtc/libfdt/libfdt_internal.h
rename to scripts/dtc/libfdt_internal.h
-- 
2.0.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-07-31 12:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31 12:27 [PATCH] Introduce barebox Image Metadata Sascha Hauer
2014-07-31 12:27 ` [PATCH 1/6] move file helper functions to separate file Sascha Hauer
2014-07-31 12:27 ` [PATCH 2/6] read_file: introduce read_file_2 Sascha Hauer
2014-07-31 12:27 ` [PATCH 3/6] make: build device trees with obj-dtb-y and pbl-dtb-y Sascha Hauer
2014-07-31 12:27 ` Sascha Hauer [this message]
2014-07-31 12:27 ` [PATCH 5/6] make: Use shell script to generate .dtb.S files Sascha Hauer
2014-07-31 12:27 ` [PATCH 6/6] Add support for metadata in barebox images Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406809657-2489-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox