All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Milton Miller <miltonm@bga.com>, ppcdev <linuxppc-dev@ozlabs.org>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: Merge dtc
Date: Fri, 19 Oct 2007 20:42:49 +0200	[thread overview]
Message-ID: <20071019184249.GA32015@uranus.ravnborg.org> (raw)
In-Reply-To: <20071019071033.GB27017@localhost.localdomain>

Hi David.

> > Give me a day or two then I shall give it a try and see what I can
> > do about it.  I will use the previsous posted URL as basis if you do
> > not tell me otherwise.
> 
> Thank you.  The previous URL should be fine, I've made no changes
> since then.

I decided to go for a kbuild specific version integrated
in boot/Makefile.
This is much more readable because this syntax is explicit.
We do not favour 3 levels of variabls to avoid rewriting the same
filename two times.
I have tested the change only with a O=.. crosscompile build.

I have tested the patch with and without DTC_GENPARSER=1.
It does not rebuild if not needed and is OK with -j10 builds.

Please consider this version in favour of your old version.

Take this as review feedback.

You can add:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org> [kbuild integration only]

Thanks,
	Sam

 arch/powerpc/boot/Makefile |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 18e3271..064dc07 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -108,17 +108,53 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
 $(obj)/wrapper.a: $(obj-wlib) FORCE
 	$(call if_changed,bootar)
 
-hostprogs-y	:= addnote addRamDisk hack-coff mktree
+hostprogs-y	:= addnote addRamDisk hack-coff mktree dtc
 
 targets		+= $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
 extra-y		:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
 		   $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
 
 wrapper		:=$(srctree)/$(src)/wrapper
-wrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
+wrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
 			$(wrapper) FORCE
 
 #############
+# Bits for building dtc
+# DTC_GENPARSER	:= 1	# Uncomment to rebuild flex/bison output
+
+dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o
+dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
+dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
+
+# prerequisites on generated files needs to be explicit
+$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
+$(obj)/dtc-src/dtc-lexer.lex.o:  $(obj)/dtc-src/dtc-lexer.lex.c
+$(obj)/dtc-src/data.o:           $(obj)/dtc-src/dtc-parser.tab.h
+
+HOSTCFLAGS += -I$(src)/dtc-src/
+
+targets += dtc-src/dtc-parser.tab.c
+targets += dtc-src/dtc-lexer.lex.c
+
+ifdef DTC_GENPARSER
+BISON = bison
+FLEX = flex
+
+quiet_cmd_bison = BISON   $@
+      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
+quiet_cmd_flex = FLEX    $@
+      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
+
+$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
+	$(call if_changed,bison)
+
+$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
+
+$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
+	$(call if_changed,flex)
+endif
+
+#############
 # Bits for building various flavours of zImage
 
 ifneq ($(CROSS32_COMPILE),)

  reply	other threads:[~2007-10-19 18:41 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18 17:49 Merge dtc Milton Miller
2007-10-18 19:59 ` Sam Ravnborg
2007-10-19  1:45   ` David Gibson
2007-10-19  5:56     ` Milton Miller
2007-10-19  6:55       ` David Gibson
2007-10-19  7:07         ` Sam Ravnborg
2007-10-19  7:10           ` David Gibson
2007-10-19 18:42             ` Sam Ravnborg [this message]
2007-10-31  2:45               ` David Gibson
2007-11-08 13:59                 ` Jon Loeliger
2007-10-19  1:30 ` David Gibson
2007-10-19  5:34   ` Milton Miller
  -- strict thread matches above, loose matches on Subject: below --
2007-10-16  5:02 David Gibson
2007-10-16  5:08 ` Kumar Gala
2007-10-16  5:18   ` David Gibson
2007-10-16  5:39   ` Paul Mackerras
2007-10-16  5:50     ` Kumar Gala
2007-10-16  6:01       ` Benjamin Herrenschmidt
2007-10-16  6:23         ` Kumar Gala
2007-10-16 10:53         ` Josh Boyer
2007-10-17 19:59       ` Timur Tabi
2007-10-17 20:12         ` Josh Boyer
2007-10-17 20:31           ` Grant Likely
2007-10-17 21:42         ` Linas Vepstas
2007-10-17 21:51           ` Jon Loeliger
2007-10-16  6:00     ` Benjamin Herrenschmidt
2007-10-16  6:24       ` Kumar Gala
2007-10-16 13:17 ` Grant Likely
2007-10-16 13:41   ` Kumar Gala
2007-10-17  5:22   ` David Gibson
2007-10-17 13:15     ` Grant Likely
2007-10-17 16:22       ` Stephen Neuendorffer
2007-12-04  1:59 ` David Woodhouse
2007-12-04  3:10   ` David Gibson
2007-12-04 17:22     ` David Woodhouse
2007-12-04 13:25   ` Jon Loeliger
2007-12-04 15:26     ` Josh Boyer
2007-12-04 16:04       ` Kumar Gala
2007-12-04 22:12         ` David Gibson
2007-12-04 16:08     ` Scott Wood
2007-12-04 22:21   ` Paul Mackerras
2007-12-04 22:33     ` David Woodhouse
2007-12-05  0:54       ` David Woodhouse
2007-12-05  1:49         ` Josh Boyer
2007-12-05  1:09       ` Paul Mackerras
2007-12-04 22:34     ` Josh Boyer
2007-12-05  2:22       ` Paul Mackerras
2007-12-05  2:26         ` Josh Boyer
2007-12-05  4:00           ` Josh Boyer
2007-12-05  4:37             ` Olof Johansson

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=20071019184249.GA32015@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.