openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

Make.config (41909B)


      1 # 
      2 # $Copyright: (c) 2005 Broadcom Corp.
      3 # All Rights Reserved.$
      4 #
      5 # Make command configuration for SOC driver and diags.
      6 
      7 ALLOWED_MAKE_VERSIONS :=3.81 3.82 4.0 4.1
      8 
      9 MAKE_VERSION_IS_SUPPORTED := $(strip $(foreach v,$(ALLOWED_MAKE_VERSIONS), $(findstring $v,$(MAKE_VERSION))))
     10 ifeq ($(MAKE_VERSION_IS_SUPPORTED),)
     11 # {
     12 $(error Make $(MAKE_VERSION) not supported, use one of $(ALLOWED_MAKE_VERSIONS))
     13 # }
     14 endif
     15 
     16 
     17 ifeq (${BCM_HIDE_DISPATCHABLE},1)
     18 # {
     19 CFGFLAGS += -DBCM_HIDE_DISPATCHABLE
     20 # }
     21 endif
     22 
     23 ifeq (${WAN_PORT_SUPPORT},1)
     24 # {
     25 CFGFLAGS += -DWAN_PORT_SUPPORT
     26 # }
     27 endif
     28 
     29 ifeq (${IPROC_NO_ATL},1)
     30 # {
     31 CFGFLAGS += -DIPROC_NO_ATL
     32 # }
     33 endif
     34 
     35 #
     36 # Set a default target if one is not set. If override-target is set,
     37 # then the target will become override-target and a warning is printed
     38 # if the assigned TARGET was different.
     39 #
     40 ifneq ($(strip $(override-target)),)
     41 # {
     42 override TARGET=$(override-target)
     43 # }
     44 endif
     45 
     46 #
     47 # If TARGET is not set, default to a Unix target based on host type
     48 #
     49 ifndef TARGET
     50 # {
     51  uname := $(shell uname -s)
     52  ifeq ($(filter-out Linux Darwin,$(uname)),)
     53   ifeq ($(shell uname -m),x86_64)
     54    TARGET=unix-linux-64
     55   else
     56    TARGET=unix-linux
     57   endif
     58  endif
     59  ifeq ($(uname),SunOS)
     60   TARGET=unix-solaris
     61  endif
     62  ifeq ($(uname),NetBSD)
     63   TARGET=unix-netbsd
     64  endif
     65  ifndef	TARGET
     66   $(error Cannot determine TARGET in Make.config, uname = $(uname))
     67  endif
     68 # }
     69 endif
     70 
     71 export TARGET
     72 
     73 
     74 #
     75 # Set up the target name, and the target base variables.
     76 #
     77 # target = The full name of the target such as vxworks-bmw
     78 # targetbase = 1st part of target (e.g. vxworks)
     79 # targetplat = 2nd part of target (e.g. x86) if any; otherwise same as 1st
     80 #
     81 target     = ${TARGET}
     82 targetsplt = $(subst -, , ${target})	# change hyphens to spaces
     83 targetbase = $(word 1,${targetsplt})
     84 targetplat = $(subst ${targetbase}-,,${TARGET})
     85 #targetplat = $(lastword ,${targetsplt})
     86 
     87 #
     88 # Common configuration for all platforms
     89 # (Additional platform-dependent configurations are in Makefile.xxx)
     90 #
     91 
     92 #
     93 # THIS FILE SHOULD NOT BE MODIFIED LOCALLY, to override, add a file
     94 # $SDK/make/Make.local that sets your local settings, and/or provide
     95 # a path to your settings using the MAKE_LOCAL variable.  If 
     96 # either of these files exists, their values will override those in this makefile.
     97 #
     98 ifdef MAKE_LOCAL
     99 # {
    100 include        ${MAKE_LOCAL}
    101 # }
    102 else
    103 # {
    104 -include	${SDK}/make/Make.local
    105 # }
    106 endif
    107 
    108 ifndef	VENDOR_LIST
    109 # {
    110 VENDOR_LIST =	CALHOUN GAMMA BROADCOM
    111 # }
    112 endif
    113 CFGFLAGS += $(foreach vendor,$(VENDOR_LIST), -DVENDOR_$(vendor))
    114 ifeq (BROADCOM,$(findstring BROADCOM,$(VENDOR_LIST)))
    115     VENDOR_BROADCOM = 1
    116 endif
    117 
    118 # Make sure some chip is supported
    119 
    120 # Here list EA chipsets
    121 TOMAHAWK3_CHIP_NAMES = BCM_56980_A0 BCM_56980_B0
    122 
    123 ESW_CHIP_NAMES = BCM_5675_A0 BCM_56504_A0 BCM_56504_B0 BCM_56314_A0 BCM_56112_A0 \
    124   BCM_56304_B0 BCM_56102_A0 BCM_56580_A0 BCM_56700_A0 BCM_56800_A0 BCM_56218_A0 \
    125   BCM_56514_A0 BCM_56624_A0 BCM_56680_A0 BCM_56680_B0 BCM_56224_A0 BCM_56224_B0 BCM_56820_A0 \
    126   BCM_53314_A0 BCM_56725_A0 BCM_56624_B0 BCM_56634_A0 BCM_56634_B0 \
    127   BCM_56524_A0 BCM_56524_B0 BCM_56685_A0 BCM_56685_B0 BCM_56334_A0 BCM_56334_B0 \
    128   BCM_56840_A0 BCM_56840_B0 BCM_56142_A0 BCM_53324_A0 BCM_88732_A0 BCM_56440_A0 \
    129   BCM_56440_B0 BCM_56640_A0 BCM_56850_A0 BCM_56450_A0 BCM_56450_B0 BCM_56450_B1 BCM_56340_A0 \
    130   BCM_56150_A0 BCM_53400_A0 BCM_56960_A0 BCM_56860_A0 BCM_56560_A0 BCM_56260_A0 BCM_56260_B0 \
    131   BCM_56160_A0 BCM_56560_B0 BCM_56270_A0 BCM_56965_A0 BCM_56970_A0 BCM_56980_A0 BCM_56980_B0 \
    132   BCM_53570_A0 BCM_56870_A0 BCM_53570_B0 BCM_53540_A0 BCM_56670_A0 BCM_56370_A0 BCM_56770_A0 BCM_56670_B0
    133 
    134 
    135 DPP_CHIP_NAMES = BCM_88650_A0 BCM_88650_B0 BCM_88660_A0 BCM_88675_A0 BCM_88675_B0 BCM_88375_A0 BCM_88375_B0 BCM_88680_A0 BCM_88470_A0 BCM_88470_B0 BCM_88270_A0 BCM_8206_A0 BCM_88202_A0
    136 DFE_CHIP_NAMES = BCM_88750_A0 BCM_88750_B0 BCM_88754_A0 BCM_88950_A0 BCM_88950_A1 BCM_88770_A1
    137 DNX_CHIP_NAMES = BCM_88690_A0 BCM_88690_B0 BCM_88800_A0
    138 DNXF_CHIP_NAMES = BCM_88790_A0 BCM_88790_B0
    139 
    140 whereischip = $(origin $(chipname))
    141 seekesw = $(foreach chipname,$(ESW_CHIP_NAMES),$(whereischip))
    142 seekdpp = $(foreach chipname,$(DPP_CHIP_NAMES),$(whereischip))
    143 seekdfe = $(foreach chipname,$(DFE_CHIP_NAMES),$(whereischip))
    144 seekdnx = $(foreach chipname,$(DNX_CHIP_NAMES),$(whereischip))
    145 seekdnxf = $(foreach chipname,$(DNXF_CHIP_NAMES),$(whereischip))
    146  
    147 seekth3 = $(foreach chipname,$(TOMAHAWK3_CHIP_NAMES),$(whereischip))
    148 
    149 setallesw = $(foreach chipname,$(ESW_CHIP_NAMES),$(eval export $(chipname) = 1))
    150 setalldpp = $(foreach chipname,$(DPP_CHIP_NAMES),$(eval export $(chipname) = 1))
    151 setalldfe = $(foreach chipname,$(DFE_CHIP_NAMES),$(eval export $(chipname) = 1))
    152 setalldnx = $(foreach chipname,$(DNX_CHIP_NAMES),$(eval export $(chipname) = 1))
    153 setalldnxf = $(foreach chipname,$(DNXF_CHIP_NAMES),$(eval export $(chipname) = 1))
    154 setallth3 = $(foreach chipname,$(TOMAHAWK3_CHIP_NAMES),$(eval export $(chipname) = 1))
    155 
    156 ifeq (1,$(PORTMOD_STAND_ALONE))
    157 # {
    158 export PORTMOD_STAND_ALONE
    159 BCM_PTL_SPT=1
    160 PHYMOD_SUPPORT=1
    161 PORTMOD_SUPPORT=1
    162 CFLAGS += -DPORTMOD_STAND_ALONE
    163 # }
    164 endif
    165 
    166 ifdef BCM_PTL_SPT
    167 # {
    168   ifdef ALL_TOMAHAWK3_CHIPS
    169     $(setallth3)
    170     export BCM_ESW_SUPPORT = 1
    171     export BCM_TOMAHAWK3_SUPPORT = 1
    172     export BCM_ALL_CHIPS = 1
    173     CFGFLAGS+=-DBCM_ALL_CHIPS
    174   endif
    175 
    176   ifdef ALL_ESW_CHIPS
    177     $(setallesw)
    178     export BCM_ESW_SUPPORT = 1
    179     export BCM_ALL_CHIPS = 1
    180     CFGFLAGS+=-DBCM_ALL_CHIPS
    181   endif
    182 
    183   ifdef ALL_DPP_CHIPS
    184     $(setalldpp)
    185   endif
    186 
    187   ifdef ALL_DFE_CHIPS
    188     $(setalldfe)
    189   endif
    190 
    191   ifdef ALL_DNX_CHIPS
    192     $(setalldnx)
    193   endif
    194 
    195   ifdef ALL_DNXF_CHIPS
    196     $(setalldnxf)
    197   endif
    198 
    199   ifneq "$(findstring file,$(seekesw))" ""
    200     ESW_CHIPS = 1
    201   endif
    202 
    203   ifneq "$(findstring file,$(seekdpp))" ""
    204     DPP_CHIPS = 1
    205     export DPP_CHIPS
    206   endif
    207   
    208   ifneq "$(findstring file,$(seekdfe))" ""
    209     DFE_CHIPS = 1
    210     export DFE_CHIPS
    211   endif
    212 
    213   ifneq "$(findstring file,$(seekdnx))" ""
    214     DNX_CHIPS = 1
    215     export DNX_CHIPS
    216   endif
    217 
    218   ifneq "$(findstring file,$(seekdnxf))" ""
    219     DNXF_CHIPS = 1
    220     export DNXF_CHIPS
    221   endif
    222 
    223   ifneq "$(findstring file,$(seekth3))" ""
    224     TOMAHAWK3_CHIPS = 1
    225   endif
    226 
    227 ifndef ESW_CHIPS
    228 # {
    229 ifndef DPP_CHIPS
    230 # {
    231 ifndef DFE_CHIPS
    232 # {
    233 ifndef DNX_CHIPS
    234 # {
    235 ifndef DNXF_CHIPS
    236 # {
    237 ifndef TOMAHAWK3_CHIPS
    238 ifndef PORTMOD_STAND_ALONE #Compile without chips is allowed in case of portmod stand alone
    239 # {
    240 ifneq (C_COMPILER,$(MAKECMDGOALS))
    241 # {
    242   $(error "BCM_PTL_SPT defined, and no valid chip names were defined")
    243 # }
    244 endif
    245 # }
    246 endif
    247 # }
    248 endif
    249 # }
    250 endif
    251 # }
    252 endif
    253 # }
    254 endif
    255 # }
    256 endif
    257 endif
    258 
    259 # }
    260 else # BCM_PTL_SPT
    261 # {
    262 
    263 ifdef ALL_CHIPS
    264 # {
    265   ESW_CHIPS = 1
    266   DPP_CHIPS = 1
    267   DFE_CHIPS = 1
    268   DNX_CHIPS = 1
    269   DNXF_CHIPS = 1
    270   TOMAHAWK3_CHIPS = 1
    271 # }
    272 else
    273 # {
    274   ifndef ESW_CHIPS
    275 	# Check if ESW support exist
    276 	ifeq ($(shell test -d $(SDK)/src/bcm/esw; echo $$?),0)
    277             ESW_CHIPS = 1
    278             export ESW_CHIPS
    279       	endif
    280   endif
    281   ifndef TOMAHAWK3_CHIPS
    282 	# Check if Tomahawk3 support exist
    283         ifeq ($(shell test -d $(SDK)/src/bcm/tomahawk3; echo $$?),0)
    284             TOMAHAWK3_CHIPS = 1
    285             export TOMAHAWK3_CHIPS
    286         endif
    287   endif
    288 
    289   ifdef ALL_DPP_CHIPS
    290     DPP_CHIPS=1
    291     export DPP_CHIPS
    292   endif
    293 
    294   ifdef ALL_DFE_CHIPS
    295     DFE_CHIPS=1
    296     export DFE_CHIPS
    297   endif
    298 
    299   ifdef ALL_DNX_CHIPS
    300     DNX_CHIPS=1
    301     export DNX_CHIPS
    302   endif
    303 
    304   ifdef ALL_DNXF_CHIPS
    305     DNXF_CHIPS=1
    306     export DNXF_CHIPS
    307   endif
    308 
    309 # }
    310 endif # ALL_CHIPS
    311 
    312 # }
    313 endif # BCM_PTL_SPT
    314 
    315 #
    316 # Check for incompatible reload options
    317 #
    318 
    319 ifneq (,$(findstring -DBCM_WARM_BOOT_SUPPORT,$(CFGFLAGS)))
    320 # {
    321 ifneq (,$(findstring -DBCM_EASY_RELOAD_SUPPORT,$(CFGFLAGS)))
    322 # {
    323  $(error "BCM_WARM_BOOT_SUPPORT and BCM_EASY_RELOAD_SUPPORT should not be enabled at the same time")
    324 # }
    325 endif
    326 # }
    327 endif
    328 
    329 #
    330 # By default, turn off the "changing directory" message.
    331 #
    332 
    333 MAKEFLAGS += --no-print-directory
    334 
    335 #
    336 # Use gmake by default
    337 #
    338 
    339 include ${SDK}/make/Make.tools
    340 include	${SDK}/make/Makefile.${target}
    341 
    342 # For make v3.80, eval function cannot be placed inside any ifxxx-endif section
    343 # The bug is fixed in v3.81
    344 eval_fixed_ver := 3.81
    345 eval_fixed := $(filter $(eval_fixed_ver),$(firstword $(sort $(MAKE_VERSION) $(eval_fixed_ver))))
    346 
    347 # See Make.local (Make.local.template) to configure chip support
    348 
    349 ifndef BCM_PTL_SPT
    350 # {
    351 
    352 # Support all chips by default
    353 CFGFLAGS += -DBCM_ALL_CHIPS
    354 
    355 ifdef ESW_CHIPS
    356 # {
    357 ifeq ($(eval_fixed),$(eval_fixed_ver))
    358 # {
    359 $(setallesw)
    360 # }
    361 else
    362 # {
    363 BCM_5675_A0 = 1
    364 BCM_56504_A0 = 1
    365 BCM_56504_B0 = 1
    366 BCM_56314_A0 = 1
    367 BCM_56112_A0 = 1
    368 BCM_56304_B0 = 1
    369 BCM_56102_A0 = 1
    370 BCM_56580_A0 = 1
    371 BCM_56700_A0 = 1
    372 BCM_56800_A0 = 1
    373 BCM_56218_A0 = 1
    374 BCM_56514_A0 = 1
    375 BCM_56624_A0 = 1
    376 BCM_56224_A0 = 1
    377 BCM_56224_B0 = 1
    378 BCM_56820_A0 = 1
    379 BCM_53314_A0 = 1
    380 BCM_56725_A0 = 1
    381 BCM_56624_B0 = 1
    382 BCM_56634_A0 = 1
    383 BCM_56634_B0 = 1
    384 BCM_56524_A0 = 1
    385 BCM_56524_B0 = 1
    386 BCM_56685_A0 = 1
    387 BCM_56685_B0 = 1
    388 BCM_56334_A0 = 1
    389 BCM_56334_B0 = 1
    390 BCM_56840_A0 = 1
    391 BCM_56840_B0 = 1
    392 BCM_56142_A0 = 1
    393 BCM_53324_A0 = 1
    394 BCM_56440_A0 = 1
    395 BCM_56440_B0 = 1
    396 BCM_56450_A0 = 1
    397 BCM_56450_B0 = 1
    398 BCM_56450_B1 = 1
    399 BCM_56640_A0 = 1
    400 BCM_56850_A0 = 1
    401 BCM_56340_A0 = 1
    402 BCM_56150_A0 = 1
    403 BCM_53400_A0 = 1
    404 BCM_56960_A0 = 1
    405 BCM_56980_A0 = 1
    406 BCM_56980_B0 = 1
    407 BCM_56160_A0 = 1
    408 BCM_56860_A0 = 1
    409 BCM_56560_A0 = 1
    410 BCM_56260_A0 = 1
    411 BCM_56260_B0 = 1
    412 BCM_56870_A0 = 1
    413 BCM_56370_A0 = 1
    414 BCM_56770_A0 = 1
    415 BCM_56270_A0 = 1
    416 BCM_56560_B0 = 1
    417 BCM_56670_A0 = 1
    418 BCM_56670_B0 = 1
    419 BCM_56965_A0 = 1
    420 BCM_56970_A0 = 1
    421 BCM_53570_A0 = 1
    422 BCM_53570_B0 = 1
    423 BCM_53540_A0 = 1
    424 # }
    425 endif
    426 # }
    427 endif
    428 
    429 ifdef DNXF_CHIPS
    430 CFGFLAGS += $(strip $(foreach chipname,$(DNXF_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
    431 endif # DNXF_CHIPS
    432 ifdef TOMAHAWK3_CHIPS
    433 ifeq ($(eval_fixed),$(eval_fixed_ver))
    434 $(setallth3)
    435 else
    436 BCM_56980_A0 = 1
    437 BCM_56980_B0 = 1
    438 endif
    439 endif
    440 
    441 ifdef DPP_CHIPS
    442 # {
    443 $(setalldpp)
    444 # }
    445 endif
    446 
    447 ifdef DFE_CHIPS
    448 # {
    449 $(setalldfe)
    450 # }
    451 endif
    452 
    453 ifdef DNX_CHIPS
    454 # {
    455 $(setalldnx)
    456 # }
    457 endif
    458 
    459 ifdef DNXF_CHIPS
    460 # {
    461 $(setalldnxf)
    462 # }
    463 endif
    464 
    465 # }
    466 else # BCM_PTL_SPT
    467 # {
    468 
    469 # Some chip or chips excluded
    470 
    471 ifdef TOMAHAWK3_CHIPS
    472 CFGFLAGS += $(strip $(foreach chipname,$(TOMAHAWK3_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
    473 ifdef BCM_56980_A0
    474 BCM_56980_A0 = 1
    475 endif
    476 ifdef BCM_56980_B0
    477 BCM_56980_B0 = 1
    478 endif
    479 endif
    480 
    481 ifdef ESW_CHIPS
    482 # {
    483 CFGFLAGS += $(strip $(foreach chipname,$(ESW_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
    484 CFGFLAGS += -DUSE_SCACHE_DIRTY_BIT
    485 ifdef BCM_56340_A0
    486 # {
    487 BCM_56640_A0 = 1
    488 # }
    489 endif
    490 ifdef BCM_56440_A0
    491 # {
    492 BCM_56840_A0 = 1
    493 # }
    494 endif
    495 ifdef BCM_56440_B0
    496 # {
    497 BCM_56840_A0 = 1
    498 # }
    499 endif
    500 ifdef BCM_56450_A0
    501 # {
    502 BCM_56840_A0 = 1
    503 # }
    504 endif
    505 ifdef BCM_56450_B0
    506 # {
    507 BCM_56840_A0 = 1
    508 # }
    509 endif
    510 ifdef BCM_56450_B1
    511 # {
    512 BCM_56840_A0 = 1
    513 # }
    514 endif
    515 ifdef BCM_56260_A0
    516 # {
    517 BCM_56450_A0 = 1
    518 BCM_56840_A0 = 1
    519 # }
    520 endif
    521 ifdef BCM_56260_B0
    522 # {
    523 BCM_56450_A0 = 1
    524 BCM_56840_A0 = 1
    525 # }
    526 endif
    527 ifdef BCM_56270_A0
    528 # {
    529 BCM_56260_A0 = 1
    530 BCM_56450_A0 = 1
    531 BCM_56840_A0 = 1
    532 # }
    533 endif
    534 ifdef BCM_56560_B0
    535 # {
    536 BCM_56560_A0 = 1
    537 # }
    538 endif
    539 ifdef BCM_56670_A0
    540 #{
    541 BCM_56670_A0 = 1
    542 # }
    543 endif
    544 ifdef BCM_56670_B0
    545 #{
    546 BCM_56670_B0 = 1
    547 # }
    548 endif
    549 endif # ESW_CHIPS
    550 
    551 ifdef DPP_CHIPS
    552 # {
    553 CFGFLAGS += $(strip $(foreach chipname,$(DPP_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
    554 # }
    555 endif # DPP_CHIPS
    556 
    557 ifdef DFE_CHIPS
    558 # {
    559 CFGFLAGS += $(strip $(foreach chipname,$(DFE_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
    560 # }
    561 endif # DFE_CHIPS
    562 
    563 ifdef DNX_CHIPS
    564 # {
    565 CFGFLAGS += $(strip $(foreach chipname,$(DNX_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
    566 # }
    567 endif # DNX_CHIPS
    568 
    569 ifdef DNXF_CHIPS
    570 # {
    571 CFGFLAGS += $(strip $(foreach chipname,$(DNXF_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
    572 # }
    573 endif # DNXF_CHIPS
    574 
    575 # }
    576 endif # BCM_PTL_SPT
    577 
    578 ifndef	FEATURE_LIST
    579 # {
    580 
    581 ifdef ESW_CHIPS
    582 # {
    583 _ESW_FEATURE_LIST = L3 I2C BCMX BCMX_DIAG MEM_SCAN EDITLINE RCPU OOB_RCPU CUSTOMER \
    584     TEST CHASSIS CINT PTP BFD TCB PSTATS
    585 #
    586 # CES is only supported on Katana devices.
    587 #
    588 ifdef BCM_56440_A0 
    589 # {
    590 _ESW_FEATURE_LIST += CES
    591 # }
    592 endif
    593 ifdef BCM_56440_B0 
    594 # {
    595 _ESW_FEATURE_LIST += CES
    596 # }
    597 endif
    598 # }
    599 endif
    600 
    601 ifdef TOMAHAWK3_CHIPS
    602 _TOMAHAWK3_FEATURE_LIST = L3 I2C BCMX BCMX_DIAG MEM_SCAN EDITLINE RCPU OOB_RCPU CUSTOMER \
    603     TEST CHASSIS CINT PTP BFD
    604 endif
    605 
    606 ifdef DPP_CHIPS
    607 # {
    608 _DPP_FEATURE_LIST = L3 EDITLINE CUSTOMER TEST CHASSIS CINT BFD
    609 # }
    610 endif
    611 
    612 ifdef DFE_CHIPS
    613 # {
    614 _DFE_FEATURE_LIST = L3 EDITLINE CUSTOMER TEST CHASSIS CINT
    615 # }
    616 endif
    617 
    618 ifdef DNX_CHIPS
    619 # {
    620 _DNX_FEATURE_LIST = L3 EDITLINE CUSTOMER TEST CHASSIS CINT BFD
    621 # }
    622 endif
    623 
    624 ifdef DNXF_CHIPS
    625 # {
    626 _DNXF_FEATURE_LIST = L3 EDITLINE CUSTOMER TEST CHASSIS CINT
    627 # }
    628 endif
    629 
    630 _ALL_FEATURE_LIST = ${_ESW_FEATURE_LIST} \
    631 		  ${_DPP_FEATURE_LIST} \
    632 		${_DFE_FEATURE_LIST} ${_DNX_FEATURE_LIST} ${_DNXF_FEATURE_LIST} \
    633         ${_TOMAHAWK3_FEATURE_LIST}
    634 
    635 FEATURE_LIST = $(sort ${_ALL_FEATURE_LIST})
    636 
    637 ifeq ($(targetbase),vxworks)
    638 # {
    639 FEATURE_LIST +=	TELNET
    640 FEATURE_LIST += DRIVERS
    641 # }
    642 endif
    643 
    644 
    645 # end ifndef FEATURE_LIST
    646 # }
    647 endif
    648 
    649 # Include board make rules if present
    650 -include ${SDK}/make/Make.boards
    651 
    652 # Enable TCL interface
    653 ifdef DNX_TCL
    654 # {
    655 FEATURE_LIST += TCL
    656 # }
    657 endif
    658 
    659 # If TCL is enabled then add EDITLINE and ASE_TEST
    660 ifeq (TCL,$(findstring TCL,$(FEATURE_LIST)))
    661 # {
    662 ifneq (EDITLINE,$(findstring EDITLINE,$(FEATURE_LIST)))
    663 # {
    664 FEATURE_LIST += EDITLINE
    665 # }
    666 endif
    667 
    668 ifneq (ASE_TEST,$(findstring ASE_TEST,$(FEATURE_LIST)))
    669 # {
    670 FEATURE_LIST += ASE_TEST
    671 # }
    672 endif
    673 # }
    674 endif
    675 
    676 # DPP only compiles with BFD
    677 ifdef DPP_CHIPS
    678 # {
    679 ifneq (BFD,$(findstring BFD,$(FEATURE_LIST)))
    680 # {
    681 FEATURE_LIST += BFD
    682 # }
    683 endif
    684 # Uncomment the next three lines to force PTP inclusion for DPP chipsets
    685 #ifneq (PTP,$(findstring PTP,$(FEATURE_LIST)))
    686 #FEATURE_LIST += PTP
    687 #endif
    688 # }
    689 endif
    690 
    691 # DNX only compiles with BFD
    692 ifdef DNX_CHIPS
    693 # {
    694 ifneq (BFD,$(findstring BFD,$(FEATURE_LIST)))
    695 # {
    696 FEATURE_LIST += BFD
    697 # }
    698 endif
    699 # Uncomment the next three lines to force PTP inclusion for DNX chipsets
    700 #ifneq (PTP,$(findstring PTP,$(FEATURE_LIST)))
    701 #FEATURE_LIST += PTP
    702 #endif
    703 # }
    704 endif
    705 
    706 # If BFD is enabled then add L3
    707 ifeq (BFD,$(findstring BFD,$(FEATURE_LIST)))
    708 # {
    709 ifneq (L3,$(findstring L3,$(FEATURE_LIST)))
    710 # {
    711 FEATURE_LIST += L3
    712 # }
    713 endif
    714 # }
    715 endif
    716 
    717 # If CINT is not enabled, filter out APIMODE
    718 ifeq (,$(findstring CINT,$(FEATURE_LIST)))
    719 # {
    720 FEATURE_EXCLUDE_LIST += APIMODE
    721 # }
    722 endif
    723 
    724 ifdef NO_SAL_APPL
    725 # {
    726 FEATURE_EXCLUDE_LIST += TCL EDITLINE I2C TELNET DRIVERS CINT APIMODE
    727 CFGFLAGS += -DNO_SAL_APPL -DNO_CTRL_C -DNO_FILEIO -DNO_MEMTUNE
    728 # }
    729 endif
    730 
    731 
    732 ifdef FEATURE_EXCLUDE_LIST
    733 # {
    734 FEATURE_LIST := $(filter-out $(FEATURE_EXCLUDE_LIST), $(FEATURE_LIST))
    735 # }
    736 endif
    737 
    738 # If L3 is not defined, remove MPLS_LM_DM if present.
    739 ifeq (MPLS_LM_DM,$(findstring MPLS_LM_DM,$(FEATURE_LIST)))
    740 # {
    741 ifneq (L3,$(findstring L3,$(FEATURE_LIST)))
    742 # {
    743 FEATURE_LIST := $(filter-out MPLS_LM_DM, $(FEATURE_LIST))
    744 # }
    745 endif
    746 # }
    747 endif
    748 
    749 # If COLLECTOR is not defined, remove TELEMETRY if present.
    750 ifeq (TELEMETRY,$(findstring TELEMETRY,$(FEATURE_LIST)))
    751 # {
    752 ifneq (COLLECTOR,$(findstring COLLECTOR,$(FEATURE_LIST)))
    753 # {
    754 FEATURE_LIST := $(filter-out TELEMETRY, $(FEATURE_LIST))
    755 # }
    756 endif
    757 # }
    758 endif
    759 
    760 CFGFLAGS += $(foreach feature,$(FEATURE_LIST), -DINCLUDE_$(feature))
    761 
    762 ifeq (IPSEC,$(findstring IPSEC,$(FEATURE_LIST)))
    763 DIAG_IPSEC=1
    764 endif
    765 
    766 ifneq ($(targetbase),vxworks)
    767 # {
    768 # Make sure that VX_VERSION doesnot indicate VX_WORKS even if set
    769 VX_VERSION = ''
    770 # }
    771 endif
    772 
    773 ifndef	DISPATCH_LIST
    774 # {
    775     ifdef ESW_CHIPS
    776 # {
    777         DISPATCH_LIST += RPC ESW
    778 # }
    779     endif
    780     ifdef TOMAHAWK3_CHIPS
    781         DISPATCH_LIST += RPC TOMAHAWK3
    782     endif
    783 else # if DISPATCH_LIST defined
    784 #   Since TH3 is a new dispatch table and still comes under ESW,
    785 #   we add TH3 to the dispatch_list
    786     ifeq "$(findstring ESW,$(DISPATCH_LIST))" ""
    787         DISPATCH_LIST += TOMAHAWK3
    788         TOMAHAWK3_CHIPS = 1
    789         export TOMAHAWK3_CHIPS
    790     endif
    791 # }
    792 endif #end of dispatch_list
    793 
    794 ifdef BCM_88732_A0
    795 # {
    796 DISPATCH_LIST += SHADOW
    797 # }
    798 endif
    799 
    800 #
    801 # SAND_CHIPS means that at least one of Dune chip family defined
    802 # aka DPP_CHIPS || DFE_CHIPS || DNX_CHIPS || DNXF_CHIPS
    803 #
    804 # If ANY 'dune chip' is supported (SAND_CHIPS = 1) then define
    805 # BCM_SAND_SUPPORT (for C-preprocessor usage) to indicate that.
    806 #
    807 
    808 ifdef DPP_CHIPS
    809 # {
    810 DISPATCH_LIST += PETRA
    811 SAND_CHIPS = 1
    812 # }
    813 endif
    814 ifdef DFE_CHIPS
    815 # {
    816 DISPATCH_LIST += DFE
    817 SAND_CHIPS = 1
    818 # }
    819 endif
    820 #
    821 # For 'dnx', we want only DNX
    822 # See dispatcher.c
    823 #
    824 ifdef DNX_CHIPS
    825 # {
    826 DISPATCH_LIST += DNX
    827 SAND_CHIPS = 1
    828 # }
    829 endif
    830 
    831 ifdef DNXF_CHIPS
    832 # {
    833 DISPATCH_LIST += DNXF
    834 SAND_CHIPS = 1
    835 # }
    836 endif
    837 
    838 #
    839 # If ANY 'dune chip' is supported then define BCM_SAND_SUPPORT to
    840 # indicate that.
    841 #
    842 ifdef SAND_CHIPS
    843 # {
    844 CFGFLAGS += -DBCM_SAND_SUPPORT
    845 export SAND_CHIPS
    846 # }
    847 endif
    848 
    849 CFGFLAGS += $(foreach dispatch,$(DISPATCH_LIST), -DBCM_$(dispatch)_SUPPORT)
    850 ifneq (,$(findstring -DBCM_RPC_SUPPORT,$(CFGFLAGS)))
    851 # {
    852 CFGFLAGS += -DINCLUDE_LIB_CPUDB
    853 CFGFLAGS += -DINCLUDE_LIB_CPUTRANS
    854 CFGFLAGS += -DINCLUDE_LIB_DISCOVER
    855 CFGFLAGS += -DINCLUDE_LIB_STKTASK
    856 CFGFLAGS += -DDISCOVER_APP_DATA_BOARDID
    857 # }
    858 endif
    859 
    860 ifdef DPP_CHIPS
    861 # {
    862 CFLAGS += -DDUNE_BCM -DLINK_PETRA_LIBRARIES -DLINK_PPD_LIBRARIES
    863 ifdef BCM_88675_A0
    864 # {
    865 CFLAGS += -DBCM_JERICHO_SUPPORT
    866 # }
    867 endif
    868 ifdef BCM_88375_A0
    869 # {
    870 CFLAGS += -DBCM_JERICHO_SUPPORT
    871 # }
    872 endif
    873 ifdef BCM_88680_A0
    874 # {
    875 CFLAGS += -DBCM_JERICHO_PLUS_SUPPORT
    876 # }
    877 endif
    878 ifdef BCM_88470_A0
    879 # {
    880 CFLAGS += -DBCM_QAX_SUPPORT
    881 # }
    882 endif
    883 ifdef BCM_88270_A0
    884 # {
    885 CFLAGS += -DBCM_QUX_SUPPORT
    886 # }
    887 endif
    888 ifdef BCM_8206_A0
    889 # {
    890 CFLAGS += -DBCM_FLAIR_SUPPORT
    891 # }
    892 endif
    893 ifneq (,$(findstring -DPLISIM,$(CFLAGS)))
    894 # {
    895 CFLAGS += -DSAND_LOW_LEVEL_SIMULATION -DUSING_CHIP_SIM
    896 DEBUG_SYMBOLS=TRUE
    897 # }
    898 endif
    899 ifneq (, $(findstring PIONEER,$(FEATURE_LIST)))
    900 # {
    901 CFGFLAGS += -DINCLUDE_LIB_PIONEER_HOST  
    902 # }
    903 endif
    904 # }
    905 endif
    906 
    907 ifdef DNX_CHIPS
    908 # {
    909 ifdef BCM_88690_A0
    910 # {
    911 CFLAGS += -DBCM_JERICHO_2_SUPPORT
    912 # }
    913 else
    914 ifdef BCM_88690_B0
    915 # {
    916 CFLAGS += -DBCM_JERICHO_2_SUPPORT
    917 # }
    918 endif
    919 endif
    920 ifneq (,$(findstring -DPLISIM,$(CFLAGS)))
    921 # {
    922 CFLAGS += -DSAND_LOW_LEVEL_SIMULATION -DUSING_CHIP_SIM
    923 DEBUG_SYMBOLS=TRUE
    924 # }
    925 endif
    926 ifneq (, $(findstring PIONEER,$(FEATURE_LIST)))
    927 # {
    928 CFGFLAGS += -DINCLUDE_LIB_PIONEER_HOST  
    929 # }
    930 endif
    931 # }
    932 endif
    933 
    934 ifdef DFE_CHIPS
    935 # {
    936 CFLAGS += -DDUNE_BCM
    937 ifneq (,$(findstring -DPLISIM,$(CFLAGS)))
    938 # {
    939 CFLAGS += -DSAND_LOW_LEVEL_SIMULATION -DUSING_CHIP_SIM
    940 DEBUG_SYMBOLS=TRUE
    941 # }
    942 endif
    943 # }
    944 endif
    945 
    946 ifdef DNXF_CHIPS
    947 # {
    948 ifneq (,$(findstring -DPLISIM,$(CFLAGS)))
    949 # {
    950 CFLAGS += -DSAND_LOW_LEVEL_SIMULATION -DUSING_CHIP_SIM
    951 DEBUG_SYMBOLS=TRUE
    952 # }
    953 endif
    954 # }
    955 endif
    956 
    957 ifneq (,$(findstring I2C,$(FEATURE_LIST)))
    958 # {
    959 CFGFLAGS += -DINCLUDE_I2C
    960 # }
    961 endif
    962 
    963 ifneq (,$(findstring AEDEV,$(FEATURE_LIST)))
    964 # {
    965 CFGFLAGS += -DINCLUDE_LIB_AEDEV
    966 # }
    967 endif
    968 
    969 ifneq (,$(findstring CINT,$(FEATURE_LIST)))
    970 # {
    971 CFGFLAGS += -DINCLUDE_LIB_CINT
    972 CFGFLAGS += -DCINT_CONFIG_INCLUDE_SDK_SAL=1 -DCINT_CONFIG_INCLUDE_PARSER=1 -DCINT_CONFIG_INCLUDE_CINT_LOAD=0
    973 ifeq (${BCM_API_VERBOSE_LOGGING},1)
    974 # {
    975 CFGFLAGS += -DCINT_CONFIG_INCLUDE_CINT_LOGGER=1 -DBCM_API_VERBOSE_LOGGING
    976 # }
    977 endif
    978 ifeq (,$(findstring EDITLINE,$(FEATURE_LIST)))
    979 # {
    980 CFGFLAGS += -DCINT_CONFIG_INCLUDE_PARSER_READLINE=0 -DCINT_CONFIG_INCLUDE_PARSER_ADD_HISTORY=0
    981 # }
    982 endif
    983 # }
    984 endif
    985 
    986 ifneq (,$(findstring C_UNIT,$(FEATURE_LIST)))
    987 # {
    988 CFGFLAGS += -DINCLUDE_LIB_C_UNIT
    989 CFGFLAGS += -DC_UNIT_CONFIG_INCLUDE_SDK_SAL=1
    990 # }
    991 endif
    992 
    993 ifndef	BCM_PHY_LIST
    994 # {
    995 BCM_PHY_LIST=522X 54XX 5464 5421S 5482 54616 54680 54680E 52681E 54880E 54682 54684 54640 54640E 54880 SERDES SIMUL 8703 8705 8706 8072 8040 8481 8750 8729 84740 84756 54380 542XX 84334 84728 84749 84328 84793 82328 82381 82780
    996 BCM_PHY_LIST += 82764 EGPHY28 82864 82109
    997 ifdef ESW_CHIPS
    998 # {
    999 BCM_PHY_LIST += 8806X
   1000 # }
   1001 endif
   1002 # }
   1003 endif
   1004 
   1005 CFGFLAGS += $(foreach phy,$(BCM_PHY_LIST), -DINCLUDE_PHY_$(phy))
   1006 
   1007 ifneq (,(findstring 54880,$(BCM_PHY_LIST)))
   1008 # {
   1009 CFGFLAGS += -DINCLUDE_LONGREACH
   1010 # }
   1011 endif
   1012 
   1013 # use QUIET=1 to control printing of compilation lines
   1014 ifdef	QUIET
   1015 # {
   1016 Q:=@
   1017 # }
   1018 else
   1019 # {
   1020 Q:=
   1021 # }
   1022 endif
   1023 
   1024 #
   1025 # Suffix to add to the "target" files to allow local builds with different
   1026 # flags. Set "target_suffix" to XXX to cause the build to put built objects
   1027 # in ${target}${target_suffix}. This allows things like building a debug
   1028 # version with different flags.  This may also be set in another Makefile.
   1029 #
   1030 
   1031 #target_suffix :=
   1032 
   1033 #
   1034 # Optional suffix to add to the build directory and output binary files
   1035 # to allow multiple builds to co-exist for various reasons.
   1036 #
   1037 #chip_suffix := -$(shell echo $(CHIP) | tr A-Z a-z)
   1038 
   1039 #
   1040 # Combined suffixes
   1041 #
   1042 all_suffix = ${chip_suffix}${target_suffix}
   1043 
   1044 #
   1045 # Default location to place binaries and make depend files for building
   1046 # purposes.
   1047 #
   1048 ifeq "$(HOSTTYPE)" "Windows2000PC"
   1049 # {
   1050 BLDROOTWITHDRIVE = ${SDK}/build/${target}${all_suffix}${bldroot_suffix}
   1051 BLDROOT = ${SDK_NO_DRIVE_NAME}/build/${target}${all_suffix}${bldroot_suffix}
   1052 # }
   1053 else # ifeq "$(HOSTTYPE)" "Windows2000PC"
   1054 # {
   1055 
   1056 ifndef SDKBUILD
   1057 # {
   1058 SDKBUILD :=build
   1059 # }
   1060 endif
   1061 
   1062 BLDROOT = ${SDK}/${SDKBUILD}/$(if ${BLDCONFIG},${BLDCONFIG}/)${target}${all_suffix}${bldroot_suffix}
   1063 
   1064 # }
   1065 endif # ifeq "$(HOSTTYPE)" "Windows2000PC"
   1066 
   1067 # This is needed because we cannot include Make.vxworks before Make.config
   1068 ifndef DEST_DIR_SUFFIX
   1069 # {
   1070 export DEST_DIR_SUFFIX :=$(subst $(realpath $(SDK))/systems,,$(realpath $(CURDIR)/$(dir ($(firstword $(MAKEFILE_LIST))))))
   1071 ifeq ($(MAKELEVEL),0)
   1072 # {
   1073 # }
   1074 endif
   1075 # }
   1076 endif
   1077 
   1078 ifeq ($(DEST_DIR),)
   1079 # {
   1080 export DEST_DIR :=${SDK}/${SDKBUILD}$(if ${BLDCONFIG},/${BLDCONFIG})$(DEST_DIR_SUFFIX)
   1081 # }
   1082 endif
   1083 
   1084 ifdef LOCALDIR
   1085 # {
   1086 BLDDIR = ${BLDROOT}/${LOCALDIR}
   1087 ifeq "$(HOSTTYPE)" "Windows2000PC"
   1088 # {
   1089 BLDDIRWITHDRIVE = ${BLDROOTWITHDRIVE}/${LOCALDIR}
   1090 # }
   1091 endif
   1092 # }
   1093 else # ifdef LOCALDIR
   1094 # {
   1095 BLDDIR = ${BLDROOT}
   1096 ifeq "$(HOSTTYPE)" "Windows2000PC"
   1097 # {
   1098 BLDDIRWITHDRIVE = ${BLDROOTWITHDRIVE}
   1099 # }
   1100 endif
   1101 # }
   1102 endif # ifdef LOCALDIR
   1103 
   1104 LIBDIR = ${BLDROOT}
   1105 
   1106 #
   1107 # Export directory, where build objects used by the outside world are
   1108 # placed (exported header files, libs, bins)
   1109 #
   1110 EXPDIR = ${SDK}/export/${target}${all_suffix}
   1111 
   1112 #
   1113 # Standard include paths
   1114 #
   1115 
   1116 ifeq (wrx,$(findstring wrx,$(platform)))
   1117 CPU_PLATFORM = wrx
   1118 endif
   1119 ifeq (slk,$(findstring slk,$(platform)))
   1120 CPU_PLATFORM = slk
   1121 endif
   1122 export CPU_PLATFORM
   1123 
   1124 INCDIR	= ${SDK}/include
   1125 ifneq (,$(findstring -DBCM_PTP_EXT_SERVO_SUPPORT,$(CFGFLAGS)))
   1126 INCDIR += -I${EXT_SERVO_ROOT}/idtSystem/osAdaptation/linux.${CPU_PLATFORM}/include \
   1127           -I${EXT_SERVO_ROOT}/idtSystem/deviceAdaptors/timeStamp/api/include/ \
   1128           -I${EXT_SERVO_ROOT}/idtCommon/include \
   1129 		  -I${EXT_SERVO_ROOT}/idtCore/management/include \
   1130 		  -I${EXT_SERVO_ROOT}/idtCore/servo/include
   1131 endif
   1132 
   1133 # XFLOW_MACSEC include paths
   1134 ifneq (,$(findstring XFLOW_MACSEC,$(FEATURE_LIST)))
   1135 # {
   1136 BUILD_XFLOW_MACSEC = 1
   1137 FEATURE_XFLOW_MACSEC = 1
   1138 XFLOW_MACSEC_BUILD_FLAG=-DBROADCOM_SAL -I${SDK} -I${SDK}/include -g -Wall -Werror -fno-strict-aliasing
   1139 
   1140 XFLOW_MACSEC_BUILD_FLAG += ${STD_CFLAGS}
   1141 
   1142 ifndef XFLOW_MACSEC_HOME
   1143 # {
   1144 toast:; $(error 'The $$XFLOW_MACSEC_HOME environment variable is not set')
   1145 # }
   1146 endif
   1147 INCDIR += -I${SDK} -I${XFLOW_MACSEC_HOME}/include
   1148 CFGFLAGS += -DBROADCOM_SAL
   1149 # }
   1150 else
   1151 # MACSEC include paths
   1152 ifneq (,$(findstring MACSEC,$(FEATURE_LIST)))
   1153 # {
   1154 BUILD_MACSEC = 1
   1155 FEATURE_MACSEC = 1
   1156 MACSEC_BUILD_FLAG=-DBROADCOM_SAL -I${SDK} -I${SDK}/include -g -Wall -Werror -fno-strict-aliasing
   1157 
   1158 MACSEC_BUILD_FLAG += ${STD_CFLAGS}
   1159 
   1160 ifndef MACSEC_HOME
   1161 # {
   1162 toast:; $(error 'The $$MACSEC_HOME environment variable is not set')
   1163 # }
   1164 endif
   1165 INCDIR += -I${SDK} -I${MACSEC_HOME}/include -I${MACSEC_HOME}/cli -I${MACSEC_HOME}/phy/bcm54380  -I${MACSEC_HOME}/phy/bcm8729 -I${MACSEC_HOME}/phy/bcm84756 -I${MACSEC_HOME}/phy/bcm84334  -I${MACSEC_HOME}/phy/bcm84749  -I${MACSEC_HOME}/phy/dummyphy
   1166 CFGFLAGS += -DBROADCOM_SAL
   1167 # }
   1168 endif
   1169 endif
   1170 
   1171 ifneq (,$(findstring -DBCM_PTP_EXT_SERVO_SUPPORT,$(CFGFLAGS)))
   1172 BUILD_EXT_SERVO = 1
   1173 FEATURE_EXT_SERVO = 1
   1174 EXT_SERVO_BUILD_FLAG = CPU_TARGET=${CPU_PLATFORM} USER_ARFLAGS=rcvs CLOCK_TYPE=BC NUMBER_OF_STACK_INSTANCES=10 DCO_DEVICE=softwareDco TIMESTAMP_DEVICE=softwareTimestamping
   1175 endif
   1176 
   1177 # FCMAP include paths
   1178 ifneq (,$(findstring FCMAP,$(FEATURE_LIST)))
   1179 # {
   1180 FEATURE_FCMAP = 1
   1181 INCDIR += -I${SDK}  -I${SDK}/include -I${SDK}/src/soc/phy/fcmap/include
   1182 CFGFLAGS += -DBROADCOM_SAL
   1183 # }
   1184 endif
   1185 INCDIR += -I${SDK}  -I${SDK}/include -I${SDK}/src/soc/phy/chip/koi/merlin_koi_src
   1186 INCDIR += -I${SDK}  -I${SDK}/include -I${SDK}/src/soc/phy/chip/orca/eagle_orca_src
   1187 
   1188 ifdef IMACSEC_HOME
   1189 INCDIR += -I${SDK}/src/soc/phy -I${SDK}/src/soc/phy/imacsec/include -I${IMACSEC_HOME}/bcm_plp_base_t_sec
   1190 CFGFLAGS += -DINCLUDE_PLP_IMACSEC
   1191 CFGFLAGS += -DINCLUDE_PLP_UNIMAC
   1192 endif
   1193 
   1194 # EAV APPL in diag is intended to be built
   1195 #ifneq (,$(findstring EAV_APPL,$(FEATURE_LIST)))
   1196 #BUILD_EAV_APPL = 1
   1197 #endif
   1198 
   1199 ifneq (,$(findstring KNET,$(FEATURE_LIST)))
   1200 # {
   1201 BUILD_KNET = 1
   1202 # }
   1203 endif
   1204 
   1205 # Start Checking for KBP feature
   1206 #
   1207 ifeq (KBP,$(findstring KBP,$(FEATURE_LIST)))
   1208 # {
   1209 ifndef KBP_DEVICE
   1210 # {
   1211 $(error "KBP Feature is Enabled, and no valid Device was defined. Define KBP_DEVICE=KBP_11K or KBP_DEVICE=KBP_ALG")
   1212 # }
   1213 else
   1214 # {
   1215 ifeq (KBP_12K,$(findstring KBP_12K,$(KBP_DEVICE)))
   1216 # {
   1217 $(error "KBP_12K device not supported. Only KBP_11K and KBP_ALG devices are supported for KBP feature")
   1218 # }
   1219 endif
   1220 # }
   1221 endif
   1222 
   1223 ifeq (KBP_11K,$(findstring KBP_11K,$(KBP_DEVICE)))
   1224 # {
   1225 DEVICE=nlm2
   1226 INCDIR += -I${SDK}/include/soc/kbp/nlm2/diagnostic
   1227 INCDIR += -I${SDK}/include/soc/kbp/nlm2/nlmxpt
   1228 INCDIR += -I${SDK}/include/soc/kbp/nlm2/simxpt
   1229 # }
   1230 endif
   1231 
   1232 ifeq (KBP_12K,$(findstring KBP_12K,$(KBP_DEVICE)))
   1233 # {
   1234 DEVICE=nlm3
   1235 INCDIR += -I${SDK}/include/soc/kbp/nlm3/model
   1236 INCDIR += -I${SDK}/include/soc/kbp/nlm3/blackholexpt
   1237 INCDIR += -I${SDK}/include/soc/kbp/nlm3/xpt
   1238 # }
   1239 endif
   1240 
   1241 ifneq (KBP_ALG,$(findstring KBP_ALG,$(KBP_DEVICE)))
   1242 # {
   1243 KBP_LIBDIR=${SDK}/src/soc/kbp/${DEVICE}/lib/${targetbase}-${targetplat}/${platform}/
   1244 
   1245 CFLAGS += -DNLMPLATFORM_BCM
   1246 INCDIR += -I${SDK}/include
   1247 INCDIR += -I${SDK}/include/soc/kbp/${DEVICE}/nlmdevmgr
   1248 INCDIR += -I${SDK}/include/soc/kbp/${DEVICE}/arch
   1249 INCDIR += -I${SDK}/include/soc/kbp/common
   1250 INCDIR += -I${SDK}/include/soc/kbp/${DEVICE}/nlmrangemgr
   1251 INCDIR += -I${SDK}/include/soc/kbp/${DEVICE}/nlmgenerictblmgr
   1252 INCDIR += -I${SDK}/include/soc/kbp/${DEVICE}/nlmfibtblmgr/api
   1253 INCDIR += -I${SDK}/include/soc/kbp/${DEVICE}/nlmfibtblmgr/common
   1254 # }
   1255 else
   1256 # {
   1257 INCDIR += -I${SDK}/include/soc/kbp/alg_kbp/include
   1258 CFLAGS += -DNLMPLATFORM_UNIX -DNLMPLATFORM_LINUX
   1259 # }
   1260 endif
   1261 
   1262 
   1263 ifeq ($(shell uname -m),x86_64)
   1264 # {
   1265 ifeq (DLONGS_ARE_64BITS,$(findstring DLONGS_ARE_64BITS,$(CFLAGS)))
   1266 # {
   1267 ifeq (DPTRS_ARE_64BITS,$(findstring DPTRS_ARE_64BITS,$(CFLAGS)))
   1268 # {
   1269 CFLAGS += -DNLM_BUILD64
   1270 # }
   1271 endif
   1272 # }
   1273 endif
   1274 # }
   1275 endif
   1276 # }
   1277 endif
   1278 
   1279 # End Checking for KBP feature
   1280 
   1281 #
   1282 # PHYMOD library support
   1283 #
   1284 # PHYMOD_CHIP_NAMES defines which internal PHYs require PHYMOD support.
   1285 # PHYMOD_PHY_LIST defines which external PHYs require PHYMOD support.
   1286 #
   1287 PHYMOD_CHIP_NAMES = BCM_53400_A0 BCM_88650_A0 BCM_88950_A0 BCM_88790_A0 BCM_88675_A0 BCM_56860_A0 BCM_88375_A0 BCM_88680_A0 BCM_88690_A0 BCM_88690_B0 BCM_88470_A0   BCM_88270_A0 BCM_8206_A0 BCM_56960_A0 BCM_88202_A0 BCM_56560_A0 BCM_56560_B0 BCM_56260_A0 BCM_56160_A0 BCM_56260_B0 BCM_56965_A0 BCM_56970_A0 BCM_53570_A0 BCM_56870_A0 BCM_53570_B0 BCM_53540_A0 BCM_56670_A0 BCM_56980_A0 BCM_56980_B0 BCM_56370_A0 BCM_56770_A0 BCM_56670_B0
   1288 
   1289 
   1290 PHYMOD_PHY_LIST = 82381 82764 8806X 82864 82109
   1291 
   1292 # Define default PHYMOD support based on included PHYs
   1293 ifeq (,$(PHYMOD_SUPPORT))
   1294 # {
   1295 seekphymodchips = $(foreach chipname,$(PHYMOD_CHIP_NAMES),$(whereischip))
   1296 ifneq "$(findstring file,$(seekphymodchips))" ""
   1297 # {
   1298 PHYMOD_SUPPORT = 1
   1299 # }
   1300 endif
   1301 # }
   1302 endif
   1303 ifeq (,$(PHYMOD_SUPPORT))
   1304 # {
   1305 ifneq (,$(filter $(PHYMOD_PHY_LIST),$(BCM_PHY_LIST)))
   1306 # {
   1307 PHYMOD_SUPPORT = 1
   1308 # }
   1309 endif
   1310 # }
   1311 endif
   1312 
   1313 # Include PHYMOD diagnotics by default
   1314 ifeq (,$(PHYMOD_DIAG))
   1315 # {
   1316 PHYMOD_DIAG = $(PHYMOD_SUPPORT)
   1317 # }
   1318 endif
   1319 
   1320 # Configure PHYMOD build
   1321 ifeq (1,$(PHYMOD_SUPPORT))
   1322 # {
   1323 BUILD_PHYMOD = 1
   1324 ifdef PHYMOD_PRE_BUILD_PATH
   1325 INCDIR += -I$(PHYMOD_PRE_BUILD_PATH)/libs/phymod/include
   1326 else
   1327 INCDIR += -I${SDK}/libs/phymod/include
   1328 endif
   1329 CFLAGS += -DPHYMOD_SUPPORT
   1330 CFLAGS += -DPHYMOD_TIER1_SUPPORT
   1331 CFLAGS += -DPHYMOD_INCLUDE_CUSTOM_CONFIG
   1332 CFLAGS += -DSERDES_EXTERNAL_INFO_TABLE_EN
   1333 ifeq (1,$(PHYMOD_DIAG))
   1334 # {
   1335 CFLAGS += -DPHYMOD_DIAG
   1336 # }
   1337 endif
   1338 # }
   1339 endif
   1340 
   1341 
   1342 #Add the devices that has CPRI module.
   1343 CPRIMOD_CHIP_NAMES = BCM_56670_A0 BCM_56670_B0
   1344 
   1345 seekportmod =  $(foreach chipname,$(CPRIMOD_CHIP_NAMES),$(whereischip))
   1346 #portmod support)
   1347 ifeq (,$(CPRIMOD_SUPPORT))
   1348 # {
   1349 ifneq "$(findstring file,$(seekportmod))" ""
   1350 # {
   1351 CPRIMOD_SUPPORT = 1
   1352 # }
   1353 endif
   1354 # }
   1355 endif
   1356 
   1357 ifeq (1,$(CPRIMOD_SUPPORT))
   1358 # {
   1359 BUILD_PORTMOD = 1
   1360 CFLAGS += -DCPRIMOD_DIAG
   1361 CFLAGS += -DCPRIMOD_SUPPORT
   1362 CFLAGS += -DCPRI_DIAG_SUPPORT
   1363 CFLAGS += -DCPRIMOD_CPRI_FALCON_SUPPORT
   1364 export CPRIMOD_SUPPORT
   1365 # }
   1366 endif
   1367 
   1368 
   1369 PORTMOD_CHIP_NAMES = BCM_53400_A0 BCM_88950_A0 BCM_88790_A0 BCM_88670_A0 BCM_88675_A0 BCM_56860_A0 BCM_88375_A0  BCM_88680_A0 BCM_88690_A0 BCM_88690_B0 BCM_88470_A0  BCM_88270_A0 BCM_8206_A0 BCM_56960_A0 BCM_56560_A0 BCM_56560_B0 BCM_56160_A0 BCM_56965_A0 BCM_56970_A0 BCM_53570_A0 BCM_56870_A0 BCM_53570_B0 BCM_53540_A0 BCM_56670_A0 BCM_56980_A0 BCM_56980_B0 BCM_56370_A0 BCM_56770_A0 BCM_56670_B0
   1370 
   1371 seekportmod =  $(foreach chipname,$(PORTMOD_CHIP_NAMES),$(whereischip))
   1372 #portmod support)
   1373 ifeq (,$(PORTMOD_SUPPORT))
   1374 # {
   1375 ifneq "$(findstring file,$(seekportmod))" ""
   1376 # {
   1377 PORTMOD_SUPPORT = 1
   1378 # }
   1379 endif
   1380 # }
   1381 endif
   1382 
   1383 ifeq (1,$(PORTMOD_SUPPORT))
   1384 # {
   1385 BUILD_PORTMOD = 1
   1386 CFLAGS += -DPORTMOD_DIAG
   1387 CFLAGS += -DPORTMOD_SUPPORT
   1388 export PORTMOD_SUPPORT
   1389 # }
   1390 endif
   1391 
   1392 
   1393 #
   1394 # CANCUN support
   1395 #
   1396 # CANCUN_CHIP_NAMES defines which chips require CANCUN support
   1397 #
   1398 CANCUN_CHIP_NAMES = BCM_56870_A0 BCM_56870_B0 BCM_56370_A0 BCM_56770_A0
   1399 
   1400 
   1401 
   1402 
   1403 
   1404 ifeq (,$(CANCUN_SUPPORT))
   1405 seekcancunchips = $(foreach chipname,$(CANCUN_CHIP_NAMES),$(whereischip))
   1406 ifneq "$(findstring file,$(seekcancunchips))" ""
   1407 CANCUN_SUPPORT = 1
   1408 endif
   1409 endif
   1410 
   1411 ifeq (1,$(CANCUN_SUPPORT))
   1412 
   1413 CFLAGS += -DCANCUN_SUPPORT
   1414 export CANCUN_SUPPORT
   1415 endif
   1416 
   1417 #
   1418 # CMICFW support
   1419 #
   1420 # CMICFW_CHIP_NAMES defines which chips require CMICFW support
   1421 #
   1422 CMICFW_CHIP_NAMES = BCM_56870_A0 BCM_56980_A0 BCM_56980_B0
   1423 
   1424 
   1425 ifeq (,$(CMICFW_SUPPORT))
   1426 seekcmicfwchips = $(foreach chipname,$(CMICFW_CHIP_NAMES),$(whereischip))
   1427 ifneq "$(findstring file,$(seekcmicfwchips))" ""
   1428 CMICFW_SUPPORT = 1
   1429 endif
   1430 endif
   1431 
   1432 ifeq (1,$(CMICFW_SUPPORT))
   1433 
   1434 endif
   1435 
   1436 #Add the devices that supports SW Autoneg to the lst below 
   1437 SW_AN_CHIP_NAMES = BCM_56965_A0 BCM_56560_B0 BCM_56565_B0 BCM_56969_A0 BCM_56966_A0 BCM_56967_A0 BCM_56970_A0
   1438 
   1439 ifeq (,$(SW_AUTONEG_SUPPORT))
   1440 # {
   1441 seekswanchips = $(foreach chipname,$(SW_AN_CHIP_NAMES),$(whereischip))
   1442 ifneq "$(findstring file,$(seekswanchips))" ""
   1443 # {
   1444 SW_AUTONEG_SUPPORT = 1
   1445 # }
   1446 endif
   1447 # }
   1448 endif
   1449 
   1450 ifeq (1,$(SW_AUTONEG_SUPPORT))
   1451 # {
   1452 CFLAGS += -DSW_AUTONEG_SUPPORT
   1453 #}
   1454 endif
   1455 
   1456 #
   1457 # PCIE GEN3 library support
   1458 #
   1459 # PCIEG3_CHIP_NAMES defines which chips require PCIE Gen3 PHY libray support.
   1460 #
   1461 PCIEG3_CHIP_NAMES = BCM_56870_A0 BCM_88690_A0 BCM_88690_B0 BCM_88790_A0 BCM_56980_A0 BCM_56980_B0 BCM_56770_A0 BCM_56370_A0
   1462 
   1463 
   1464 # Define default PCIEG3 support based on included PHYs
   1465 ifeq (,$(PCIEG3_SUPPORT))
   1466 seekpcieg3chips = $(foreach chipname,$(PCIEG3_CHIP_NAMES),$(whereischip))
   1467 ifneq "$(findstring file,$(seekpcieg3chips))" ""
   1468 PCIEG3_SUPPORT = 1
   1469 endif
   1470 endif
   1471 
   1472 # Include PCIEG3 PHY diagnotics by default
   1473 ifeq (,$(PCIEG3_DIAG))
   1474 # {
   1475 PCIEG3_DIAG = $(PCIEG3_SUPPORT)
   1476 # }
   1477 endif
   1478 
   1479 # Configure PCIEG3 build
   1480 ifeq (1,$(PCIEG3_SUPPORT))
   1481 # {
   1482 BUILD_PCIEG3 = 1
   1483 INCDIR += -I${SDK}/libs/pcieg3/include
   1484 INCDIR += -I${SDK}/libs/pcieg3/merlin16/include
   1485 CFLAGS += -DPCIEG3_SUPPORT
   1486 ifeq (1,$(PCIEG3_DIAG))
   1487 # {
   1488 CFLAGS += -DPCIEG3_DIAG_SUPPORT
   1489 # }
   1490 endif
   1491 # }
   1492 endif
   1493 
   1494 
   1495 #
   1496 # Paths of where we install files for make install
   1497 #
   1498 # install_headers - where to install header files.
   1499 # install_lib     - where to install libs
   1500 # install_bin	  - where to install completely linked binaries
   1501 #
   1502 install_headers	= ${SDK}/export/include
   1503 install_lib	= ${SDK}/export/lib/${target}
   1504 install_bin	= ${SDK}/export/bin/${target}
   1505 
   1506 #
   1507 # Compilation Flags
   1508 #
   1509 # Flags may be added to (see below)
   1510 #
   1511 
   1512 INCDIR += -I${SDK}/src/soc/phy/phy8806x/include
   1513 
   1514 INCFLAGS = -I${INCDIR} -I${SDK}/systems
   1515 
   1516 CFLAGS += ${INCFLAGS}
   1517 CXXFLAGS += ${INCFLAGS}
   1518 CPPFLAGS += ${INCFLAGS}
   1519 
   1520 #
   1521 # Debug #ifdef control
   1522 #
   1523 # Compiling out #ifdef DEBUG code saves about 1.3% on executable size.
   1524 # It is recommended to leave debug enabled when developing applications.
   1525 #
   1526 ifndef DEBUG_IFDEFS
   1527 # {
   1528 DEBUG_IFDEFS=TRUE
   1529 # }
   1530 endif
   1531 
   1532 ifeq ($(DEBUG_IFDEFS),TRUE)
   1533 # {
   1534 CFLAGS += -DBROADCOM_DEBUG
   1535 CXXFLAGS += -DBROADCOM_DEBUG
   1536 CPPFLAGS += -DBROADCOM_DEBUG
   1537 # }
   1538 endif
   1539 
   1540 #
   1541 # Debug symbol information control
   1542 #
   1543 ifneq ($(targetbase),ghs)
   1544 # {
   1545 ifndef DEBUG_SYMBOLS
   1546 # {
   1547 DEBUG_SYMBOLS=TRUE
   1548 # }
   1549 endif
   1550 # }
   1551 endif
   1552 
   1553 ifeq ($(DEBUG_SYMBOLS),TRUE)
   1554 # {
   1555 CFLAGS += -g
   1556 CXXFLAGS += -g
   1557 CPPFLAGS += -g
   1558 # }
   1559 endif
   1560 
   1561 ifndef BCM_88732_A0
   1562 # {
   1563 CFGFLAGS += -DNO_BCM_88732_A0
   1564 # }
   1565 endif
   1566 
   1567 #
   1568 # If DEBUG_CFLAGS is set, add its contents to CFLAGS.
   1569 # May be useful for setting on the command line or adding to Make.local.
   1570 # Example: gmake DEBUG_CFLAGS=-save-temps system.c
   1571 #
   1572 
   1573 ifneq ($(DEBUG_CFLAGS),)
   1574 # {
   1575 CFLAGS += $(DEBUG_CFLAGS)
   1576 CXXFLAGS += $(DEBUG_CFLAGS)
   1577 CPPFLAGS += $(DEBUG_CFLAGS)
   1578 # }
   1579 endif
   1580 
   1581 #
   1582 # Optimization level
   1583 #
   1584 # Set DEBUG_OPTIMIZE to TRUE (default) to use a normal optimization
   1585 #		determined by OPTFLAGS_DEFAULT in the platform Makefile.
   1586 # Set DEBUG_OPTIMIZE to FALSE to use no optimization,
   1587 #		strongly recommended when using any debugger.
   1588 # Set DEBUG_OPTIMIZE to any other option string to request specific
   1589 #		optimization flags (for example -O2).
   1590 #
   1591 ifndef DEBUG_OPTIMIZE
   1592 # {
   1593 DEBUG_OPTIMIZE=TRUE
   1594 # }
   1595 endif
   1596 
   1597 ifeq ($(DEBUG_OPTIMIZE),TRUE)
   1598 # {
   1599 OPTFLAGS += $(OPTFLAGS_DEFAULT)
   1600 # }
   1601 else
   1602 # {
   1603 ifneq ($(DEBUG_OPTIMIZE),FALSE)
   1604 # {
   1605 OPTFLAGS += $(DEBUG_OPTIMIZE)
   1606 # }
   1607 endif
   1608 # }
   1609 endif
   1610 
   1611 #
   1612 # Debug assertion control.
   1613 #
   1614 # Compiling out assert() saves about 1.1% on executable size,
   1615 # however doing so is VERY MUCH discouraged.
   1616 #
   1617 ifndef DEBUG_ASSERTS
   1618 # {
   1619 DEBUG_ASSERTS=TRUE
   1620 # }
   1621 endif
   1622 
   1623 ifeq ($(DEBUG_ASSERTS),FALSE)
   1624 # {
   1625 CFLAGS += -DNDEBUG
   1626 CXXFLAGS += -DNDEBUG
   1627 CPPFLAGS += -DNDEBUG
   1628 # }
   1629 endif
   1630 
   1631 #
   1632 # GCC pedantic mode.
   1633 #
   1634 ifeq ($(DEBUG_PEDANTIC),TRUE)
   1635 # {
   1636 CFGFLAGS += -D__PEDANTIC__
   1637 CFLAGS += --pedantic
   1638 CXXFLAGS += --pedantic
   1639 # }
   1640 endif
   1641 
   1642 #
   1643 # Dynamic Load Enabled
   1644 #
   1645 ifeq ($(DL_ENABLE),TRUE)
   1646 # {
   1647 CFLAGS += -DDL_ENABLE
   1648 LDFLAGS += -ldl -export-dynamic
   1649 # }
   1650 endif
   1651 
   1652 #
   1653 # In each directory, build a list of local sources, objects, and headers
   1654 #
   1655 LSRCS	=	$(wildcard *.c *.cpp *.s *.cc *.C)
   1656 LOBJS	=	$(addsuffix .o, $(basename ${LSRCS}))
   1657 BOBJS	= 	$(addprefix ${BLDDIR}/,${LOBJS})
   1658 LHDRS	=	$(wildcard *.h *.H)
   1659 LDOTIS	=	$(wildcard *.i)
   1660 
   1661 
   1662 ifeq ($(TOOLS),Borland)
   1663 # {
   1664 BORLAND_LOBJS	=	$(addsuffix .obj, $(basename ${LSRCS}))
   1665 #BORLAND_BLDDIR	= 	$(subst, \,/, $(subst -,_,$(BLDDIR)))
   1666 BORLAND_BLDDIR	= 	$(BLDDIR)
   1667 BORLAND_BOBJS	= 	$(addprefix ${BORLAND_BLDDIR}/,${BORLAND_LOBJS})
   1668 # }
   1669 endif
   1670 
   1671 #
   1672 # Rule to create object file (build) directory
   1673 #
   1674 
   1675 .PHONY: all install clean distclean
   1676 
   1677 .PRECIOUS: ${BLDDIR}/.tree
   1678 
   1679 %/.tree:
   1680 	@$(ECHO) Creating build directory $(dir $@)
   1681 	$Q($(MKDIR) $(dir $@); $(TOUCH) $@)
   1682 
   1683 # Rule allowing build through CPP only, creates .E file from .c file.
   1684 
   1685 %.E: %.c
   1686 	$Q$(CC) -E ${CFLAGS} $< | $(SED) -e '/^ *$$/d' -e p -e d > $@
   1687 
   1688 # Rule allowing build through source only, creates .s file from .c file.
   1689 
   1690 %.s: %.c
   1691 	$Q$(CC) -S ${CFLAGS} $<
   1692 
   1693 # allow disabling of dependency file generation
   1694 # enable partial recompilation through use of included
   1695 # dependency make files
   1696 #
   1697 ifndef NO_SDK_DEPS
   1698 # {
   1699 # take the compiler generated .d file and reparse it 
   1700 # to generate a dependency graph rule for this object
   1701 # file
   1702 # the two steps generate:
   1703 #  file.o: file.c \
   1704 #	file.h ...
   1705 #
   1706 #  file.h: 
   1707 #  header.h: 
   1708 # some compilers will generate errors without the latter
   1709 # part of the list
   1710 
   1711 .PHONY: .phony
   1712 
   1713 DEPS_SED = \
   1714 	$(CP) $(BLDDIR)/$*.d $(BLDDIR)/$*.tmp;\
   1715 	$(ECHO) >> $(BLDDIR)/$*.tmp;\
   1716 	$(SED) -e 's/\#.*//' -e 's/^[^:]*: *//' \
   1717 	-e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' \
   1718 	-e '/^ .$$/d' \
   1719 	< $(BLDDIR)/$*.d >> $(BLDDIR)/$*.tmp; \
   1720 	$(SED) -e 's|^\([^\/ ].*\.o\):|'$(BLDDIR)/'\1:|g'  \
   1721 	-e 's|.*?/\(.*\.o\):|'$(BLDDIR)/'\1:|g'  \
   1722 	< $(BLDDIR)/$*.tmp > $(BLDDIR)/$*.P; \
   1723 	$(RM) -f $(BLDDIR)/$*.d $(BLDDIR)/$*.tmp
   1724 DEPS_CMD = $(DEPS_SED)
   1725 
   1726 ifeq ($(targetbase),ghs)
   1727 # {
   1728 DEPS_CMD = $(DEPS_SED)
   1729 # }
   1730 else
   1731 # {
   1732 ifeq ($(VX_VERSION),55)
   1733 # {
   1734 # this supports the tornado 2.x.x compiler
   1735 # (VxWorks 5.x)
   1736 DEPS_CMD = $(DEPS_SED)
   1737 # }
   1738 else
   1739 # {
   1740 ifneq ($(findstring gnu,$(TOOL)),)
   1741 # {
   1742 # Gnu compilers always support -MD -MF
   1743 DEPS_OPT = -MD -MF $(BLDDIR)/$*.d
   1744 DEPS_CMD = $(DEPS_SED)
   1745 # }
   1746 else
   1747 # {
   1748 ifneq (,$(filter 64 65,$(VX_VERSION)))
   1749 # {
   1750 BCM_CFLAGS = -Xstop-on-warning -Xlint
   1751 DEPS_OPT = -Xmake-dependency=4 -Xmake-dependency-savefile=$(BLDDIR)/$*.d
   1752 DEPS_CMD = $(DEPS_SED)
   1753 # }
   1754 else
   1755 # {
   1756 ifneq ($(findstring i686,$(CROSS_COMPILE)),)
   1757 # {
   1758 # Gcc 2.95 does not support -MD -MF with -o and -c
   1759 # }
   1760 else
   1761 # {
   1762 # newer gnu-based compilers allow -MD -MF
   1763 DEPS_OPT = -MD -MF $(BLDDIR)/$*.d
   1764 DEPS_CMD = $(DEPS_SED)
   1765 # }
   1766 endif
   1767 # }
   1768 endif
   1769 # }
   1770 endif
   1771 # }
   1772 endif
   1773 # }
   1774 endif
   1775 
   1776 # From gmsl
   1777 
   1778 # Standard definitions for true and false.  true is any non-empty
   1779 # string, false is an empty string. These are intended for use with
   1780 # $(if).
   1781 
   1782 true  := T
   1783 false :=
   1784 
   1785 # ----------------------------------------------------------------------------
   1786 # Function:  not
   1787 # Arguments: 1: A boolean value
   1788 # Returns:   Returns the opposite of the arg. (true -> false, false -> true)
   1789 # ----------------------------------------------------------------------------
   1790 not = $(if $1,$(false),$(true))
   1791 
   1792 # ----------------------------------------------------------------------------
   1793 # Function:  map
   1794 # Arguments: 1: Name of function to $(call) for each element of list
   1795 #            2: List to iterate over calling the function in 1
   1796 # Returns:   The list after calling the function on each element
   1797 # ----------------------------------------------------------------------------
   1798 map = $(strip $(foreach a,$2,$(call $1,$a)))
   1799 
   1800 # ----------------------------------------------------------------------------
   1801 # Function:  seq
   1802 # Arguments: 1: A string to compare against...
   1803 #            2: ...this string
   1804 # Returns:   Returns $(true) if the two strings are identical
   1805 # ----------------------------------------------------------------------------
   1806 seq = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),$(false),$(true))
   1807 
   1808 # ----------------------------------------------------------------------------
   1809 # Function:  sne
   1810 # Arguments: 1: A string to compare against...
   1811 #            2: ...this string
   1812 # Returns:   Returns $(true) if the two strings are not the same
   1813 # ----------------------------------------------------------------------------
   1814 sne = $(call not,$(call seq,$1,$2))
   1815 
   1816 # End from gmsl
   1817 
   1818 # Define comma symbol so we can repace it with a variable
   1819 comma :=,
   1820 
   1821 # Signature
   1822 last_target :=
   1823 
   1824 dump_var = $$(eval $1 := $($1))
   1825 
   1826 define new_rule
   1827 @echo '$(call map,dump_var,@ < *)' > $S
   1828 @$(if $(wildcard $F),,touch $F)
   1829 @echo $@: $F >> $S
   1830 endef
   1831 
   1832 define do
   1833 $(eval S := $(BLDDIR)/$*.sig)$(eval F := $(BLDDIR)/$*.force)$(eval C := $1)
   1834 $(if $(call sne,$@,$(last_target)),$(call new_rule),$(eval last_target := $@))
   1835 @echo '$$(if $$(call sne,$$(sort $1),$(sort $(subst $(comma),$$(comma),$C))),$$(shell touch $F))' >> $S
   1836 $Q$C
   1837 endef
   1838 
   1839 # end of Signature
   1840 
   1841 
   1842 # }
   1843 else # ifndef NO_SDK_DEPS
   1844 # {
   1845 # No dependency files, faster compile times
   1846 # no partial compile support
   1847 DEPS_SED =
   1848 DEPS_OPT =
   1849 DEPS_CPY =
   1850 DEPS_CMD = /bin/true
   1851 
   1852 define do
   1853 $(eval C := $1)
   1854 $Q$C
   1855 endef
   1856 
   1857 # }
   1858 endif
   1859 
   1860 #
   1861 # Default Build rules for .c --> .o, leaving the binary in BLDDIR/X.o,
   1862 # even if file not built from directory of source.
   1863 #
   1864 ifeq ($(FAST),1)
   1865 # {
   1866 ${BLDDIR}/%.o: %.c
   1867 # }
   1868 else
   1869 # {
   1870 ifdef GENERATE_C_FILES
   1871 # {
   1872 ${BLDDIR}/%.o: %.c
   1873 # }
   1874 else
   1875 # {
   1876 
   1877 ${BLDDIR}/%.o: %.c
   1878 # }
   1879 endif
   1880 # }
   1881 endif
   1882 # echo Compiling needed to properly process errors 
   1883 	@$Q$(ECHO) Compiling ${LOCALDIR}/$< 
   1884 	$Q$(MKDIR) $(BLDDIR)/
   1885 	$Q$(RM) -f $@
   1886 # 55 is VERY different
   1887 ifeq ($(VX_VERSION),55)
   1888 # {
   1889 	$Q$(CC) -M $(CFLAGS) $(EXTRA_CFLAGS)  $(realpath $<) > $(BLDDIR)/$*.d && ($(DEPS_CMD))
   1890 	$(call do,$$(CC) $$(CFLAGS) $$(EXTRA_CFLAGS) -o $$@  -c $$(realpath $$<))
   1891 # }
   1892 else
   1893 # {
   1894 	$(call do,$$(CC) $$(DEPS_OPT) $$(CFLAGS) $$(EXTRA_CFLAGS) -o $$@ -c $$(realpath $$<))  && ($(DEPS_CMD))
   1895 # }
   1896 endif
   1897 
   1898 ${BLDDIR}/%.o: %.s
   1899 ifdef QUIET
   1900 # {
   1901 	@$(ECHO) Assembling ${LOCALDIR}/$<
   1902 # }
   1903 endif
   1904 	$Q$(CC) ${CFLAGS} ${EXTRA_CFLAGS} -o $@ -c $(realpath $<)
   1905 
   1906 ${BLDDIR}/%.o: %.cpp
   1907 ifdef QUIET
   1908 # {
   1909 	@$(ECHO) Compiling ${LOCALDIR}/$<
   1910 # }
   1911 endif
   1912 	$Q$(CXX) ${CXXFLAGS}  -o $@ -c $(realpath $<)
   1913 
   1914 ${BLDDIR}/%.o: %.cc ${BLDDIR}/.tree
   1915 ifdef QUIET
   1916 # {
   1917 	@$(ECHO) Compiling ${LOCALDIR}/$<
   1918 # }
   1919 endif
   1920 	$Q$(CXX) ${CXXFLAGS} -o $@ -c $(realpath $<)
   1921 
   1922 #
   1923 # Cause "make foo.o" in any subdirectory to put the object in the build
   1924 # directory instead of the local directory.
   1925 #
   1926 %.o: ${BLDDIR}/%.o
   1927 	@
   1928 
   1929 #
   1930 # Borland/NT
   1931 #
   1932 ifeq ($(TOOLS),Borland)
   1933 # {
   1934 ${BLDDIR}/%.obj: %.c
   1935 	bcc32 -D__BORLAND__ $(CFGFLAGS) \
   1936 		-I$(subst /,\,$(SDK)\include) \
   1937 		$(SYSINCLUDES) -o$@ -c $<
   1938 # }
   1939 endif
   1940 
   1941 #
   1942 # Java Support
   1943 #
   1944 JAVAC	= /bin/javac
   1945 JAVACFLAGS= -nowarn
   1946 
   1947 ${BLDDIR}/%.class: %.java
   1948 	$(JAVAC) ${JAVACFLAGS} -d ${BLDDIR} $<
   1949 
   1950 %.Z: %
   1951 	@$(ECHO) Compressing $< .....
   1952 	@$(COMPRESS) -c $< > $@
   1953 
   1954 %.gz: %
   1955 	@$(ECHO) Compressing $< .....
   1956 	@$(GZIP) -c $< > $@
   1957 
   1958 
   1959 #
   1960 # Some Basic tools
   1961 #
   1962 INSTALL = /usr/ucb/install
   1963 INSTALLFLAGS =
   1964 CTAGS   = ctags
   1965 ETAGS	= etags
   1966 
   1967 #
   1968 # List of directories where built objects live.
   1969 # (we are not making the export directories for now)
   1970 #
   1971 #DIRS =	${BLDDIR} ${EXPDIR}/lib ${EXPDIR}/bin ${EXPDIR}/include
   1972 DIRS =	${BLDDIR}
   1973 
   1974 #
   1975 # Targets for build
   1976 #
   1977 include ${SDK}/make/Make.targets
   1978 
   1979 ifeq (C_COMPILER,$(MAKECMDGOALS))
   1980 # {
   1981 C_COMPILER:
   1982 	@echo $(CC)
   1983 # }
   1984 endif
   1985 
   1986 ifeq (CXX_COMPILER,$(MAKECMDGOALS))
   1987 # {
   1988 CXX_COMPILER:
   1989 	@echo $(CXX)
   1990 # }
   1991 endif
   1992 
   1993 #
   1994 # Required for building PHYMOD library
   1995 #
   1996 ifeq (1,$(BUILD_PHYMOD))
   1997 # {
   1998 export CC
   1999 export AR
   2000 export ARFLAGS
   2001 export CROSS_COMPILE
   2002 export PHYMOD_BLDDIR = $(LIBDIR)
   2003 export PHYMOD_OBJDIR = $(BLDDIR)
   2004 export PHYMOD_EPIL_BLDDIR = $(LIBDIR)
   2005 export PHYMOD_EPIL_OBJDIR = $(BLDDIR)
   2006 export PHYMOD_CPPFLAGS = $(CFLAGS)
   2007 ifdef PHYMOD_PRE_BUILD_LIB
   2008 export PHYMOD_MAKE_RULES = $(SDK)/make/Make.phymod_prebuild
   2009 else
   2010 export PHYMOD_MAKE_RULES = $(SDK)/make/Make.phymod
   2011 endif
   2012 # }
   2013 endif
   2014 
   2015 #
   2016 # Required for building PCIEG3 library
   2017 #
   2018 ifeq (1,$(BUILD_PCIEG3))
   2019 # {
   2020 export CC
   2021 export AR
   2022 export ARFLAGS
   2023 export CROSS_COMPILE
   2024 export PCIEG3_BLDDIR = $(LIBDIR)
   2025 export PCIEG3_OBJDIR = $(BLDDIR)
   2026 export PCIEG3_CPPFLAGS = $(CFLAGS)
   2027 export PCIEG3_MAKE_RULES = $(SDK)/make/Make.pcieg3
   2028 # }
   2029 endif