On Mon, 29 Apr 2002 18:03:37 +1000, Brendan J Simon <[EMAIL PROTECTED]> wrote: >Keith Owens wrote: > >>base_target(zlib_dummy) # so it does not default to vmlinux >>objlink(zlib.a zlib.o) >>select(zlib.a) >> >Can the "zlib_dummy" identifier be called zlib.a ? >Is that too confusing ??
Not to kbuild, it might be confusing to humans. >>Is zlib.a only used in zvmlinux or will it be used by multiple boot >>loader targets? It makes a difference to the best way to handle it. >> >It looks like multiple boot loader targets use zlib.a. >/arch/ppc/boot/chrp >/arch/ppc/boot/mbx >/arch/ppc/boot/pmac >/arch/ppc/boot/prep >/arch/ppc/boot/simple >/arch/ppc/boot/tree > >What's the best way to handle it for all these bootloader targets ? Normally I recommend that each object that is to be linked into a target be explicitly specified against each base target that uses it, like this. base_target(abc) select(foo.o) base_target(def) select(foo.o) base_target(xyz) select(foo.o) And each base target has link_subdir(foo_directory). Explicitly specifying objects against each base that uses them is self documenting and checking. Libraries are a special case, they are meant to used repeatedly so doing a separate select() for each base target provides no extra information, and can be downright ugly. For a library, do one dummy base target and select it once. Then manually append the librray name to the object list for each base target. For example, base_target(zlib.a) objlink(zlib.a zlib.o) select(zlib.a) Other directory :- base_target(XXX) select(abc.o) link_subdirs(def) XXX_objects := $(__pp_XXX_objects) # automatically filled in by kbuild XXX_objects += $(objfile /arch/$(ARCH)/zlib.a) user_command(XXX ($(XXX_objects) ... Real example from ia64. installable(CONFIG_IA64_SGI_SN fprom) base_target(fprom) select(fpromasm.o main.o fw-emu.o fpmem.o klgraph_init.o) fprom_objects := $(__pp_fprom_objects) fprom_objects += $(objfile /arch/$(ARCH)/lib/lib.a) user_command(fprom ($(fprom_objects)) ($(LD) -static -T$(srcfile fprom.lds) $(fprom_objects) -o $@) () ) _______________________________________________ kbuild-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/kbuild-devel