build: unify mips target cflags
authorFelix Fietkau <nbd@openwrt.org>
Thu, 26 Sep 2013 17:53:14 +0000 (17:53 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 26 Sep 2013 17:53:14 +0000 (17:53 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 38210

21 files changed:
include/target.mk
target/linux/ar71xx/Makefile
target/linux/cobalt/Makefile
target/linux/lantiq/Makefile
target/linux/lantiq/ase/target.mk
target/linux/lantiq/falcon/target.mk
target/linux/lantiq/svip_be/target.mk
target/linux/lantiq/svip_le/target.mk
target/linux/lantiq/xrx200/target.mk
target/linux/lantiq/xway/target.mk
target/linux/malta/be/target.mk
target/linux/malta/be64/target.mk
target/linux/malta/le/target.mk
target/linux/malta/le64/target.mk
target/linux/octeon/Makefile
target/linux/ramips/Makefile
target/linux/ramips/mt7620a/target.mk
target/linux/ramips/rt288x/target.mk
target/linux/ramips/rt305x/target.mk
target/linux/ramips/rt3883/target.mk
target/linux/sibyte/Makefile

index 685013c73c526090ba708b5a3ed1c6faf2c95602..f9f378a8d84594a716e27ad4920cca1b6c6cc883 100644 (file)
@@ -204,7 +204,12 @@ ifeq ($(DUMP),1)
     endif
     CPU_CFLAGS += -mno-branch-likely
     CPU_CFLAGS_mips32 = -mips32 -mtune=mips32
+    CPU_CFLAGS_mips32r2 = -mips32r2 -mtune=mips32r2
     CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64
+    CPU_CFLAGS_24kec = -mips32r2 -mtune=24kec
+    CPU_CFLAGS_34kc = -mips32r2 -mtune=34kc
+    CPU_CFLAGS_dsp = -mdsp
+    CPU_CFLAGS_dsp2 = -mdspr2
   endif
   ifeq ($(ARCH),i386)
     CPU_TYPE ?= i486
@@ -218,7 +223,7 @@ ifeq ($(DUMP),1)
     CPU_TYPE = sparc
     CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc
   endif
-  DEFAULT_CFLAGS=$(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE))
+  DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
 endif
 
 define BuildTargets/DumpCurrent
index ba63ded1ded8f83682c78b0d644bc0e4c9c2003e..e80cc5961b6e1980d6da4503de96f6c509e79b55 100644 (file)
@@ -10,7 +10,7 @@ ARCH:=mips
 BOARD:=ar71xx
 BOARDNAME:=Atheros AR7xxx/AR9xxx
 FEATURES:=squashfs targz mips16
-CFLAGS:=-Os -pipe -mips32r2 -mtune=34kc -mno-branch-likely
+CPU_TYPE=34kc
 SUBTARGETS:=generic nand
 
 LINUX_VERSION:=3.10.12
index 632b61c70ac5fa7cf7014bb5b5dfed5a0c46322b..13d3fd05daa3919d2f985d1f80479cd79a43c3a7 100644 (file)
@@ -10,7 +10,8 @@ ARCH:=mipsel
 BOARD:=cobalt
 BOARDNAME:=Cobalt Microservers
 FEATURES:=targz pci ext4 display
-CFLAGS:=-O2 -pipe -mtune=r5000
+CPU_TYPE := 5k
+CPU_CFLAGS_5k := -mtune=r5000
 MAINTAINER:=Florian Fainelli <florian@openwrt.org>
 
 LINUX_VERSION:=3.3.8
index ccb30a1a8753dd08cafe64b623bb31920607832c..fa9878831875bab76c3da8aeb028f8401cf4531e 100644 (file)
@@ -13,7 +13,7 @@ SUBTARGETS=xway xrx200 ase falcon
 
 LINUX_VERSION:=3.10.12
 
-CFLAGS=-Os -pipe -mips32r2 -mno-branch-likely
+CPU_TYPE:=mips32r2
 
 define Target/Description
        Build firmware images for Lantiq SoC
index f1f0c07eb32d8081a469dc12242da112fe274cd7..a052dd2ce79dae231275c87fccfbdb8235b3c229 100644 (file)
@@ -2,7 +2,6 @@ ARCH:=mips
 SUBTARGET:=ase
 BOARDNAME:=Amazon-SE
 FEATURES:=squashfs atm
-CFLAGS+= -mtune=mips32r2
 
 DEFAULT_PACKAGES+=kmod-pppoa ppp-mod-pppoa linux-atm atm-tools br2684ctl kmod-ltq-dsl-ase ltq-dsl-app
 
index b7af20c79c11b1eea47e75703e129e0efb2f8630..14ac402473a6f8b50c80c0bdf99ed069948a81c4 100644 (file)
@@ -3,7 +3,6 @@ SUBTARGET:=falcon
 BOARDNAME:=Falcon
 FEATURES:=squashfs
 DEVICE_TYPE:=other
-CFLAGS+= -mtune=mips32r2
 
 DEFAULT_PACKAGES+= kmod-ifxos gpon-base-files kmod-leds-gpio kmod-ledtrig-heartbeat \
        kmod-gpon-optic-drv gpon-optic-drv kmod-gpon-onu-drv gpon-onu-drv \
index ef8eeffa43a98223eecbcc568a7c2736fbfcc0c4..7cdd540590a522485965a0e002e32089648460e9 100644 (file)
@@ -3,7 +3,6 @@ SUBTARGET:=svip_be
 BOARDNAME:=SVIP Big Endian
 FEATURES:=squashfs
 DEVICE_TYPE:=other
-CFLAGS+= -mtune=mips32r2
 
 DEFAULT_PACKAGES+= uboot-svip hostapd-mini
 
index d2ccdbcfe1a61e856b56597cf2eff88632595a03..2c1ed07a4e06c07c557f6393f43caf5491f3c269 100644 (file)
@@ -3,7 +3,6 @@ SUBTARGET:=svip_le
 BOARDNAME:=SVIP Little Endian
 FEATURES:=squashfs
 DEVICE_TYPE:=other
-CFLAGS+= -mtune=mips32r2
 
 DEFAULT_PACKAGES+= uboot-svip hostapd-mini
 
index 0eb593721255004d32266d997f21ed2658edde6d..b0be140057040f955ffd0fd169aeee43bd256b8a 100644 (file)
@@ -2,7 +2,8 @@ ARCH:=mips
 SUBTARGET:=xrx200
 BOARDNAME:=XRX200
 FEATURES:=squashfs atm mips16
-CFLAGS+= -mtune=34kc -mdsp
+CPU_TYPE:=34kc
+CPU_SUBTYPE:=dsp
 
 DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug
 
index ffbc4eaefeb5795c2e7936dcb1dcaf8628930ab8..3da4638da3d3da77cfef8157ac9bc85b7da68235 100644 (file)
@@ -2,7 +2,8 @@ ARCH:=mips
 SUBTARGET:=xway
 BOARDNAME:=XWAY
 FEATURES:=squashfs atm mips16
-CFLAGS+= -mtune=34kc -mdsp
+CPU_TYPE:=34kc
+CPU_SUBTYPE:=dsp
 
 DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug
 
index a4a00b7106ece5460edd8e06dcac8c2e76cb8887..92ae58eb9d301462d4a3b374e9abbe9aa6cfe611 100644 (file)
@@ -3,7 +3,6 @@ ARCH_PACKAGES:=malta_mips
 SUBTARGET:=be
 BOARDNAME:=Big Endian
 FEATURES:=ramdisk mips16
-CFLAGS:=-Os -pipe -mips32r2 -mtune=mips32r2
 
 define Target/Description
        Build BE firmware images for MIPS Malta CoreLV board running in
index 88f7d41db20f8a283fba4389ce06113d7037bc01..dad3a1c6c5051e1f468f3b20d011df71b4611ab7 100644 (file)
@@ -3,7 +3,6 @@ ARCH_PACKAGES:=malta_mips64
 SUBTARGET:=be64
 BOARDNAME:=Big Endian (64-bits)
 FEATURES:=ramdisk
-CFLAGS:=-Os -pipe -mips64 -mtune=mips64
 
 define Target/Description
        Build BE firmware images for MIPS Malta CoreLV board running in
index e7c90e923589dbe947559328e91fa6b2000a9c85..35fcf4cfe1f87a3fb088efeee44c25d8d64e0cff 100644 (file)
@@ -3,7 +3,6 @@ ARCH_PACKAGES:=malta_mipsel
 SUBTARGET:=le
 BOARDNAME:=Little Endian
 FEATURES:=ramdisk mips16
-CFLAGS:=-Os -pipe -mips32r2 -mtune=mips32r2
 
 define Target/Description
        Build LE firmware images for MIPS Malta CoreLV board running in
index f20b3e82c5fc90b805169f18ec77d6ce57dd4ac9..26b53c12bdd832ebe61793d83b6f7086eb108195 100644 (file)
@@ -3,7 +3,6 @@ ARCH_PACKAGES:=malta_mipsel64
 SUBTARGET:=le64
 BOARDNAME:=Little Endian (64-bits)
 FEATURES:=ramdisk
-CFLAGS:=-Os -pipe -mips64 -mtune=mips64
 
 define Target/Description
        Build LE firmware images for MIPS Malta CoreLV board running in
index 12fcacb58554cf6d8329ce846e881b42945ac40c..a9fd5abfdea9fbd68b2b88cb1e93b365a548805e 100644 (file)
@@ -10,7 +10,8 @@ ARCH:=mips
 BOARD:=octeon
 BOARDNAME:=Cavium Networks Octeon
 FEATURES:=squashfs jffs2 pci usb
-CFLAGS:=-Os -pipe -march=octeon -fno-caller-saves
+CPU_TYPE:=octeon
+CPU_CFLAGS_octeon:=-march=octeon
 MAINTAINER:=John Crispin <blogic@openwrt.org>
 
 LINUX_VERSION:=3.10.12
index 512a78f414e06ed26020eefc5a28c84c540780fc..9a13a2c9a18f571b593a2fed87a72b56d4d64765 100644 (file)
@@ -10,7 +10,6 @@ ARCH:=mipsel
 BOARD:=ramips
 BOARDNAME:=Ralink RT288x/RT3xxx
 SUBTARGETS:=rt305x rt3883 mt7620a rt288x
-CFLAGS:=-Os -pipe -mno-branch-likely
 FEATURES:=squashfs gpio
 
 LINUX_VERSION:=3.10.12
index 4d4dd28ae982c729c19e0e104a217cac4c346145..3f4104d9824e2bad0ef61b0ebb7937f0c4062e73 100644 (file)
@@ -6,7 +6,8 @@ SUBTARGET:=mt7620a
 BOARDNAME:=MT7620a based boards
 ARCH_PACKAGES:=ramips_24kec
 FEATURES+=usb
-CFLAGS+= -march=24kec -mdsp
+CPU_TYPE:=24kec
+CPU_SUBTYPE:=dsp
 
 define Target/Description
        Build firmware images for Ralink MT7620a based boards.
index f826eab88e15d64fe7f91ab034ab0a8e790655b0..2b11e4843edb6e3204b4736cb0f097080626d556 100644 (file)
@@ -4,7 +4,7 @@
 
 SUBTARGET:=rt288x
 BOARDNAME:=RT288x based boards
-CFLAGS+= -mips32r2 -mtune=mips32r2
+CPU_TYPE:=mips32r2
 
 define Target/Description
        Build firmware images for Ralink RT288x based boards.
index 527b829cb956d93688901789fb695a7271e68069..a98f415452b628fe03a6832f169cc01f9fd349b6 100644 (file)
@@ -6,7 +6,8 @@ SUBTARGET:=rt305x
 BOARDNAME:=RT3x5x/RT5350 based boards
 ARCH_PACKAGES:=ramips_24kec
 FEATURES+=usb
-CFLAGS+= -march=24kec -mdsp
+CPU_TYPE:=24kec
+CPU_SUBTYPE:=dsp
 
 define Target/Description
        Build firmware images for Ralink RT3x5x/RT5350 based boards.
index 27c9020b525bb109303b55f204bc0ba31981d045..8ccd67e4c106f6cc68f7e5d4b6a3e0c9a9d37cc7 100644 (file)
@@ -6,7 +6,8 @@ SUBTARGET:=rt3883
 BOARDNAME:=RT3662/RT3883 based boards
 ARCH_PACKAGES:=ramips_24kec
 FEATURES+=usb pci
-CFLAGS+= -march=24kec -mdspr2
+CPU_TYPE:=24kec
+CPU_SUBTYPE:=dsp2
 
 define Target/Description
        Build firmware images for Ralink RT3662/RT3883 based boards.
index 440cff3b859e5df0866b46c809345d52bbb6b2c6..2370cac25dc1fc8f058ec287f1f4e54cc9c1a664 100644 (file)
@@ -10,7 +10,8 @@ ARCH:=mips
 BOARD:=sibyte
 BOARDNAME:=Broadcom/SiByte SB-1
 FEATURES:=fpu ramdisk broken
-CFLAGS:=-Os -pipe -march=sb1
+CPU_TYPE:=sb1
+CPU_CFLAGS_sb1:=-march=sb1
 MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
 
 LINUX_VERSION:=3.3.8