1#
2# Copyright 2005  Hon Hai Precision Ind. Co. Ltd.
3#  All Rights Reserved.
4# No portions of this material shall be reproduced in any form without the
5# written permission of Hon Hai Precision Ind. Co. Ltd.
6#
7# All information contained in this document is Hon Hai Precision Ind.
8# Co. Ltd. company private, proprietary, and trade secret property and
9# are protected by international intellectual property laws and treaties.
10#
11# $Id$
12#
13#
14# Creater : Jasmine
15# Date : 03/23/2006
16#
17
18CONFIG_UCLIBC=y
19#CONFIG_GLIBC=y
20
21#
22# Paths
23#
24
25# Source bases
26export PLATFORM LINUXDIR LIBDIR USRLIBDIR
27# export CURRENT := $(shell /bin/pwd)
28# export SRCBASE := $(CURRENT)/../../src
29# export Topdir := $(SRCBASE)/..
30
31# Build platform
32export BUILD := i386-pc-linux-gnu
33export HOSTCC := gcc
34
35#
36# Environment
37#
38PLATFORM=mipsel
39# /* Fxcn port-S Wins, 0707-09 */
40# LINUXDIR=$(SRCBASE)/linux/linux
41LINUXDIR=$(SRCBASE)/linux/linux-2.6
42# /* Fxcn port-E Wins, 0707-09 */
43LIBDIR=$(TOOLCHAIN)/lib
44USRLIBDIR=$(TOOLCHAIN)/usr/lib
45
46#
47# Cross-compile environment variables
48#
49
50# Build platform
51export BUILD := i386-pc-linux-gnu
52export HOSTCC := gcc
53
54# uClibc wrapper
55ifeq ($(CONFIG_UCLIBC),y)
56export PLATFORM := $(PLATFORM)-uclibc
57endif
58
59ifeq ($(PLATFORM),mipsel)
60export CROSS_COMPILE := mipsel-linux-
61export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
62export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/../mipsel-linux && pwd -P)
63endif
64
65ifeq ($(PLATFORM),mipsel-uclibc)
66export CROSS_COMPILE := mipsel-linux-uclibc-
67export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
68export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && pwd -P)
69endif
70
71CFLAGS += -Os
72
73ifeq ($(CONFIG_BCMWPA2),y)
74export CFLAGS += -DBCMWPA2
75endif
76
77export AS		= $(CROSS_COMPILE)as
78export LD		= $(CROSS_COMPILE)ld
79export CC		= $(CROSS_COMPILE)gcc
80export CPP		= $(CC) -E
81export AR		= $(CROSS_COMPILE)ar
82export NM		= $(CROSS_COMPILE)nm
83export STRIP		= $(CROSS_COMPILE)strip
84export OBJCOPY		= $(CROSS_COMPILE)objcopy
85export OBJDUMP		= $(CROSS_COMPILE)objdump
86#export MAKEFILES	= $(Topdir)/.config
87export GENKSYMS	= /sbin/genksyms
88export DEPMOD		= /sbin/depmod
89export MODFLAGS	= -DMODULE
90export PERL		= perl
91export RANLIB := $(CROSS_COMPILE)ranlib
92export SIZE := $(CROSS_COMPILE)size
93
94#
95# Install and target directories
96#
97
98export PLATFORMDIR := $(SRCBASE)/router/$(PLATFORM)
99export INSTALLDIR := $(PLATFORMDIR)/install
100export TARGETDIR := $(PLATFORMDIR)/target
101
102# /* Fxcn port-S Wins, 0707-09 */
103# export KERNELRELEASE=2.4.20
104# //----------
105export KERNELRELEASE=2.6.22
106# /* Fxcn port-E Wins, 0707-09 */
107export TOPDIR := $(SRCBASE)/linux/linux-2.6
108export KERNELPATH := $(SRCBASE)/linux/linux-2.6
109export MODPATH := ${TARGETDIR}/lib/modules/${KERNELRELEASE}/kernel
110MODLIB	:= $(TARGETDIR)/lib/modules/$(KERNELRELEASE)
111export MODLIB
112
113
114ROUTERDIR= $(SRCBASE)/router
115GPLTOPDIR= $(SRCBASE)/../ap/gpl
116export GPLTOPDIR
117export ROUTERDIR
118
119ifeq ($(LINUXDIR), $(SRCBASE)/linux/linux-2.6)
120export CFLAGS += -DLINUX26
121endif
122
123ifeq ($(PROFILE),WNR2000v2)
124export CFLAGS += -DU12H114
125endif
126
127# pling added start 05/04/2009, for usb spec 1.7
128ifeq ($(PROFILE),WNR3500L)
129CFLAGS += -DFTP_ACCESS_USB
130endif
131# pling added end 05/04/2009
132