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

From: Sam Ravnborg (sam@ravnborg.org)
Date: Thu Oct 03 2002 - 15:01:20 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.

> -obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
> +obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
> + dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o

Should that have been:
obj-$(CONFIG_ACPI_INTERPRETER) := dsfield.o dsmthdat.o dsopcode.o...

Looks wrong to me that you remove the CONFIG_ dependency.
Same is true for the rest of this cset.

> +ifdef list-multi
> +$(warning kbuild: list-multi ($(list-multi)) is obsolete in 2.5. Please fix!)
> +endif
Since kbuild no longer support list-multi this should be $(error ....)

> -multi-used-y := $(filter-out $(list-multi),$(__multi-used-y))
Here is list-multi removed.

> SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m)))
I prefer first assignment to be := not +=
This is true for several places including several makefiles as well.

> -export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS OBJCOPYFLAGS
> +export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS
Did not see this change justified.

> -export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT
> +$(warning $(SUBDIRS))

Warning shall be deleted

> ifndef O_TARGET
> ifndef L_TARGET
> -O_TARGET := built-in.o
> +O_TARGET := $(obj)/built-in.o
> +endif
> endif
This change result in ld being called for directories like:
$(TOPDIR)/scripts
$(TOPDIR)/scripts/lxdialog
$(TOPDIR)/Documentation/DocBook
If obj-y is empty then do not define O_TARGET?

Another more general comment.
There seem to no consistency in the variables used in the first section of
the makefile. There is a mixture of lower and upper case variables:
O_TARGET, host-progs etc. This is confusing.
Furthermore the construct:
obj-y := some.o dot.o .o module.o
Seems illogical to me. What does obj-y mean to me??
mandatory-objs := some.o dot.o .o module.o
It a litte longer, but occur only once (typical) per makefile.
Thats not something I propose for now, more to be seen as a general comment
about striving for consistency in the interface to rules.make.

>
> first_rule: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
Where comes the requirement that EXTRA_TARGETS needs to be buildin?

> -cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^)
> +cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs)))),$^)
Keep a variable without obj appended would make this readable I think.

Now it's testing time..

        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