Re: [U-Boot] [PATCH 00/18] Third step towards Kbuild: Convert rest of makefiles

2013-11-04 Thread Tom Rini
On Mon, Oct 21, 2013 at 11:53:23AM +0900, Masahiro Yamada wrote:

> This series uses the followings as prerequisites:
>  - First step towards Kbuild: Use Kbuild style makefiles (19 patch files)
>  - Second step towards Kbuild: Descend down like Kbuild (6 patch files)
> 
> In 'First step towards Kbuild' series, I changed more than 150 makefiles.
> And in this series, I have changed the remainders, more than 600 makefiles.
> 
> After applying first step thru third step, all makefiles under
> arch/, board/, drivers/, api/, common/, disk/, dts/,
> fs/, lib/, net/, post/, test/
> are converted to Kbuild style.
> 
> ( doc/, tools/, nand_spl/, example/ have not been changed yet.
> I'm planning to convert these directories.
> But I need something prepared before that: hostprogs-y, etc.)
> 
> 
> Before converting makefiles to Kbuild style,
> I want to fix some makefile.
> This is done in 01/18 and 02/18.
> 
> 
> 01/18 fixes the link error of sparc architecture.
> Please see the snippet of arch/sparc/lib/Makefile:
> 
> 
> LIB = $(obj)lib$(ARCH).o
> 
> SOBJS   =
> 
> COBJS   = board.o cache.o interrupts.o time.o
> COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
> 
> SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> OBJS:= $(addprefix $(obj),$(SOBJS) $(COBJS))
> 
> $(LIB): $(obj).depend $(OBJS)
> $(call cmd_link_o_target, $(OBJS))
> 
> 
> Both COBJS and COBJS-y are used.
> But this makefile missed to add $(COBJS-y) to OBJS.
> So, bootm.o is never compiled.
> 
> Here, you will notice the advantage of switching to Kbuild style.
> 
> Makefiles in sub-directories have very similar form.
> But there exists a slight difference for each Makefile.
> 
> For ex. some makefiles use COBJS and the others use COBJS-y.
> Some use both of them mixed, and sometimes a mistake like above happens.
> We should use consistently use obj-y, for both C and Assembler objects.
> 
> 
> 02/18 fixes arch/sh/cpu/{sh2,sh3,sh4}/Makefile.
> The snippet is as follows:
> 
> LIB = $(obj)lib$(CPU).o
> 
> SOBJS   = start.o
> COBJS   = cpu.o interrupts.o watchdog.o
> 
> SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> OBJS:= $(addprefix $(obj),$(COBJS))
> SOBJS   := $(addprefix $(obj),$(SOBJS))
> 
> $(LIB): $(OBJS) $(SOBJS)
> $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> 
> start.o is linked into lib$(CPU).o, but it shouldn't.
> 
> 
> 03/18 thru 15/18 convert arch-specific, board-specific makefiles.
> 
> 
> 16/18, 17/18 convert commonly used directories.
> 
> 16/18 shows another big advantage of switching to Kbuild style.
> Check how simply post/Makefile was re-written by using
>   obj-$(CONFIG-FOO) += foo/
> systax.
> 
> 
> 18/18 convert the rest of makefiles and abolishes the support
> for U-Boot conventional makefile.
> After this commit, we cannot use U-Boot style makefiles any more.
> (exception: doc/, tools/, nand_spl/, example/ directory)
> Going forward, we must use only Kbuild style makefiles.
> Take care when you add a new makefile!
> 
> 
> Of course, I tested carefully this series.
> I built as many boards as possible over all architectures.
> 
> Here is the site I downloaded the prebuilt crosstools from:
> 
>   - arm, avr32, m68k, mips, openrisc, powerpc, x86:
>   ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/
>   
>   - blackfin, microblaze, nds32, nios2, sh, sparc:
>   http://dev.gentoo.org/~vapier/u-boot/
> 
> 
> I could not build some boards because the boards are
> already broken before this series or the crosstools are not suitable.
> But I could build more than 1100 target boards and
> I confirmed this series does no harm.
> 
>  -  02 thru 18 did not break any boards.
>  -  02 thru 15 and 17, 18 did not change output ELF files at all.
> This was check by comparing md5sum.
>  -  It was difficult to simply compare md5sum for patch 16
> because it changes how the objects are linked under post/ directory.
> But I confirmed 16 did not change the section size.
> 
> Note:
> For comparing md5sum, there are some items you should take into account:
> Disabling time stamp, version, compiling in the same path, linking the
> objects in the same order...
> For detailed, refer to
> [U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles
> Message-Id: <20130917093533.738a.aa925...@jp.panasonic.com>
> 
> 
> Note2:
> I confirmed this series can be applied on
> v2013.10 tag
>  + First step towards Kbuild: Use Kbuild style makefiles (19 patch files)
>  + Second step towards Kbuild: Descend down like Kbuild (6 patch files)
> 
> 
> Cc: Simon Glass 
> Cc: Tom Rini 
> Cc: Wolfgang Denk 
> Cc: Gerhard Sittig 
> 
> Masahiro Yamada (18):
>   sparc: fix a link error
>   sh: Do not include start.o in lib$(CPU).o
>   sparc: convert makefiles to Kbuild style
>   sh: convert makefiles to Kbuild style
>   avr32: convert makefiles to Kbuild style
>   openrisc: convert makefiles to Kbuild style
>   microblaze: convert makefiles to Kbuild style
>   mi

Re: [U-Boot] [PATCH 00/18] Third step towards Kbuild: Convert rest of makefiles

2013-11-04 Thread Andreas Bießmann
Dear Masahiro Yamada,
Dear Tom Rini,

On 10/21/2013 04:53 AM, Masahiro Yamada wrote:



what is the time line for integrating Kbuild?

I have some changes which would also touch makefiles and wonder if I
should wait for Kbuild integration.

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 00/18] Third step towards Kbuild: Convert rest of makefiles

2013-10-27 Thread Marek Vasut
Dear Masahiro Yamada,

> This series uses the followings as prerequisites:
>  - First step towards Kbuild: Use Kbuild style makefiles (19 patch files)
>  - Second step towards Kbuild: Descend down like Kbuild (6 patch files)
> 
> In 'First step towards Kbuild' series, I changed more than 150 makefiles.
> And in this series, I have changed the remainders, more than 600 makefiles.
> 
> After applying first step thru third step, all makefiles under
> arch/, board/, drivers/, api/, common/, disk/, dts/,
> fs/, lib/, net/, post/, test/
> are converted to Kbuild style.
> 
> ( doc/, tools/, nand_spl/, example/ have not been changed yet.
> I'm planning to convert these directories.
> But I need something prepared before that: hostprogs-y, etc.)
> 
> 
> Before converting makefiles to Kbuild style,
> I want to fix some makefile.
> This is done in 01/18 and 02/18.
> 
> 
> 01/18 fixes the link error of sparc architecture.
> Please see the snippet of arch/sparc/lib/Makefile:
> 
> 
> LIB = $(obj)lib$(ARCH).o
> 
> SOBJS   =
> 
> COBJS   = board.o cache.o interrupts.o time.o
> COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
> 
> SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> OBJS:= $(addprefix $(obj),$(SOBJS) $(COBJS))
> 
> $(LIB): $(obj).depend $(OBJS)
> $(call cmd_link_o_target, $(OBJS))
> 
> 
> Both COBJS and COBJS-y are used.
> But this makefile missed to add $(COBJS-y) to OBJS.
> So, bootm.o is never compiled.
> 
> Here, you will notice the advantage of switching to Kbuild style.
> 
> Makefiles in sub-directories have very similar form.
> But there exists a slight difference for each Makefile.
> 
> For ex. some makefiles use COBJS and the others use COBJS-y.
> Some use both of them mixed, and sometimes a mistake like above happens.
> We should use consistently use obj-y, for both C and Assembler objects.
> 
> 
> 02/18 fixes arch/sh/cpu/{sh2,sh3,sh4}/Makefile.
> The snippet is as follows:
> 
> LIB = $(obj)lib$(CPU).o
> 
> SOBJS   = start.o
> COBJS   = cpu.o interrupts.o watchdog.o
> 
> SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> OBJS:= $(addprefix $(obj),$(COBJS))
> SOBJS   := $(addprefix $(obj),$(SOBJS))
> 
> $(LIB): $(OBJS) $(SOBJS)
> $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> 
> start.o is linked into lib$(CPU).o, but it shouldn't.
> 
> 
> 03/18 thru 15/18 convert arch-specific, board-specific makefiles.
> 
> 
> 16/18, 17/18 convert commonly used directories.
> 
> 16/18 shows another big advantage of switching to Kbuild style.
> Check how simply post/Makefile was re-written by using
>   obj-$(CONFIG-FOO) += foo/
> systax.
> 
> 
> 18/18 convert the rest of makefiles and abolishes the support
> for U-Boot conventional makefile.
> After this commit, we cannot use U-Boot style makefiles any more.
> (exception: doc/, tools/, nand_spl/, example/ directory)
> Going forward, we must use only Kbuild style makefiles.
> Take care when you add a new makefile!
> 
> 
> Of course, I tested carefully this series.
> I built as many boards as possible over all architectures.
> 
> Here is the site I downloaded the prebuilt crosstools from:
> 
>   - arm, avr32, m68k, mips, openrisc, powerpc, x86:
>   ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/
> 
>   - blackfin, microblaze, nds32, nios2, sh, sparc:
>   http://dev.gentoo.org/~vapier/u-boot/
> 
> 
> I could not build some boards because the boards are
> already broken before this series or the crosstools are not suitable.
> But I could build more than 1100 target boards and
> I confirmed this series does no harm.
> 
>  -  02 thru 18 did not break any boards.
>  -  02 thru 15 and 17, 18 did not change output ELF files at all.
> This was check by comparing md5sum.
>  -  It was difficult to simply compare md5sum for patch 16
> because it changes how the objects are linked under post/ directory.
> But I confirmed 16 did not change the section size.
> 
> Note:
> For comparing md5sum, there are some items you should take into account:
> Disabling time stamp, version, compiling in the same path, linking the
> objects in the same order...
> For detailed, refer to
> [U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style
> makefiles Message-Id: <20130917093533.738a.aa925...@jp.panasonic.com>
> 
> 
> Note2:
> I confirmed this series can be applied on
> v2013.10 tag
>  + First step towards Kbuild: Use Kbuild style makefiles (19 patch files)
>  + Second step towards Kbuild: Descend down like Kbuild (6 patch files)
> 
> 
> Cc: Simon Glass 
> Cc: Tom Rini 
> Cc: Wolfgang Denk 
> Cc: Gerhard Sittig 
[...]

Reviewed-by: Marek Vasut 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 00/18] Third step towards Kbuild: Convert rest of makefiles

