| 1 | # $FreeWRT$
|
|---|
| 2 | #-
|
|---|
| 3 | # This file is part of the FreeWRT project. FreeWRT is copyrighted
|
|---|
| 4 | # material, please see the LICENCE file in the top-level directory
|
|---|
| 5 | # or at http://www.freewrt.org/licence for details.
|
|---|
| 6 |
|
|---|
| 7 | include ${TOPDIR}/mk/targets.mk
|
|---|
| 8 |
|
|---|
| 9 | KERNEL_C_INCS:= 0
|
|---|
| 10 |
|
|---|
| 11 | ifeq (${CPU_ARCH},i386)
|
|---|
| 12 | KERNEL_C_INCS:= -I${LINUX_DIR}/include/asm-i386/mach-generic \
|
|---|
| 13 | -I${LINUX_DIR}/include/asm-i386/mach-default
|
|---|
| 14 | KERNEL_C_OPTS:= -Os -march=i486 -mpreferred-stack-boundary=2 \
|
|---|
| 15 | -fno-unit-at-a-time
|
|---|
| 16 | endif
|
|---|
| 17 |
|
|---|
| 18 | ifeq (${CPU_ARCH},mipsel)
|
|---|
| 19 | KERNEL_C_INCS:= -I${LINUX_DIR}/include/asm-mips/mach-generic
|
|---|
| 20 | KERNEL_C_OPTS:= -Os -G 0 -mno-abicalls -fno-pic -mabi=32 \
|
|---|
| 21 | -finline-limit=100000 -march=mips32 -Wa,-32 \
|
|---|
| 22 | -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap
|
|---|
| 23 | endif
|
|---|
| 24 |
|
|---|
| 25 | ifeq (${CPU_ARCH},armeb)
|
|---|
| 26 | KERNEL_C_INCS:= -I${LINUX_DIR}/include/asm-arm/mach-generic
|
|---|
| 27 | KERNEL_C_OPTS:= -Os -fno-pic -finline-limit=100000 -march=armv5te
|
|---|
| 28 | endif
|
|---|
| 29 |
|
|---|
| 30 | ifeq ($(strip ${KERNEL_C_INCS}),0)
|
|---|
| 31 | $(error kernel architecture invalid)
|
|---|
| 32 | endif
|
|---|
| 33 |
|
|---|
| 34 | KERNEL_M_OPTS:= -D__KERNEL__ -DMODULE -fno-strict-aliasing -fno-common \
|
|---|
| 35 | -fomit-frame-pointer -Wstrict-prototypes -Wno-trigraphs \
|
|---|
| 36 | -nostdinc -I. -iwithprefix include \
|
|---|
| 37 | -I${LINUX_DIR}/include -I${LINUX_DIR}/include/asm/gcc
|
|---|
| 38 | ifeq (${CPU_ARCH},mipsel)
|
|---|
| 39 | KERNEL_M_OPTS+= -mlong-calls
|
|---|
| 40 | endif
|
|---|
| 41 |
|
|---|
| 42 | TCPPFLAGS+= ${KERNEL_C_INCS}
|
|---|
| 43 | TCFLAGS+= ${KERNEL_C_OPTS}
|
|---|
| 44 | XAKE_FLAGS+= ARCH="${KERNEL_ARCH}" \
|
|---|
| 45 | CROSS_COMPILE="${TARGET_CROSS}" \
|
|---|
| 46 | c_opts="${KERNEL_C_OPTS}" \
|
|---|
| 47 | KERNELVERSION="${KERNEL}"
|
|---|