forked from jarsy/bcm-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.linux-jag-2_6
151 lines (101 loc) · 4.64 KB
/
Makefile.linux-jag-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
# $Id: Makefile.linux-jag-2_6,v 1.20 Broadcom SDK $
# $Copyright: (c) 2016 Broadcom.
# Broadcom Proprietary and Confidential. All rights reserved.$
# User must select one platform from below.By default WR_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
#BUILD_PLATFORM=ELDK
BUILD_PLATFORM=WR_LINUX
endif
# Specify the KERNEL VERSION you want to use for building SDK.
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KERN_VER))
KERN_VER=2.6.21.7
endif
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
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (1.4,$(WRS_LINUX_VERSION))
KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm95836cpci_be/build/linux-2.6.14-small
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-
endif
export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin
override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
endif
ifeq (2.0,$(WRS_LINUX_VERSION))
#CROSS_COMPILE = mips-wrs-linux-gnu-
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mips_softfp-glibc_std-
endif
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/jag/glibc_std/build/linux-2.6.21-standard
endif
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
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)
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include
export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (2.6.21.7, $(KERN_VER))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips_4KC-
endif
override PATH := /tools/eldk/4.1/usr/bin:$(PATH)
KERNDIR ?= /projects/ntsw-tools/linux/eldk/jag-ntswics-eldk/linux-2.6.21.7
endif
endif
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)))")
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"JAG_BCM4704\"
ARCH = mips
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
ifeq (ELDK,$(BUILD_PLATFORM))
KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/mips-linux/4.0.0/include/
endif
ifeq (1.4,$(WRS_LINUX_VERSION))
# From linux/arch/mips/Makefile
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Wall -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -march=mips32 -Wa,-mips32 -Wa,--trap -funit-at-a-time -mlong-calls -Wundef -finline-limit=100000 -mabi=32
endif
#-Wdeclaration-after-statement -Wstrict-prototypes
else
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -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=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
endif
endif
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -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=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -Wdeclaration-after-statement -mlong-calls
endif
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif
ifneq (,$(findstring TCL,$(FEATURE_LIST)))
LINK_STATIC=0
export LINK_STATIC
endif