PPORT=n
CC := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc
LD := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ld
ifeq ($(PLATFORM), RALINK_2880)
EXTRA_CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -D__LINUX_ARM_ARCH__=5 -march=armv5te -msoft-float -Uarm -DMODULE -DMODVERSIONS -include $(LINUX_SRC)/include/config/modversions.h $(WFLAGS)
export EXTRA_CFLAGS
endif
注意,这里CC为交叉编译环境,LD为交叉编译的链接。默认EXTRA_CFLAGS为CFLAGS,这里需要修改为EXTRA_CFLAGS,否则编译时会提示如下错误:
scripts/Makefile.build:49: *** CFLAGS was changed in "/home/lqm/share/RT3070_Linux_STA/os/linux/Makefile". Fix it to use EXTRA_CFLAGS。 停止。
LINUX_ARM_ARCH一定要设置为5,-march一定要设置得和CPU匹配,由于这里为MX258,因此设置为armv5te,不可设置为armv5t或armv5,否则出现如下错误:
CC [M] /home/lqm/share/RT3070_Linux_STA/os/linux/../../os/linux/rt_main_dev.o
{standard input}: Assembler messages:
{standard input}:340: Error: selected processor does not support `pld [r5,#0]'
{standard input}:349: Error: selected processor does not support `pld [r5,#0]'
make[2]: *** [/home/lqm/share/RT3070_Linux_STA/os/linux/../../os/linux/rt_main_dev.o] 错误 1
make[1]: *** [_module_/home/lqm/share/RT3070_Linux_STA/os/linux] 错误 2
make[1]: Leaving directory `/home/lqm/share/G360/kernel_kfb'
make: *** [LINUX] 错误 2
[root@lqm RT3070_Linux_STA]#
|