-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile.linux-keystone_le-2_6
202 lines (162 loc) · 8.46 KB
/
Makefile.linux-keystone_le-2_6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# $Id: Makefile.linux-keystone_le-2_6 1.4.56.3 Broadcom SDK $
# $Copyright: Copyright 2011 Broadcom Corporation.
# This program is the proprietary software of Broadcom Corporation
# and/or its licensors, and may only be used, duplicated, modified
# or distributed pursuant to the terms and conditions of a separate,
# written license agreement executed between you and Broadcom
# (an "Authorized License"). Except as set forth in an Authorized
# License, Broadcom grants no license (express or implied), right
# to use, or waiver of any kind with respect to the Software, and
# Broadcom expressly reserves all rights in and to the Software
# and all intellectual property rights therein. IF YOU HAVE
# NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE
# IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
# ALL USE OF THE SOFTWARE.
#
# Except as expressly set forth in the Authorized License,
#
# 1. This program, including its structure, sequence and organization,
# constitutes the valuable trade secrets of Broadcom, and you shall use
# all reasonable efforts to protect the confidentiality thereof,
# and to use this information only in connection with your use of
# Broadcom integrated circuit products.
#
# 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS
# PROVIDED "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
# REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
# OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
# DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
# NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
# ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
# CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING
# OUT OF USE OR PERFORMANCE OF THE SOFTWARE.
#
# 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL
# BROADCOM OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL,
# INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER
# ARISING OUT OF OR IN ANY WAY RELATING TO YOUR USE OF OR INABILITY
# TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF
# THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR USD 1.00,
# WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING
# ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.$
# User must select one platform from below.By default WR_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
BUILD_PLATFORM=WR_LINUX
endif
# Specify the Windriver Linux version here.For example '2.0' as shown below.
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (,$(WRS_LINUX_VERSION))
WRS_LINUX_VERSION=2.0
endif
endif
#glibc_small and glibc_std have their own cross-compilation tools and and path for these tools are different as implemented below. To enable glibc_small build, line given below should be uncommented.
#To enable glibc_small uncomment the following line.
#WRL_GLIBC_SMALL=TRUE
# Default Linux Kernel directory
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq ($(WRL_GLIBC_SMALL),TRUE)
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_small-
endif
ifeq (,$(KS_HIGHMEM))
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/soc/systems/linux/keystone/glibc_small_le/build/linux-2.6.21-standard
else
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/key_highmem/glibc_small_le/build/linux-2.6.21-standard
endif
else
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_std-
endif
ifeq (,$(KS_HIGHMEM))
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/soc/systems/linux/keystone/glibc_std_debug_le/build/linux-2.6.21-standard
else
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/key_highmem/glibc_std_debug_le/build/linux-2.6.21-standard
endif
endif
# After this point glibc_std and glibc_small share these flags
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2
TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
endif
ifeq (3.0,$(WRS_LINUX_VERSION))
ifeq ($(WRL_GLIBC_SMALL),TRUE)
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_small-
endif
ifeq (,$(KS_HIGHMEM))
KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_small_le/build/linux-broadcom_bcm_530001_3_be-standard-build
KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30_glibc_small_le/build/linux
else
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_small_le/build/linux-broadcom_bcm_530001_3_be-standard-build
KERNDIR_STD ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30_glibc_small_le/build/linux
endif
else
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_std-
endif
ifeq (,$(KS_HIGHMEM))
KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_std_le/build/linux-broadcom_bcm_530001_3_be-standard-build
KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30_glibc_std_debug_le/build/linux
else
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_std_le/build/linux-broadcom_bcm_530001_3_be-standard-build
KERNDIR_STD ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30_glibc_std_debug_le/build/linux
endif
endif
export WRL_GLIBC_SMALL
# After this point glibc_std and glibc_small share these flags
WRLINUX_BASE ?=/tools/windriver/linux_ed/3.0.3/Linux
TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3a-291/mips/toolchain/x86-linux2/
TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX)
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
WRLINUX_GNU_PATH = $(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3a-291/mips/toolchain/x86-linux2/bin
override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR_STD)/../../host-cross/bin:$(KERNDIR_STD)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
LINUX_INCLUDE_STD := $(KERNDIR_STD)/include
endif
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
ENDIAN = LE_HOST=1
CFGFLAGS += -D$(ENDIAN) -DKEYSTONE
CFGFLAGS += -DBCM_PLATFORM_STRING=\"KEYSTONE\"
ARCH = mips
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
ifeq (2.0,$(WRS_LINUX_VERSION))
KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include
endif
ifeq (3.0,$(WRS_LINUX_VERSION))
KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.3.2/include
endif
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Wp, -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/version.h -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
endif
ifeq (ELDK,$(BUILD_PLATFORM))
KFLAGS += -I$(LINUX_INCLUDE)/asm-mips/mach-bcm5300x
endif
ifeq (2.0,$(WRS_LINUX_VERSION))
KFLAGS += -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic
endif
#Wind river Linux 3.0 needs addtional flags
ifeq (3.0,$(WRS_LINUX_VERSION))
KFLAGS += -I$(LINUX_INCLUDE_STD) -I$(KERNDIR_STD)/arch/mips -I$(KERNDIR_STD)/arch/mips/include -I$(LINUX_INCLUDE_STD)/asm-mips/mach-generic -I$(KERNDIR_STD)/include/asm-mips/mach-bcm5300x -I$(KERNDIR_STD)/include/asm-mips -I$(KERNDIR)/include2
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif