blob: f68fac9363ff83cf98e70d4a0f1fa3b8c6cc3b92 [file] [log] [blame]
luny479178a2014-06-18 12:33:29 +08001ifeq (TRUE, $(IN_ACL))
2 MODULE_CFLAG += -DIN_ACL
3endif
4
5ifeq (TRUE, $(IN_FDB))
6 MODULE_CFLAG += -DIN_FDB
7endif
8
9ifeq (TRUE, $(IN_IGMP))
10 MODULE_CFLAG += -DIN_IGMP
11endif
12
13ifeq (TRUE, $(IN_LEAKY))
14 MODULE_CFLAG += -DIN_LEAKY
15endif
16
17ifeq (TRUE, $(IN_LED))
18 MODULE_CFLAG += -DIN_LED
19endif
20
21ifeq (TRUE, $(IN_MIB))
22 MODULE_CFLAG += -DIN_MIB
23endif
24
25ifeq (TRUE, $(IN_MIRROR))
26 MODULE_CFLAG += -DIN_MIRROR
27endif
28
29ifeq (TRUE, $(IN_MISC))
30 MODULE_CFLAG += -DIN_MISC
31endif
32
33ifeq (TRUE, $(IN_PORTCONTROL))
34 MODULE_CFLAG += -DIN_PORTCONTROL
35endif
36
37ifeq (TRUE, $(IN_PORTVLAN))
38 MODULE_CFLAG += -DIN_PORTVLAN
39endif
40
41ifeq (TRUE, $(IN_QOS))
42 MODULE_CFLAG += -DIN_QOS
43endif
44
45ifeq (TRUE, $(IN_RATE))
46 MODULE_CFLAG += -DIN_RATE
47endif
48
49ifeq (TRUE, $(IN_STP))
50 MODULE_CFLAG += -DIN_STP
51endif
52
53ifeq (TRUE, $(IN_VLAN))
54 MODULE_CFLAG += -DIN_VLAN
55endif
56
57ifeq (TRUE, $(IN_REDUCED_ACL))
58 MODULE_CFLAG += -DIN_REDUCED_ACL
59endif
60
61ifeq (TRUE, $(IN_COSMAP))
62 MODULE_CFLAG += -DIN_COSMAP
63endif
64
65ifeq (TRUE, $(IN_IP))
66 MODULE_CFLAG += -DIN_IP
67endif
68
69ifeq (TRUE, $(IN_NAT))
70 MODULE_CFLAG += -DIN_NAT
71endif
72
73ifeq (TRUE, $(IN_TRUNK))
74 MODULE_CFLAG += -DIN_TRUNK
75endif
76
77ifeq (TRUE, $(IN_SEC))
78 MODULE_CFLAG += -DIN_SEC
79endif
80
81ifeq (TRUE, $(IN_NAT_HELPER))
82 MODULE_CFLAG += -DIN_NAT_HELPER
83endif
84
85ifeq (TRUE, $(IN_INTERFACECONTROL))
86 MODULE_CFLAG += -DIN_INTERFACECONTROL
87endif
88
89ifeq (TRUE, $(IN_MACBLOCK))
90 MODULE_CFLAG += -DIN_MACBLOCK
91endif
92
93ifneq (TRUE, $(FAL))
94 MODULE_CFLAG += -DHSL_STANDALONG
95endif
96
97ifeq (TRUE, $(UK_IF))
98 MODULE_CFLAG += -DUK_IF
99endif
100
101#ifdef UK_NL_PROT
102 MODULE_CFLAG += -DUK_NL_PROT=$(UK_NL_PROT)
103#endif
104
105#ifdef UK_MINOR_DEV
106 MODULE_CFLAG += -DUK_MINOR_DEV=$(UK_MINOR_DEV)
107#endif
108
109ifeq (TRUE, $(API_LOCK))
110 MODULE_CFLAG += -DAPI_LOCK
111endif
112
113ifeq (TRUE, $(REG_ACCESS_SPEEDUP))
114 MODULE_CFLAG += -DREG_ACCESS_SPEEDUP
115endif
116
117ifeq (TRUE, $(DEBUG_ON))
118 MODULE_CFLAG += -g
119endif
120
121MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DCPU=\"$(CPU)\" -DOS=\"$(OS)\"
122
123MODULE_INC += -I$(PRJ_PATH)/include \
124 -I$(PRJ_PATH)/include/common \
125 -I$(PRJ_PATH)/include/api \
126 -I$(PRJ_PATH)/include/fal \
127 -I$(PRJ_PATH)/include/ref \
128 -I$(PRJ_PATH)/include/hsl \
129 -I$(PRJ_PATH)/include/hsl/phy \
130 -I$(PRJ_PATH)/include/sal/os \
131 -I$(PRJ_PATH)/include/sal/sd \
132 -I$(PRJ_PATH)/include/sal/sd/linux/hydra_howl \
133 -I$(PRJ_PATH)/include/sal/sd/linux/uk_interface \
134 -I$(PRJ_PATH)/include/init
135
136ifneq (,$(findstring ATHENA, $(SUPPORT_CHIP)))
137 MODULE_INC += -I$(PRJ_PATH)/include/hsl/athena
138 MODULE_CFLAG += -DATHENA
139endif
140
141ifneq (,$(findstring GARUDA, $(SUPPORT_CHIP)))
142 MODULE_INC += -I$(PRJ_PATH)/include/hsl/garuda
143 MODULE_CFLAG += -DGARUDA
144endif
145
146ifneq (,$(findstring SHIVA, $(SUPPORT_CHIP)))
147 MODULE_INC += -I$(PRJ_PATH)/include/hsl/shiva
148 MODULE_CFLAG += -DSHIVA
149endif
150
151ifneq (,$(findstring HORUS, $(SUPPORT_CHIP)))
152 MODULE_INC += -I$(PRJ_PATH)/include/hsl/horus
153 MODULE_CFLAG += -DHORUS
154endif
155
156ifneq (,$(findstring ISIS, $(SUPPORT_CHIP)))
157 ifneq (ISISC, $(SUPPORT_CHIP))
158 MODULE_INC += -I$(PRJ_PATH)/include/hsl/isis
159 MODULE_CFLAG += -DISIS
160 endif
161endif
162
163ifneq (,$(findstring ISISC, $(SUPPORT_CHIP)))
164 MODULE_INC += -I$(PRJ_PATH)/include/hsl/isisc
165 MODULE_CFLAG += -DISISC
166endif
167
168# check for GCC version
169ifeq (4, $(GCC_VER))
170 MODULE_CFLAG += -DGCCV4
171endif
172
173ifeq (KSLIB, $(MODULE_TYPE))
174
175 ifeq (3_4, $(OS_VER))
176 MODULE_CFLAG += -DKVER34
177 MODULE_CFLAG += -DKVER32
178 MODULE_CFLAG += -DLNX26_22
179 MODULE_INC += -I$(SYS_PATH) \
180 -I$(SYS_PATH)/include \
181 -I$(SYS_PATH)/source/include \
182 -I$(SYS_PATH)/source/arch/arm/mach-msm/include \
183 -I$(SYS_PATH)/source/arch/arm/include \
184 -I$(SYS_PATH)/source/arch/arm/include/asm \
185 -I$(SYS_PATH)/arch/arm/include/generated \
186 -I$(SYS_PATH)/source/arch/arm/include/asm/mach \
187 -I$(SYS_PATH)/usr/include
188
189 endif
190
191 ifeq (3_2, $(OS_VER))
192 MODULE_CFLAG += -DKVER32
193 MODULE_CFLAG += -DLNX26_22
194 ifeq (mips, $(CPU))
195 MODULE_INC += -I$(SYS_PATH) \
196 -I$(SYS_PATH)/include \
197 -I$(SYS_PATH)/arch/mips/include \
198 -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \
199 -I$(SYS_PATH)/arch/mips/include/asm/mach-generic \
200 -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7 \
201 -I$(SYS_PATH)/usr/include
202
203 #CPU_CFLAG = -G 0 -mno-abicalls -fno-pic -pipe -mabi=32 -march=mips32r2
204 ifndef CPU_CFLAG
205 CPU_CFLAG = -Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing \
206 -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
207 endif
208 else
209 MODULE_INC += -I$(SYS_PATH) \
210 -I$(SYS_PATH)/include \
211 -I$(SYS_PATH)/arch/arm/include \
212 -I$(SYS_PATH)/arch/arm/include/asm \
213 -I$(SYS_PATH)/arch/arm/mach-fv16xx/include \
214 -I$(SYS_PATH)/arch/arm/include/generated \
215 -I$(SYS_PATH)/include/generated \
216 -I$(SYS_PATH)/usr/include
217 endif
218
219
220 endif
221
222 ifeq (2_6, $(OS_VER))
223 MODULE_CFLAG += -DKVER26
224 MODULE_CFLAG += -DLNX26_22
225 ifeq (mips, $(CPU))
226 MODULE_INC += -I$(SYS_PATH) \
227 -I$(SYS_PATH)/include \
228 -I$(SYS_PATH)/arch/mips/include \
229 -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \
230 -I$(SYS_PATH)/arch/mips/include/asm/mach-generic \
231 -I$(SYS_PATH)/usr/include
232
233 #CPU_CFLAG = -G 0 -mno-abicalls -fno-pic -pipe -mabi=32 -march=mips32r2
234 ifndef CPU_CFLAG
235 CPU_CFLAG = -Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing \
236 -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
237 endif
238 else
239 MODULE_INC += -I$(SYS_PATH) \
240 -I$(SYS_PATH)/include \
241 -I$(SYS_PATH)/arch/arm/include \
242 -I$(SYS_PATH)/arch/arm/include/asm \
243 -I$(SYS_PATH)/arch/arm/mach-fv16xx/include \
244 -I$(SYS_PATH)/arch/arm/include/generated \
245 -I$(SYS_PATH)/include/generated \
246 -I$(SYS_PATH)/usr/include
247 endif
248
249
250 endif
251
252 MODULE_CFLAG += -D__KERNEL__ -DKERNEL_MODULE $(CPU_CFLAG)
253
254
255endif
256
257ifeq (SHELL, $(MODULE_TYPE))
258 MODULE_INC += -I$(PRJ_PATH)/include/shell
259
260 ifeq (2_6, $(OS_VER))
261 MODULE_CFLAG += -DKVER26
262 else
263 MODULE_CFLAG += -DKVER24
264 endif
265
266 ifeq (TRUE, $(KERNEL_MODE))
267 MODULE_CFLAG += -static
268 else
269 MODULE_CFLAG += -static -DUSER_MODE
270 endif
271endif
272
273ifneq (TRUE, $(KERNEL_MODE))
274 ifneq (SHELL, $(MODULE_TYPE))
275 MODULE_CFLAG += -DUSER_MODE
276 endif
277endif
278
xiaofeis6ac65322015-10-18 19:47:33 +0800279EXTRA_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG)