blob: 9854ce1517f31a9fcabdb153f39289ff87f417a2 [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
mingxinh640d9462017-02-23 15:16:48 +080081ifeq (TRUE, $(IN_QM))
82 MODULE_CFLAG += -DIN_QM
83endif
84
85ifeq (TRUE, $(IN_BM))
86 MODULE_CFLAG += -DIN_BM
87endif
88
89ifeq (TRUE, $(IN_FLOW))
90 MODULE_CFLAG += -DIN_FLOW
91endif
92
luny479178a2014-06-18 12:33:29 +080093ifeq (TRUE, $(IN_NAT_HELPER))
94 MODULE_CFLAG += -DIN_NAT_HELPER
95endif
96
97ifeq (TRUE, $(IN_INTERFACECONTROL))
98 MODULE_CFLAG += -DIN_INTERFACECONTROL
99endif
100
mingxinh640d9462017-02-23 15:16:48 +0800101ifeq (TRUE, $(IN_CTRLPKT))
102 MODULE_CFLAG += -DIN_CTRLPKT
103endif
104
105ifeq (TRUE, $(IN_SERVCODE))
106 MODULE_CFLAG += -DIN_SERVCODE
107endif
108
mingxinhad3000d2017-04-06 18:35:00 +0800109ifeq (TRUE, $(IN_RSS_HASH))
110 MODULE_CFLAG += -DIN_RSS_HASH
111endif
112
luny479178a2014-06-18 12:33:29 +0800113ifeq (TRUE, $(IN_MACBLOCK))
114 MODULE_CFLAG += -DIN_MACBLOCK
115endif
116
mingxinh640d9462017-02-23 15:16:48 +0800117ifeq (TRUE, $(IN_VSI))
118 MODULE_CFLAG += -DIN_VSI
119endif
120
121ifeq (TRUE, $(IN_POLICER))
122 MODULE_CFLAG += -DIN_POLICER
123endif
124
125ifeq (TRUE, $(IN_SHAPER))
126 MODULE_CFLAG += -DIN_SHAPER
127endif
128
129ifeq (TRUE, $(IN_PPPOE))
130 MODULE_CFLAG += -DIN_PPPOE
131endif
132
luny479178a2014-06-18 12:33:29 +0800133ifneq (TRUE, $(FAL))
134 MODULE_CFLAG += -DHSL_STANDALONG
135endif
136
137ifeq (TRUE, $(UK_IF))
138 MODULE_CFLAG += -DUK_IF
139endif
140
141#ifdef UK_NL_PROT
142 MODULE_CFLAG += -DUK_NL_PROT=$(UK_NL_PROT)
143#endif
144
145#ifdef UK_MINOR_DEV
146 MODULE_CFLAG += -DUK_MINOR_DEV=$(UK_MINOR_DEV)
147#endif
148
149ifeq (TRUE, $(API_LOCK))
150 MODULE_CFLAG += -DAPI_LOCK
151endif
152
153ifeq (TRUE, $(REG_ACCESS_SPEEDUP))
154 MODULE_CFLAG += -DREG_ACCESS_SPEEDUP
155endif
156
157ifeq (TRUE, $(DEBUG_ON))
158 MODULE_CFLAG += -g
159endif
160
161MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DCPU=\"$(CPU)\" -DOS=\"$(OS)\"
162
163MODULE_INC += -I$(PRJ_PATH)/include \
164 -I$(PRJ_PATH)/include/common \
165 -I$(PRJ_PATH)/include/api \
166 -I$(PRJ_PATH)/include/fal \
167 -I$(PRJ_PATH)/include/ref \
168 -I$(PRJ_PATH)/include/hsl \
169 -I$(PRJ_PATH)/include/hsl/phy \
170 -I$(PRJ_PATH)/include/sal/os \
171 -I$(PRJ_PATH)/include/sal/sd \
172 -I$(PRJ_PATH)/include/sal/sd/linux/hydra_howl \
173 -I$(PRJ_PATH)/include/sal/sd/linux/uk_interface \
174 -I$(PRJ_PATH)/include/init
175
176ifneq (,$(findstring ATHENA, $(SUPPORT_CHIP)))
177 MODULE_INC += -I$(PRJ_PATH)/include/hsl/athena
178 MODULE_CFLAG += -DATHENA
179endif
180
181ifneq (,$(findstring GARUDA, $(SUPPORT_CHIP)))
182 MODULE_INC += -I$(PRJ_PATH)/include/hsl/garuda
183 MODULE_CFLAG += -DGARUDA
184endif
185
186ifneq (,$(findstring SHIVA, $(SUPPORT_CHIP)))
187 MODULE_INC += -I$(PRJ_PATH)/include/hsl/shiva
188 MODULE_CFLAG += -DSHIVA
189endif
190
191ifneq (,$(findstring HORUS, $(SUPPORT_CHIP)))
192 MODULE_INC += -I$(PRJ_PATH)/include/hsl/horus
193 MODULE_CFLAG += -DHORUS
194endif
195
196ifneq (,$(findstring ISIS, $(SUPPORT_CHIP)))
197 ifneq (ISISC, $(SUPPORT_CHIP))
198 MODULE_INC += -I$(PRJ_PATH)/include/hsl/isis
199 MODULE_CFLAG += -DISIS
200 endif
201endif
202
203ifneq (,$(findstring ISISC, $(SUPPORT_CHIP)))
204 MODULE_INC += -I$(PRJ_PATH)/include/hsl/isisc
205 MODULE_CFLAG += -DISISC
206endif
207
208# check for GCC version
209ifeq (4, $(GCC_VER))
210 MODULE_CFLAG += -DGCCV4
211endif
212
213ifeq (KSLIB, $(MODULE_TYPE))
214
215 ifeq (3_4, $(OS_VER))
216 MODULE_CFLAG += -DKVER34
217 MODULE_CFLAG += -DKVER32
218 MODULE_CFLAG += -DLNX26_22
219 MODULE_INC += -I$(SYS_PATH) \
220 -I$(SYS_PATH)/include \
221 -I$(SYS_PATH)/source/include \
222 -I$(SYS_PATH)/source/arch/arm/mach-msm/include \
223 -I$(SYS_PATH)/source/arch/arm/include \
224 -I$(SYS_PATH)/source/arch/arm/include/asm \
225 -I$(SYS_PATH)/arch/arm/include/generated \
226 -I$(SYS_PATH)/source/arch/arm/include/asm/mach \
227 -I$(SYS_PATH)/usr/include
228
229 endif
230
231 ifeq (3_2, $(OS_VER))
232 MODULE_CFLAG += -DKVER32
233 MODULE_CFLAG += -DLNX26_22
234 ifeq (mips, $(CPU))
235 MODULE_INC += -I$(SYS_PATH) \
236 -I$(SYS_PATH)/include \
237 -I$(SYS_PATH)/arch/mips/include \
238 -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \
239 -I$(SYS_PATH)/arch/mips/include/asm/mach-generic \
240 -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7 \
241 -I$(SYS_PATH)/usr/include
242
243 #CPU_CFLAG = -G 0 -mno-abicalls -fno-pic -pipe -mabi=32 -march=mips32r2
244 ifndef CPU_CFLAG
245 CPU_CFLAG = -Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing \
246 -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
247 endif
248 else
249 MODULE_INC += -I$(SYS_PATH) \
250 -I$(SYS_PATH)/include \
251 -I$(SYS_PATH)/arch/arm/include \
252 -I$(SYS_PATH)/arch/arm/include/asm \
253 -I$(SYS_PATH)/arch/arm/mach-fv16xx/include \
254 -I$(SYS_PATH)/arch/arm/include/generated \
255 -I$(SYS_PATH)/include/generated \
256 -I$(SYS_PATH)/usr/include
257 endif
258
259
260 endif
261
262 ifeq (2_6, $(OS_VER))
263 MODULE_CFLAG += -DKVER26
264 MODULE_CFLAG += -DLNX26_22
265 ifeq (mips, $(CPU))
266 MODULE_INC += -I$(SYS_PATH) \
267 -I$(SYS_PATH)/include \
268 -I$(SYS_PATH)/arch/mips/include \
269 -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \
270 -I$(SYS_PATH)/arch/mips/include/asm/mach-generic \
271 -I$(SYS_PATH)/usr/include
272
273 #CPU_CFLAG = -G 0 -mno-abicalls -fno-pic -pipe -mabi=32 -march=mips32r2
274 ifndef CPU_CFLAG
275 CPU_CFLAG = -Wstrict-prototypes -fomit-frame-pointer -G 0 -mno-abicalls -fno-strict-aliasing \
276 -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
277 endif
278 else
279 MODULE_INC += -I$(SYS_PATH) \
280 -I$(SYS_PATH)/include \
281 -I$(SYS_PATH)/arch/arm/include \
282 -I$(SYS_PATH)/arch/arm/include/asm \
283 -I$(SYS_PATH)/arch/arm/mach-fv16xx/include \
284 -I$(SYS_PATH)/arch/arm/include/generated \
285 -I$(SYS_PATH)/include/generated \
286 -I$(SYS_PATH)/usr/include
287 endif
288
289
290 endif
291
292 MODULE_CFLAG += -D__KERNEL__ -DKERNEL_MODULE $(CPU_CFLAG)
293
294
295endif
296
297ifeq (SHELL, $(MODULE_TYPE))
298 MODULE_INC += -I$(PRJ_PATH)/include/shell
299
300 ifeq (2_6, $(OS_VER))
301 MODULE_CFLAG += -DKVER26
302 else
303 MODULE_CFLAG += -DKVER24
304 endif
305
mingxinh640d9462017-02-23 15:16:48 +0800306 ifneq (TRUE, $(KERNEL_MODE))
307 MODULE_CFLAG += -DUSER_MODE
luny479178a2014-06-18 12:33:29 +0800308 endif
mingxinh640d9462017-02-23 15:16:48 +0800309
310 ifneq (arm64, $(ARCH))
311 MODULE_CFLAG += -static
312 endif
313
luny479178a2014-06-18 12:33:29 +0800314endif
315
316ifneq (TRUE, $(KERNEL_MODE))
317 ifneq (SHELL, $(MODULE_TYPE))
318 MODULE_CFLAG += -DUSER_MODE
319 endif
320endif
321
xiaofeis6ac65322015-10-18 19:47:33 +0800322EXTRA_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG)