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 | |
| 81 | ifeq (TRUE, $(IN_NAT_HELPER)) |
| 82 | MODULE_CFLAG += -DIN_NAT_HELPER |
| 83 | endif |
| 84 | |
| 85 | ifeq (TRUE, $(IN_INTERFACECONTROL)) |
| 86 | MODULE_CFLAG += -DIN_INTERFACECONTROL |
| 87 | endif |
| 88 | |
| 89 | ifeq (TRUE, $(IN_MACBLOCK)) |
| 90 | MODULE_CFLAG += -DIN_MACBLOCK |
| 91 | endif |
| 92 | |
| 93 | ifneq (TRUE, $(FAL)) |
| 94 | MODULE_CFLAG += -DHSL_STANDALONG |
| 95 | endif |
| 96 | |
| 97 | ifeq (TRUE, $(UK_IF)) |
| 98 | MODULE_CFLAG += -DUK_IF |
| 99 | endif |
| 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 | |
| 109 | ifeq (TRUE, $(API_LOCK)) |
| 110 | MODULE_CFLAG += -DAPI_LOCK |
| 111 | endif |
| 112 | |
| 113 | ifeq (TRUE, $(REG_ACCESS_SPEEDUP)) |
| 114 | MODULE_CFLAG += -DREG_ACCESS_SPEEDUP |
| 115 | endif |
| 116 | |
| 117 | ifeq (TRUE, $(DEBUG_ON)) |
| 118 | MODULE_CFLAG += -g |
| 119 | endif |
| 120 | |
| 121 | MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DCPU=\"$(CPU)\" -DOS=\"$(OS)\" |
| 122 | |
| 123 | MODULE_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 | |
| 136 | ifneq (,$(findstring ATHENA, $(SUPPORT_CHIP))) |
| 137 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/athena |
| 138 | MODULE_CFLAG += -DATHENA |
| 139 | endif |
| 140 | |
| 141 | ifneq (,$(findstring GARUDA, $(SUPPORT_CHIP))) |
| 142 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/garuda |
| 143 | MODULE_CFLAG += -DGARUDA |
| 144 | endif |
| 145 | |
| 146 | ifneq (,$(findstring SHIVA, $(SUPPORT_CHIP))) |
| 147 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/shiva |
| 148 | MODULE_CFLAG += -DSHIVA |
| 149 | endif |
| 150 | |
| 151 | ifneq (,$(findstring HORUS, $(SUPPORT_CHIP))) |
| 152 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/horus |
| 153 | MODULE_CFLAG += -DHORUS |
| 154 | endif |
| 155 | |
| 156 | ifneq (,$(findstring ISIS, $(SUPPORT_CHIP))) |
| 157 | ifneq (ISISC, $(SUPPORT_CHIP)) |
| 158 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/isis |
| 159 | MODULE_CFLAG += -DISIS |
| 160 | endif |
| 161 | endif |
| 162 | |
| 163 | ifneq (,$(findstring ISISC, $(SUPPORT_CHIP))) |
| 164 | MODULE_INC += -I$(PRJ_PATH)/include/hsl/isisc |
| 165 | MODULE_CFLAG += -DISISC |
| 166 | endif |
| 167 | |
| 168 | # check for GCC version |
| 169 | ifeq (4, $(GCC_VER)) |
| 170 | MODULE_CFLAG += -DGCCV4 |
| 171 | endif |
| 172 | |
| 173 | ifeq (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 | |
| 255 | endif |
| 256 | |
| 257 | ifeq (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 |
| 271 | endif |
| 272 | |
| 273 | ifneq (TRUE, $(KERNEL_MODE)) |
| 274 | ifneq (SHELL, $(MODULE_TYPE)) |
| 275 | MODULE_CFLAG += -DUSER_MODE |
| 276 | endif |
| 277 | endif |
| 278 | |
xiaofeis | 6ac6532 | 2015-10-18 19:47:33 +0800 | [diff] [blame^] | 279 | EXTRA_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) |