On Fri, 26 Apr 2002 15:07:31 +1000, 
Brendan J Simon <[EMAIL PROTECTED]> wrote:
>
>I'm trying to use select() after a base_target() statement.  Does 
>select() behave differently in this case ?
>I'm getting the following error message:
>...local object names must not contain '/' at 'arch/ppc/boot/common/dummy.o'
>
>My Makefile.in looks like:
>
>base_target(zvmlinux)
>select(image.o)
>select(/arch/ppc/boot/common/dummy.o) # The original Makefile references 
>../common/dummy.o
>
>Is there anything wrong with the above statement.

One of my design rules for kbuild was to keep information local.  With
the existing system you have to search through multiple makefiles to
see what is being built in each directory, which is an abomination.

kbuild 2.5 restricts select() to objects in the local directory, to see
what is being built in a directory you only look in one Makefile.in.
Once an object has been selected, link_subdirs() defines the order in
which the base target is linked.

You have the same problem that superh had, linking from multiple
directories which are not in a parent/child relationship.  Under
arch/sh we have

Makefile.in

  #
  # This is needed to provide a dummy root directory for
  # the bootloader, because the first directory its 
  # mentioned in is not a common ancestor of all the
  # directories its mentioned in.
  #
  base_target(vmlinux_boot)
  link_subdirs(boot/compressed)

boot/compressed/Makefile.in

  base_target(vmlinux_boot)
  select(head.o misc.o)
  # Links in sh_bios.o
  link_subdirs(/arch/sh/kernel)
  select(piggy.o)
  vmlinux_boot_objects    := $(__pp_vmlinux_boot_objects)
  user_command(vmlinux
          ($(vmlinux_boot_objects))
          ($(LD) $(boot_ldflags) $(ZLINKFLAGS) $(vmlinux_boot_objects) -o $@)
          ()
          )

kernel/Makefile.in

  #
  # The following lines are used when this directory is
  # referenced by the link_subdirs() statement in
  # arch/sh/kernel/boot/compressed/Makefile.in.
  #
  base_target(vmlinux_boot)
  select(CONFIG_SH_STANDARD_BIOS sh_bios.o)

Taking those in order.  The first directory (in kernel tree order) that
mentions a base target is the root of the link tree for that target.
With most base targets where the code is in a clean parent/child order,
this default is exactly what is required.  When the objects are
scattered around, the default is incorrect so you can override the
default by adding a dummy mention in a higher directory, hence the
lines in arch/sh/Makefile.in.

The link list for sh vmlinux_boot is

  arch/sh/boot/compressed/head.o       (select in boot/compressed/Makefile.in)
  arch/sh/boot/compressed/misc.o       (select in boot/compressed/Makefile.in)
    optional arch/sh/kernel/sh_bios.o  (link_subdirs to /arch/sh/kernel then select in 
kernel/Makefile.in)
  arch/sh/boot/compressed/piggy.o      (select in boot/compressed/Makefile.in)

The line vmlinux_boot_objects := $(__pp_vmlinux_boot_objects) inserts
the link order as calculated by kbuild 2.5.  You do not have to track
which objects are used, kbuild does it for you.

Note: core-6 had a bug in link_subdirs() with an absolute path, use
core-7.

>I'm still not sure 
>how to use select() for the base_target.  Does this list all objects 
>that are to be compiled into the base_target ?  What about libs, etc ?

Everything to be linked into a base target should be mentioned in a
select() statement, including libs.  If the objects are in multiple
directories, also use link_subdirs() to define the order that entries
from each directory are to be linked together.  Finally use

  XXX_objects    := $(__pp_XXX_objects)

to get the guaranteed accurate list of objects to be linked into
base_target(XXX).  This is _exactly_ the same mechanism used for
vmlinux itself, select within a directory, link_subdirs across
directories, get the complete list from kbuild 2.5 at the end.


_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to