luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 1 | ifeq (TRUE, $(IN_ACL)) |
| 2 | MODULE_CFLAG += -DIN_ACL |
| 3 | endif |
| 4 | |
| 5 | ifeq (TRUE, $(IN_FDB)) |
| 6 | MODULE_CFLAG += -DIN_FDB |
| 7 | endif |
| 8 | |
| 9 | ifeq (TRUE, $(IN_IGMP)) |
| 10 | MODULE_CFLAG += -DIN_IGMP |
| 11 | endif |
| 12 | |
| 13 | ifeq (TRUE, $(IN_LEAKY)) |
| 14 | MODULE_CFLAG += -DIN_LEAKY |
| 15 | endif |
| 16 | |
| 17 | ifeq (TRUE, $(IN_LED)) |
| 18 | MODULE_CFLAG += -DIN_LED |
| 19 | endif |
| 20 | |
| 21 | ifeq (TRUE, $(IN_MIB)) |
| 22 | MODULE_CFLAG += -DIN_MIB |
| 23 | endif |
| 24 | |
| 25 | ifeq (TRUE, $(IN_MIRROR)) |
| 26 | MODULE_CFLAG += -DIN_MIRROR |
| 27 | endif |
| 28 | |
| 29 | ifeq (TRUE, $(IN_MISC)) |
| 30 | MODULE_CFLAG += -DIN_MISC |
| 31 | endif |
| 32 | |
| 33 | ifeq (TRUE, $(IN_PORTCONTROL)) |
| 34 | MODULE_CFLAG += -DIN_PORTCONTROL |
| 35 | endif |
| 36 | |
| 37 | ifeq (TRUE, $(IN_PORTVLAN)) |
| 38 | MODULE_CFLAG += -DIN_PORTVLAN |
| 39 | endif |
| 40 | |
| 41 | ifeq (TRUE, $(IN_QOS)) |
| 42 | MODULE_CFLAG += -DIN_QOS |
| 43 | endif |
| 44 | |
| 45 | ifeq (TRUE, $(IN_RATE)) |
| 46 | MODULE_CFLAG += -DIN_RATE |
| 47 | endif |
| 48 | |
| 49 | ifeq (TRUE, $(IN_STP)) |
| 50 | MODULE_CFLAG += -DIN_STP |
| 51 | endif |
| 52 | |
| 53 | ifeq (TRUE, $(IN_VLAN)) |
| 54 | MODULE_CFLAG += -DIN_VLAN |
| 55 | endif |
| 56 | |
| 57 | ifeq (TRUE, $(IN_REDUCED_ACL)) |
| 58 | MODULE_CFLAG += -DIN_REDUCED_ACL |
| 59 | endif |
| 60 | |
| 61 | ifeq (TRUE, $(IN_COSMAP)) |
| 62 | MODULE_CFLAG += -DIN_COSMAP |
| 63 | endif |
| 64 | |
| 65 | ifeq (TRUE, $(IN_IP)) |
| 66 | MODULE_CFLAG += -DIN_IP |
| 67 | endif |
| 68 | |
| 69 | ifeq (TRUE, $(IN_NAT)) |
| 70 | MODULE_CFLAG += -DIN_NAT |
| 71 | endif |
| 72 | |
| 73 | ifeq (TRUE, $(IN_TRUNK)) |
| 74 | MODULE_CFLAG += -DIN_TRUNK |
| 75 | endif |
| 76 | |
| 77 | ifeq (TRUE, $(IN_SEC)) |
| 78 | MODULE_CFLAG += -DIN_SEC |
| 79 | endif |
| 80 | |
mingxinh | 640d946 | 2017-02-23 15:16:48 +0800 | [diff] [blame] | 81 | ifeq (TRUE, $(IN_QM)) |
| 82 | MODULE_CFLAG += -DIN_QM |
| 83 | endif |
| 84 | |
| 85 | ifeq (TRUE, $(IN_BM)) |
| 86 | MODULE_CFLAG += -DIN_BM |
| 87 | endif |
| 88 | |
| 89 | ifeq (TRUE, $(IN_FLOW)) |
| 90 | MODULE_CFLAG += -DIN_FLOW |
| 91 | endif |
| 92 | |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 93 | ifeq (TRUE, $(IN_NAT_HELPER)) |
| 94 | MODULE_CFLAG += -DIN_NAT_HELPER |
| 95 | endif |
| 96 | |
| 97 | ifeq (TRUE, $(IN_INTERFACECONTROL)) |
| 98 | MODULE_CFLAG += -DIN_INTERFACECONTROL |
| 99 | endif |
| 100 | |
mingxinh | 640d946 | 2017-02-23 15:16:48 +0800 | [diff] [blame] | 101 | ifeq (TRUE, $(IN_CTRLPKT)) |
| 102 | MODULE_CFLAG += -DIN_CTRLPKT |
| 103 | endif |
| 104 | |
| 105 | ifeq (TRUE, $(IN_SERVCODE)) |
| 106 | MODULE_CFLAG += -DIN_SERVCODE |
| 107 | endif |
| 108 | |
mingxinh | ad3000d | 2017-04-06 18:35:00 +0800 | [diff] [blame] | 109 | ifeq (TRUE, $(IN_RSS_HASH)) |
| 110 | MODULE_CFLAG += -DIN_RSS_HASH |
| 111 | endif |
| 112 | |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 113 | ifeq (TRUE, $(IN_MACBLOCK)) |
| 114 | MODULE_CFLAG += -DIN_MACBLOCK |
| 115 | endif |
| 116 | |
mingxinh | 640d946 | 2017-02-23 15:16:48 +0800 | [diff] [blame] | 117 | ifeq (TRUE, $(IN_VSI)) |
| 118 | MODULE_CFLAG += -DIN_VSI |
| 119 | endif |
| 120 | |
| 121 | ifeq (TRUE, $(IN_POLICER)) |
| 122 | MODULE_CFLAG += -DIN_POLICER |
| 123 | endif |
| 124 | |
| 125 | ifeq (TRUE, $(IN_SHAPER)) |
| 126 | MODULE_CFLAG += -DIN_SHAPER |
| 127 | endif |
| 128 | |
| 129 | ifeq (TRUE, $(IN_PPPOE)) |
| 130 | MODULE_CFLAG += -DIN_PPPOE |
| 131 | endif |
| 132 | |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 133 | ifneq (TRUE, $(FAL)) |
| 134 | MODULE_CFLAG += -DHSL_STANDALONG |
| 135 | endif |
| 136 | |
| 137 | ifeq (TRUE, $(UK_IF)) |
| 138 | MODULE_CFLAG += -DUK_IF |
| 139 | endif |
| 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 | |
| 149 | ifeq (TRUE, $(API_LOCK)) |
| 150 | MODULE_CFLAG += -DAPI_LOCK |
| 151 | endif |
| 152 | |
| 153 | ifeq (TRUE, $(REG_ACCESS_SPEEDUP)) |
| 154 | MODULE_CFLAG += -DREG_ACCESS_SPEEDUP |
| 155 | endif |
| 156 | |
| 157 | ifeq (TRUE, $(DEBUG_ON)) |
| 158 | MODULE_CFLAG += -g |
| 159 | endif |
| 160 | |
| 161 | MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DCPU=\"$(CPU)\" -DOS=\"$(OS)\" |
| 162 | |
| 163 | MODULE_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 | |
| 176 | ifneq (,$(findstring ATHENA, $(SUPPORT_CHIP))) |
| 177 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/athena |
| 178 | MODULE_CFLAG += -DATHENA |
| 179 | endif |
| 180 | |
| 181 | ifneq (,$(findstring GARUDA, $(SUPPORT_CHIP))) |
| 182 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/garuda |
| 183 | MODULE_CFLAG += -DGARUDA |
| 184 | endif |
| 185 | |
| 186 | ifneq (,$(findstring SHIVA, $(SUPPORT_CHIP))) |
| 187 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/shiva |
| 188 | MODULE_CFLAG += -DSHIVA |
| 189 | endif |
| 190 | |
| 191 | ifneq (,$(findstring HORUS, $(SUPPORT_CHIP))) |
| 192 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/horus |
| 193 | MODULE_CFLAG += -DHORUS |
| 194 | endif |
| 195 | |
| 196 | ifneq (,$(findstring ISIS, $(SUPPORT_CHIP))) |
| 197 | ifneq (ISISC, $(SUPPORT_CHIP)) |
| 198 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/isis |
| 199 | MODULE_CFLAG += -DISIS |
| 200 | endif |
| 201 | endif |
| 202 | |
| 203 | ifneq (,$(findstring ISISC, $(SUPPORT_CHIP))) |
| 204 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/isisc |
| 205 | MODULE_CFLAG += -DISISC |
| 206 | endif |
| 207 | |
| 208 | # check for GCC version |
| 209 | ifeq (4, $(GCC_VER)) |
| 210 | MODULE_CFLAG += -DGCCV4 |
| 211 | endif |
| 212 | |
| 213 | ifeq (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 | |
| 295 | endif |
| 296 | |
| 297 | ifeq (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 | |
mingxinh | 640d946 | 2017-02-23 15:16:48 +0800 | [diff] [blame] | 306 | ifneq (TRUE, $(KERNEL_MODE)) |
| 307 | MODULE_CFLAG += -DUSER_MODE |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 308 | endif |
mingxinh | 640d946 | 2017-02-23 15:16:48 +0800 | [diff] [blame] | 309 | |
| 310 | ifneq (arm64, $(ARCH)) |
| 311 | MODULE_CFLAG += -static |
| 312 | endif |
| 313 | |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 314 | endif |
| 315 | |
| 316 | ifneq (TRUE, $(KERNEL_MODE)) |
| 317 | ifneq (SHELL, $(MODULE_TYPE)) |
| 318 | MODULE_CFLAG += -DUSER_MODE |
| 319 | endif |
| 320 | endif |
| 321 | |
xiaofeis | 6ac6532 | 2015-10-18 19:47:33 +0800 | [diff] [blame] | 322 | EXTRA_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) |