Merge branch 'master' of git://git.denx.de/u-boot-ubi
[oweals/u-boot.git] / cpu / mips / config.mk
index 1664e14bc06bc80f8d4dade233d59573933b414b..a173c5480c0131e2c89808fee7f6398737061b52 100644 (file)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2)
+MIPSFLAGS:=$(shell \
+if [ "$v" -lt "14" ]; then \
+       echo "-mcpu=4kc"; \
+else \
+       echo "-march=4kc -mtune=4kc"; \
+fi)
 
-PLATFORM_CPPFLAGS += -mcpu=4kc -EB -mabicalls
+ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
+ENDIANNESS = -EL
+else
+ENDIANNESS = -EB
+endif
+
+MIPSFLAGS += $(ENDIANNESS)
+
+PLATFORM_CPPFLAGS += $(MIPSFLAGS)