handling "multi-part" source files

Robert P. J. Day rpjday at mindspring.com
Thu May 11 16:34:19 UTC 2006


On Thu, 11 May 2006, Rob Landley wrote:

> If we have a .c file, figuring out how to build it is easy.  If we
> need a .o file, figuring out where it lives is somewhat harder.
> Possibly this properly belongs in the dependency generation step?

that's what the "objrule" macro is doing -- it's being invoked to
create the appropriate dependency between an object file and its
containing multi-part source file.

> Or is there an easy way in makefilese to create a list of .c files,
> each with a list of .o files they can create, and given a .o file
> find the corresponding .c file for it without running grep *.c more
> than once per directory during a build?

the logic in the make stuff i posted isn't doing multiple greps on
source files.  the logic is:

  for each multi-part source file {
    generate the list of corresponding object files
    generate the rule to build each object file from that source file
  }

that's it.  it's not doing multiple passes.  at least, i don't *think*
it is, or maybe i'm not catching what you're asking.

rday



More information about the busybox mailing list