Re: [5/5] include tuning options into Makefile
From: Arnd Bergmann <arnd@arndb.de>
Date: 2008-07-21 09:56:02
On Monday 21 July 2008, Marvin wrote:
+# optimize for specific cpu +ifeq ($(CONFIG_TUNE_RS64),y) + =A0 =A0KBUILD_CFLAGS +=3D $(call cc-option,-mcpu=3Drs64) +else ifeq ($(CONFIG_TUNE_POWER3),y) + =A0 =A0KBUILD_CFLAGS +=3D $(call cc-option,-mcpu=3Dpower3) +else ifeq ($(CONFIG_TUNE_POWER4),y) + =A0 =A0KBUILD_CFLAGS +=3D $(call cc-option,-mcpu=3D$(P4CPU)) +else ifeq ($(CONFIG_TUNE_CELL),y) + =A0 =A0KBUILD_CFLAGS +=3D $(call cc-option,-mcpu=3Dcell,-mtune=3Dcell) +else ifeq ($(CONFIG_TUNE_POWER5),y) + =A0 =A0KBUILD_CFLAGS +=3D $(call cc-option,-mcpu=3Dpower5,-mtune=3Dpowe=
r5)
+else ifeq ($(CONFIG_TUNE_POWER6),y) + =A0 =A0KBUILD_CFLAGS +=3D $(call cc-option,-mcpu=3Dpower6,-mtune=3Dpowe=
r6)
=A0endif -else -LDFLAGS_MODULE=A0+=3D 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) + =A0 =A0KBUILD_CFLAGS :=3D $(subst mcpu,mtune,$(KBUILD_CFLAGS)) =A0endif =A0
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=3Dpower4 -mtune=3Dpower6". Arnd <><