Re: RfC: Don't cd into subdirs during kbuild

From: Sam Ravnborg (sam@ravnborg.org)
Date: Thu Oct 03 2002 - 14:26:18 EST


On Wed, Oct 02, 2002 at 09:59:00PM -0500, Kai Germaschewski wrote:
>
> Hi,
>
> I'd appreciate to get comments on the appended patch. It's mostly cleanups
> and the like, but the interesting part is the last cset, which is actually
> fairly small:

Tried out what I pulled from linux-2.5.make

1) warning present in Makefile
2) Annoying /././ when doing make dep
3) Did a ld built-in.o in scripts, despite obj-y is empty
   - When i changed "=" to ":=" to fix next error ar failed.

ifdef O_TARGET replaced with ifdef obj-y to make it work

4) Could not link, no *.o file were used as parameters to ld

cmd_link_o_target := $(if $(strip $(obj-y)),\
                      $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^),\
                      rm -f $@; $(AR) rcs $@)

$(O_TARGET): $(obj-y) FORCE
        @echo XXXXX $^
        @echo $(obj-y) - $@

Result:
make[1]: Entering directory `/home/sam/src/linux/kernel/bk/kai-make/init'
  Generating /home/sam/src/linux/kernel/bk/kai-make/include/linux/compile.h (unchanged)
XXXXX main.o version.o do_mounts.o FORCE
./main.o ./version.o ./do_mounts.o - built-in.o
   ld -m elf_i386 -r -o
ld: unrecognized option '-o'
ld: use the --help option for usage information

It seems that make strips "./" in front of all .o files listed in obj-y
Utilising $(filter-out FORCE,$(obj-y) did the trick for me.

[sam@mars kai-make]$ make -v
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.

Hmmm, was the stuff present at bkbits incomplete?

        Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:41 EST