2013-10-20 Thread Masahiro Yamada
This series uses the followings as prerequisites:
 - First step towards Kbuild: Use Kbuild style makefiles (19 patch files)
 - Second step towards Kbuild: Descend down like Kbuild (6 patch files)

In 'First step towards Kbuild' series, I changed more than 150 makefiles.
And in this series, I have changed the remainders, more than 600 makefiles.

After applying first step thru third step, all makefiles under
arch/, board/, drivers/, api/, common/, disk/, dts/,
fs/, lib/, net/, post/, test/
are converted to Kbuild style.

( doc/, tools/, nand_spl/, example/ have not been changed yet.
I'm planning to convert these directories.
But I need something prepared before that: hostprogs-y, etc.)


Before converting makefiles to Kbuild style,
I want to fix some makefile.
This is done in 01/18 and 02/18.


01/18 fixes the link error of sparc architecture.
Please see the snippet of arch/sparc/lib/Makefile:


LIB = $(obj)lib$(ARCH).o

SOBJS   =

COBJS   = board.o cache.o interrupts.o time.o
COBJS-$(CONFIG_CMD_BOOTM) += bootm.o

SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS:= $(addprefix $(obj),$(SOBJS) $(COBJS))

$(LIB): $(obj).depend $(OBJS)
$(call cmd_link_o_target, $(OBJS))


