[5/5] include tuning options into Makefile
Arnd Bergmann
arnd at arndb.de
Mon Jul 21 19:55:59 EST 2008
On Monday 21 July 2008, Marvin wrote:
> +# optimize for specific cpu
> +ifeq ($(CONFIG_TUNE_RS64),y)
> + KBUILD_CFLAGS += $(call cc-option,-mcpu=rs64)
> +else ifeq ($(CONFIG_TUNE_POWER3),y)
> + KBUILD_CFLAGS += $(call cc-option,-mcpu=power3)
> +else ifeq ($(CONFIG_TUNE_POWER4),y)
> + KBUILD_CFLAGS += $(call cc-option,-mcpu=$(P4CPU))
> +else ifeq ($(CONFIG_TUNE_CELL),y)
> + KBUILD_CFLAGS += $(call cc-option,-mcpu=cell,-mtune=cell)
> +else ifeq ($(CONFIG_TUNE_POWER5),y)
> + KBUILD_CFLAGS += $(call cc-option,-mcpu=power5,-mtune=power5)
> +else ifeq ($(CONFIG_TUNE_POWER6),y)
> + KBUILD_CFLAGS += $(call cc-option,-mcpu=power6,-mtune=power6)
> endif
> -else
> -LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
I think it would be easier to express this logic in Kconfig than in
Makefile.
> +
> +ifneq ($(CONFIG_OPT_EXCLUSIVE),y)
> + KBUILD_CFLAGS := $(subst mcpu,mtune,$(KBUILD_CFLAGS))
> endif
>
This still doesn't allow the most interesting case where you want to
optimize for a modern CPU but still allow older ones, e.g.
"-mcpu=power4 -mtune=power6".
Arnd <><
More information about the Linuxppc-dev
mailing list