Both COBJS and COBJS-y are used.
But this makefile missed to add $(COBJS-y) to OBJS.
So, bootm.o is never compiled.

Here, you will notice the advantage of switching to Kbuild style.

Makefiles in sub-directories have very similar form.
But there exists a slight difference for each Makefile.

For ex. some makefiles use COBJS and the others use COBJS-y.
Some use both of them mixed, and sometimes a mistake like above happens.
We should use consistently use obj-y, for both C and Assembler objects.


02/18 fixes arch/sh/cpu/{sh2,sh3,sh4}/Makefile.
The snippet is as follows:

LIB = $(obj)lib$(CPU).o

SOBJS   = start.o
COBJS   = cpu.o interrupts.o watchdog.o

SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS:= $(addprefix $(obj),$(COBJS))
SOBJS   := $(addprefix $(obj),$(SOBJS))

$(LIB): $(OBJS) $(SOBJS)
$(call cmd_link_o_target, $(OBJS) $(SOBJS))

start.o is linked into lib$(CPU).o, but it shouldn't.


03/18 thru 15/18 convert arch-specific, board-specific makefiles.


16/18, 17/18 convert commonly used directories.

16/18 shows another big advantage of switching to Kbuild style.
Check how simply post/Makefile was re-written by using
  obj-$(CONFIG-FOO) += foo/
systax.


18/18 convert the rest of makefiles and abolishes the support
for U-Boot conventional makefile.
After this commit, we cannot use U-Boot style makefiles any more.
(exception: doc/, tools/, nand_spl/, example/ directory)
Going forward, we must use only Kbuild style makefiles.
Take care when you add a new makefile!


Of course, I tested carefully this series.
I built as many boards as possible over all architectures.

Here is the site I downloaded the prebuilt crosstools from:

  - arm, avr32, m68k, mips, openrisc, powerpc, x86:
  ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/
  
  - blackfin, microblaze, nds32, nios2, sh, sparc:
  http://dev.gentoo.org/~vapier/u-boot/


I could not build some boards because the boards are
already broken before this series or the crosstools are not suitable.
But I could build more than 1100 target boards and
I confirmed this series does no harm.

 -  02 thru 18 did not break any boards.
 -  02 thru 15 and 17, 18 did not change output ELF files at all.
This was check by comparing md5sum.
 -  It was difficult to simply compare md5sum for patch 16
because it changes how the objects are linked under post/ directory.
But I confirmed 16 did not change the section size.

Note:
For comparing md5sum, there are some items you should take into account:
Disabling time stamp, version, compiling in the same path, linking the
objects in the same order...
For detailed, refer to
[U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles
Message-Id: <20130917093533.738a.aa925...@jp.panasonic.com>


Note2:
I confirmed this series can be applied on
v2013.10 tag
 + First step towards Kbuild: Use Kbuild style makefiles (19 patch files)
 + Second step towards Kbuild: Descend down like Kbuild (6 patch files)


Cc: Simon Glass 
Cc: Tom Rini 
Cc: Wolfgang Denk 
Cc: Gerhard Sittig 

Masahiro Yamada (18):
  sparc: fix a link error
  sh: Do not include start.o in lib$(CPU).o
  sparc: convert makefiles to Kbuild style
  sh: convert makefiles to Kbuild style
  avr32: convert makefiles to Kbuild style
  openrisc: convert makefiles to Kbuild style
  microblaze: convert makefiles to Kbuild style
  mips: convert makefiles to Kbuild style
  nds32: convert makefiles to Kbuild style
  nios2: convert makefiles to Kbuild style
  x86: convert makefiles to Kbuild style
  m68k: convert makefiles to Kbuild style
  blackfin: convert makefiles to Kbuild style
  board: arm: convert makefiles to Kbuild style
  board: powerpc: convert makefiles to Kbuild style
  p