-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMake.config
1071 lines (907 loc) · 26.5 KB
/
Make.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# $Id: Make.config 1.305.2.16 Broadcom SDK $
# $Copyright: Copyright 2011 Broadcom Corporation.
# This program is the proprietary software of Broadcom Corporation
# and/or its licensors, and may only be used, duplicated, modified
# or distributed pursuant to the terms and conditions of a separate,
# written license agreement executed between you and Broadcom
# (an "Authorized License"). Except as set forth in an Authorized
# License, Broadcom grants no license (express or implied), right
# to use, or waiver of any kind with respect to the Software, and
# Broadcom expressly reserves all rights in and to the Software
# and all intellectual property rights therein. IF YOU HAVE
# NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE
# IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
# ALL USE OF THE SOFTWARE.
#
# Except as expressly set forth in the Authorized License,
#
# 1. This program, including its structure, sequence and organization,
# constitutes the valuable trade secrets of Broadcom, and you shall use
# all reasonable efforts to protect the confidentiality thereof,
# and to use this information only in connection with your use of
# Broadcom integrated circuit products.
#
# 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS
# PROVIDED "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
# REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
# OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
# DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
# NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
# ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
# CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING
# OUT OF USE OR PERFORMANCE OF THE SOFTWARE.
#
# 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL
# BROADCOM OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL,
# INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER
# ARISING OUT OF OR IN ANY WAY RELATING TO YOUR USE OF OR INABILITY
# TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF
# THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR USD 1.00,
# WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING
# ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.$
#
# Make command configuration for SOC driver and diags.
ALOWED_MAKE_VERSIONS :=3.81 3.82
ifeq ($(filter $(ALOWED_MAKE_VERSIONS),$(MAKE_VERSION)),)
$(error Make $(MAKE_VERSION) not supported, use one of $(ALOWED_MAKE_VERSIONS))
endif
ifeq (${BCM_HIDE_DISPATCHABLE},1)
CFGFLAGS += -DBCM_HIDE_DISPATCHABLE
endif
ifeq (${WAN_PORT_SUPPORT},1)
CFGFLAGS += -DWAN_PORT_SUPPORT
endif
#
# Set a default target if one is not set. If override-target is set,
# then the target will become override-target and a warning is printed
# if the assigned TARGET was different.
#
ifneq ($(strip $(override-target)),)
override TARGET=$(override-target)
endif
#
# If TARGET is not set, default to a Unix target based on host type
#
ifndef TARGET
uname := $(shell uname -s)
ifeq ($(uname),Linux)
ifeq ($(shell uname -m),x86_64)
TARGET=unix-linux-64
else
TARGET=unix-linux
endif
endif
ifeq ($(uname),SunOS)
TARGET=unix-solaris
endif
ifeq ($(uname),NetBSD)
TARGET=unix-netbsd
endif
ifndef TARGET
$(error Cannot determine TARGET in Make.config, uname = $(uname))
endif
endif
export TARGET
#
# Set up the target name, and the target base variables.
#
# target = The full name of the target such as vxworks-bmw
# targetbase = 1st part of target (e.g. vxworks)
# targetplat = 2nd part of target (e.g. x86) if any; otherwise same as 1st
#
target = ${TARGET}
targetsplt = $(subst -, , ${target}) # change hyphens to spaces
targetbase = $(word 1,${targetsplt})
targetplat = $(subst ${targetbase}-,,${TARGET})
#targetplat = $(lastword ,${targetsplt})
#
# Common configuration for all platforms
# (Additional platform-dependent configurations are in Makefile.xxx)
#
#
# THIS FILE SHOULD NOT BE MODIFIED LOCALLY, to override, add a file
# $SDK/make/Make.local that sets your local settings, and/or provide
# a path to your settings using the MAKE_LOCAL variable. If
# either of these files exists, their values will override those in this makefile.
#
ifdef MAKE_LOCAL
-include ${MAKE_LOCAL}
endif
-include ${SDK}/make/Make.local
# Make sure some chip is supported
SBX_CHIP_NAMES = BCM_FE2000_A0 BCM_QE2000_A0 BCM_BME3200_A0 BCM_BME3200_B0 \
BCM_BM9600_A0 BCM_88230_A0 BCM_88230_B0 BCM_88230_C0 BCM_BM9600_B0
EA_CHIP_NAMES = BCM_TK371X_A0
ROBO_CHIP_NAMES = BCM_5324_A0 BCM_5396_A0 BCM_5389_A0 BCM_5398_A0 BCM_5324_A1 \
BCM_5348_A0 BCM_5397_A0 BCM_5347_A0 BCM_5395_A0 BCM_53242_A0 BCM_53262_A0 \
BCM_53115_A0 BCM_53118_A0 BCM_53280_A0 BCM_53280_B0 BCM_53101_A0 BCM_53125_A0 \
BCM_53128_A0 BCM_53600_A0
ESW_CHIP_NAMES = BCM_5650_C0 BCM_5665_A0 \
BCM_5665_B0 BCM_5670_A0 BCM_5673_A0 BCM_5674_A0 BCM_5675_A0 \
BCM_5690_A0 BCM_5695_A0 BCM_56601_A0 BCM_56602_A0 BCM_56601_B0 BCM_56602_B0 \
BCM_56601_C0 BCM_56602_C0 BCM_56504_A0 BCM_56504_B0 BCM_56314_A0 BCM_56112_A0 \
BCM_56304_B0 BCM_56102_A0 BCM_56580_A0 BCM_56700_A0 BCM_56800_A0 BCM_56218_A0 \
BCM_56514_A0 BCM_56624_A0 BCM_56680_A0 BCM_56224_A0 BCM_56224_B0 BCM_56820_A0 \
BCM_53314_A0 BCM_56725_A0 BCM_56624_B0 BCM_56680_B0 BCM_56634_A0 BCM_56634_B0 \
BCM_56524_A0 BCM_56524_B0 BCM_56685_A0 BCM_56685_B0 BCM_56334_A0 BCM_56334_B0 \
BCM_56840_A0 BCM_56840_B0 BCM_56142_A0 BCM_53324_A0 BCM_88732_A0 BCM_56440_A0
whereischip = $(origin $(chipname))
seekrob = $(foreach chipname,$(ROBO_CHIP_NAMES),$(whereischip))
seekesw = $(foreach chipname,$(ESW_CHIP_NAMES),$(whereischip))
seeksbx = $(foreach chipname,$(SBX_CHIP_NAMES),$(whereischip))
seekea = $(foreach chipname,$(EA_CHIP_NAMES),$(whereischip))
setallsbx = $(foreach chipname,$(SBX_CHIP_NAMES),$(eval export $(chipname) = 1))
setallesw = $(foreach chipname,$(ESW_CHIP_NAMES),$(eval export $(chipname) = 1))
setallrob = $(foreach chipname,$(ROBO_CHIP_NAMES),$(eval export $(chipname) = 1))
setallea = $(foreach chipname,$(EA_CHIP_NAMES),$(eval export $(chipname) = 1))
ifdef BCM_PTL_SPT
ifdef ALL_SBX_CHIPS
$(setallsbx)
export BCM_SBX_SUPPORT = 1
endif
ifdef ALL_ESW_CHIPS
$(setallesw)
export BCM_ESW_SUPPORT = 1
export BCM_ALL_CHIPS = 1
CFGFLAGS+=-DBCM_ALL_CHIPS
endif
ifdef ALL_ROBO_CHIPS
$(setallrob)
export BCM_ROBO_SUPPORT = 1
endif
ifdef ALL_EA_CHIPS
$(setallea)
export BCM_EA_SUPPORT = 1
export BCM_TK371X_SUPPORT = 1
endif
ifneq "$(findstring file,$(seekrob))" ""
ROBO_CHIPS = 1
export ROBO_CHIPS
endif
ifneq "$(findstring file,$(seekesw))" ""
ESW_CHIPS = 1
endif
ifneq "$(findstring file,$(seeksbx))" ""
SBX_CHIPS = 1
endif
ifneq "$(findstring file,$(seekea))" ""
EA_CHIPS = 1
endif
ifndef ROBO_CHIPS
ifndef ESW_CHIPS
ifndef SBX_CHIPS
ifndef EA_CHIPS
ifneq (C_COMPILER,$(MAKECMDGOALS))
$(error "BCM_PTL_SPT defined, and no valid chip names were defined")
endif
endif
endif
endif
endif
else # BCM_PTL_SPT
ifdef ALL_CHIPS
ROBO_CHIPS = 1
ESW_CHIPS = 1
SBX_CHIPS = 1
EA_CHIPS = 1
export ROBO_CHIPS
else
# BCM5836/4704 ROBO Build
ifdef ROBO_CHIPS
export ROBO_CHIPS
else
# Chekc if Keystone build,
# enable ROBO_CHIPS by default for single image target
ifdef KS_BUILD
ROBO_CHIPS = 1
export ROBO_CHIPS
EA_CHIPS = 1
export EA_CHIPS
endif
# Check if ESW support exist
ifeq ($(shell test -d $(SDK)/src/bcm/esw; echo $$?),0)
ESW_CHIPS = 1
export ESW_CHIPS
endif
endif # ROBO_CHIPS
endif # ALL_CHIPS
endif # BCM_PTL_SPT
#
# Check for incompatible reload options
#
ifneq (,$(findstring -DBCM_WARM_BOOT_SUPPORT,$(CFGFLAGS)))
ifneq (,$(findstring -DBCM_EASY_RELOAD_SUPPORT,$(CFGFLAGS)))
$(error "BCM_WARM_BOOT_SUPPORT and BCM_EASY_RELOAD_SUPPORT should not be enabled at the same time")
endif
endif
#
# By default, turn off the "changing directory" message.
#
MAKEFLAGS += --no-print-directory
#
# Use gmake by default
#
include ${SDK}/make/Make.tools
include ${SDK}/make/Makefile.${target}
# For make v3.80, eval function can't be placed inside any ifxxx-endif section
# The bug is fixed in v3.81
eval_fixed_ver := 3.81
eval_fixed := $(filter $(eval_fixed_ver),$(firstword $(sort $(MAKE_VERSION) $(eval_fixed_ver))))
# See Make.local (Make.local.template) to configure chip support
ifndef BCM_PTL_SPT
# Support all chips by default
CFGFLAGS += -DBCM_ALL_CHIPS
ifdef ROBO_CHIPS
ifeq ($(eval_fixed),$(eval_fixed_ver))
$(setallrob)
else
BCM_5324_A0 = 1
BCM_5396_A0 = 1
BCM_5389_A0 = 1
BCM_5398_A0 = 1
BCM_5324_A1 = 1
BCM_5348_A0 = 1
BCM_5397_A0 = 1
BCM_5347_A0 = 1
BCM_5395_A0 = 1
BCM_53242_A0 = 1
BCM_53262_A0 = 1
BCM_53115_A0 = 1
BCM_53118_A0 = 1
BCM_53280_A0 = 1
BCM_53280_B0 = 1
BCM_53101_A0 = 1
BCM_53125_A0 = 1
BCM_53128_A0 = 1
BCM_53600_A0 = 1
endif
endif
ifdef ESW_CHIPS
ifeq ($(eval_fixed),$(eval_fixed_ver))
$(setallesw)
else
BCM_5650_C0 = 1
BCM_5665_A0 = 1
BCM_5665_B0 = 1
BCM_5670_A0 = 1
BCM_5673_A0 = 1
BCM_5674_A0 = 1
BCM_5675_A0 = 1
BCM_5690_A0 = 1
BCM_5695_A0 = 1
BCM_56601_A0 = 1
BCM_56602_A0 = 1
BCM_56601_B0 = 1
BCM_56602_B0 = 1
BCM_56601_C0 = 1
BCM_56602_C0 = 1
BCM_56504_A0 = 1
BCM_56504_B0 = 1
BCM_56314_A0 = 1
BCM_56112_A0 = 1
BCM_56304_B0 = 1
BCM_56102_A0 = 1
BCM_56580_A0 = 1
BCM_56700_A0 = 1
BCM_56800_A0 = 1
BCM_56218_A0 = 1
BCM_56514_A0 = 1
BCM_56624_A0 = 1
BCM_56680_A0 = 1
BCM_56224_A0 = 1
BCM_56224_B0 = 1
BCM_56820_A0 = 1
BCM_53314_A0 = 1
BCM_56725_A0 = 1
BCM_56624_B0 = 1
BCM_56680_B0 = 1
BCM_56634_A0 = 1
BCM_56634_B0 = 1
BCM_56524_A0 = 1
BCM_56524_B0 = 1
BCM_56685_A0 = 1
BCM_56685_B0 = 1
BCM_56334_A0 = 1
BCM_56334_B0 = 1
BCM_56840_A0 = 1
BCM_56840_B0 = 1
BCM_56142_A0 = 1
BCM_53324_A0 = 1
BCM_56440_A0 = 1
endif
endif
ifdef SBX_CHIPS
$(setallsbx)
endif
ifdef EA_CHIPS
ifeq ($(eval_fixed),$(eval_fixed_ver))
$(setallea)
else
BCM_TK371X_A0 = 1
endif
endif
else # BCM_PTL_SPT
# Some chip or chips excluded
ifdef ROBO_CHIPS
CFGFLAGS += $(strip $(foreach chipname,$(ROBO_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
endif # ROBO_CHIPS
ifdef ESW_CHIPS
CFGFLAGS += $(strip $(foreach chipname,$(ESW_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
endif # ESW_CHIPS
ifdef SBX_CHIPS
ifndef BCM_FE2000_A0
NO_BCM_FE2000_A0 = 1
endif
CFGFLAGS += $(strip $(foreach chipname,$(SBX_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
endif # SBX_CHIPS
ifdef EA_CHIPS
CFGFLAGS += $(strip $(foreach chipname,$(EA_CHIP_NAMES), $(if $(value $(chipname)),,-DNO_$(chipname))))
endif # EA_CHIPS
endif # BCM_PTL_SPT
ifndef FEATURE_LIST
ifdef ROBO_CHIPS
ifeq "$(HOSTTYPE)" "Windows2000PC"
_ROBO_FEATURE_LIST = L3 I2C BCMX BCMX_DIAG EDITLINE TEST CINT
else
_ROBO_FEATURE_LIST = L3 I2C BCMX BCMX_DIAG EDITLINE TEST CINT
endif
endif
ifdef ESW_CHIPS
_ESW_FEATURE_LIST = L3 I2C BCMX BCMX_DIAG MEM_SCAN EDITLINE RCPU OOB_RCPU CUSTOMER \
TEST CHASSIS CINT CES PTP BFD
endif
ifdef SBX_CHIPS
_SBX_FEATURE_LIST = L3 BCMX BCMX_DIAG EDITLINE CUSTOMER TEST CHASSIS CINT
endif
ifdef EA_CHIPS
_EA_FEATURE_LIST = EDITLINE CUSTOMER TEST CINT
endif
_ALL_FEATURE_LIST = ${_ROBO_FEATURE_LIST} ${_ESW_FEATURE_LIST} \
${_SBX_FEATURE_LIST} ${_EA_FEATURE_LIST}
FEATURE_LIST = $(sort ${_ALL_FEATURE_LIST})
ifeq ($(targetbase),vxworks)
FEATURE_LIST += TELNET
FEATURE_LIST += DRIVERS
endif
# end ifndef FEATURE_LIST
endif
# Include board make rules if present
-include ${SDK}/make/Make.boards
ifdef ROBO_CHIPS
FEATURE_LIST += MSTP
endif
# If TCL is enabled then add EDITLINE
ifeq (TCL,$(findstring TCL,$(FEATURE_LIST)))
ifneq (EDITLINE,$(findstring EDITLINE,$(FEATURE_LIST)))
FEATURE_LIST += EDITLINE
endif
endif
ifdef NO_SAL_APPL
FEATURE_EXCLUDE_LIST += TCL EDITLINE I2C TELNET DRIVERS CINT
CFGFLAGS += -DNO_SAL_APPL -DNO_CTRL_C -DNO_FILEIO -DNO_MEMTUNE
endif
ifdef FEATURE_EXCLUDE_LIST
FEATURE_LIST := $(filter-out $(FEATURE_EXCLUDE_LIST), $(FEATURE_LIST))
endif
CFGFLAGS += $(foreach feature,$(FEATURE_LIST), -DINCLUDE_$(feature))
#
# Robo5324 support MDC/MDIO.
#
ifdef ROBO_CHIPS
ifndef ROBO_OLD
#CFGFLAGS += -DMDC_MDIO_SUPPORT
CFGFLAGS += -DEBBUS_BIT16
endif
endif
ifdef SBX_CHIPS
CFGFLAGS += -DCHECK_BUILD -DZDT_SIM -DSB_FAB_LOG_WITH_BCM
ifdef BCM_FE2000_A0
# Microcode options: Default microcode is G2P2; all supported
# microcodes are compiled in by default
# CFGFLAGS += -DBCM_FE2000_P2_SUPPORT=0
CFGFLAGS += -DBCM_FE2000_P3_SUPPORT=1
CFGFLAGS += -DBCM_FE2000_G2XX_SUPPORT=1
# BCM_FE2000_P2=0
BCM_FE2000_P3=1
BCM_FE2000_G2XX=1
endif
endif
ifndef DISPATCH_LIST
ifdef ROBO_CHIPS
DISPATCH_LIST = ROBO
endif
ifdef ESW_CHIPS
DISPATCH_LIST += RPC ESW
endif
ifdef SBX_CHIPS
DISPATCH_LIST += RPC SBX
ifndef NO_BCM_FE2000_A0
DISPATCH_LIST += FE2000
endif
endif
ifdef EA_CHIPS
DISPATCH_LIST += EA
DISPATCH_LIST += TK371X
endif
endif
ifdef BCM_88732_A0
DISPATCH_LIST += SHADOW
endif
CFGFLAGS += $(foreach dispatch,$(DISPATCH_LIST), -DBCM_$(dispatch)_SUPPORT)
ifneq (,$(findstring -DBCM_RPC_SUPPORT,$(CFGFLAGS)))
CFGFLAGS += -DINCLUDE_LIB_CPUDB
CFGFLAGS += -DINCLUDE_LIB_CPUTRANS
CFGFLAGS += -DINCLUDE_LIB_DISCOVER
CFGFLAGS += -DINCLUDE_LIB_STKTASK
CFGFLAGS += -DDISCOVER_APP_DATA_BOARDID
endif
ifneq (,$(findstring AEDEV,$(FEATURE_LIST)))
CFGFLAGS += -DINCLUDE_LIB_AEDEV
endif
ifneq (,$(findstring CINT,$(FEATURE_LIST)))
CFGFLAGS += -DINCLUDE_LIB_CINT
CFGFLAGS += -DCINT_CONFIG_INCLUDE_SDK_SAL=1 -DCINT_CONFIG_INCLUDE_PARSER=1 -DCINT_CONFIG_INCLUDE_CINT_LOAD=0
endif
ifndef BCM_PHY_LIST
ifndef SBX_CHIPS
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 84728
else
ifndef ESW_CHIPS
ifndef ROBO_CHIPS
BCM_PHY_LIST=5464 5482 SIMUL 8703 8705 8706 8072
endif
else
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 84728
endif
endif
endif
CFGFLAGS += $(foreach phy,$(BCM_PHY_LIST), -DINCLUDE_PHY_$(phy))
ifneq (,(findstring 54880,$(BCM_PHY_LIST)))
CFGFLAGS += -DINCLUDE_LONGREACH
endif
# use QUIET=1 to control printing of compilation lines
ifdef QUIET
Q:=@
else
Q:=
endif
#
# Suffix to add to the "target" files to allow local builds with different
# flags. Set "target_suffix" to XXX to cause the build to put built objects
# in ${target}${target_suffix}. This allows things like building a debug
# version with different flags. This may also be set in another Makefile.
#
#target_suffix :=
#
# Optional suffix to add to the build directory and output binary files
# to allow multiple builds to co-exist for various reasons.
#
#chip_suffix := -$(shell echo $(CHIP) | tr A-Z a-z)
#
# Combined suffixes
#
all_suffix = ${chip_suffix}${target_suffix}
#
# Default location to place binaries and make depend files for building
# purposes.
#
ifeq "$(HOSTTYPE)" "Windows2000PC"
BLDROOTWITHDRIVE = ${SDK}/build/${target}${all_suffix}${bldroot_suffix}
BLDROOT = ${SDK_NO_DRIVE_NAME}/build/${target}${all_suffix}${bldroot_suffix}
else # ifeq "$(HOSTTYPE)" "Windows2000PC"
ifndef SDKBUILD
SDKBUILD :=build
endif
BLDROOT = ${SDK}/${SDKBUILD}/$(if ${BLDCONFIG},${BLDCONFIG}/)${target}${all_suffix}${bldroot_suffix}
endif # ifeq "$(HOSTTYPE)" "Windows2000PC"
# This is needed because we cannot include Make.vxworks before Make.config
ifndef DEST_DIR_SUFFIX
export DEST_DIR_SUFFIX :=$(subst $(realpath $(SDK))/systems,,$(realpath $(CURDIR)/$(dir ($(firstword $(MAKEFILE_LIST))))))
ifeq ($(MAKELEVEL),0)
endif
endif
ifeq ($(DEST_DIR),)
export DEST_DIR :=${SDK}/${SDKBUILD}$(if ${BLDCONFIG},/${BLDCONFIG})$(DEST_DIR_SUFFIX)
endif
ifdef LOCALDIR
BLDDIR = ${BLDROOT}/${LOCALDIR}
ifeq "$(HOSTTYPE)" "Windows2000PC"
BLDDIRWITHDRIVE = ${BLDROOTWITHDRIVE}/${LOCALDIR}
endif
else # ifdef LOCALDIR
BLDDIR = ${BLDROOT}
ifeq "$(HOSTTYPE)" "Windows2000PC"
BLDDIRWITHDRIVE = ${BLDROOTWITHDRIVE}
endif
endif # ifdef LOCALDIR
LIBDIR = ${BLDROOT}
#
# Export directory, where build objects used by the outside world are
# placed (exported header files, libs, bins)
#
EXPDIR = ${SDK}/export/${target}${all_suffix}
#
# Standard include paths
#
INCDIR = ${SDK}/include
ifdef ROBO_CHIPS
INCDIR += -I$(SDK)/include/soc/robo -I$(SDK)/include/bcm_int/robo \
-I$(SDK)/src/soc/robo
endif
ifdef SBX_CHIPS
INCDIR += \
-I${SDK}/include/soc/sbx/g2eplib \
-I${SDK}/include/soc/sbx/g2p3 \
-I${SDK}/include/soc/sbx/fe2k_common \
-I${SDK}/include/soc/sbx/fe2k \
-I${SDK}/include/soc/sbx/fe2kxt \
-I${SDK}/include/soc/sbx/qe2k \
-I${SDK}/include/soc/sbx/qe2kep \
-I${SDK}/include/soc/sbx \
-I${SDK}/include/soc/sbx/fabric
ifdef BCM_FE2000_G2XX
INCDIR += \
-I${SDK}/include/soc/sbx/g2xx
endif
endif
# MACSEC include paths
ifneq (,$(findstring MACSEC,$(FEATURE_LIST)))
BUILD_MACSEC = 1
FEATURE_MACSEC = 1
MACSEC_BUILD_FLAG=-DBROADCOM_SAL -I${SDK} -I${SDK}/include -g -Wall -Werror -fno-strict-aliasing
MACSEC_BUILD_FLAG += ${STD_CFLAGS}
ifndef MACSEC_HOME
toast:; $(error 'The $$MACSEC_HOME environment variable is not set')
endif
INCDIR += -I${SDK} -I${MACSEC_HOME}/include -I${MACSEC_HOME}/cli -I${MACSEC_HOME}/phy/bcm54580 -I${MACSEC_HOME}/phy/bcm54380 -I${MACSEC_HOME}/phy/bcm8729 -I${MACSEC_HOME}/phy/bcm84756
CFGFLAGS += -DBROADCOM_SAL
endif
# FCMAP include paths
ifneq (,$(findstring FCMAP,$(FEATURE_LIST)))
FEATURE_FCMAP = 1
INCDIR += -I${SDK} -I${SDK}/include -I${SDK}/src/soc/phy/fcmap/include
CFGFLAGS += -DBROADCOM_SAL
endif
ifneq (,$(findstring EAV_APPL,$(FEATURE_LIST)))
BUILD_EAV_APPL = 1
endif
ifneq (,$(findstring KNET,$(FEATURE_LIST)))
BUILD_KNET = 1
endif
#
# Paths of where we install files for make install
#
# install_headers - where to install header files.
# install_lib - where to install libs
# install_bin - where to install completely linked binaries
#
install_headers = ${SDK}/export/include
install_lib = ${SDK}/export/lib/${target}
install_bin = ${SDK}/export/bin/${target}
#
# Compilation Flags
#
# Flags may be added to (see below)
#
INCFLAGS = -I${INCDIR} -I${SDK}/systems
CFLAGS += ${INCFLAGS}
CXXFLAGS += ${INCFLAGS}
CPPFLAGS += ${INCFLAGS}
#
# Debug #ifdef control
#
# Compiling out #ifdef DEBUG code saves about 1.3% on executable size.
# It is recommended to leave debug enabled when developing applications.
#
ifndef DEBUG_IFDEFS
DEBUG_IFDEFS=TRUE
endif
ifeq ($(DEBUG_IFDEFS),TRUE)
CFLAGS += -DBROADCOM_DEBUG
CXXFLAGS += -DBROADCOM_DEBUG
CPPFLAGS += -DBROADCOM_DEBUG
endif
#
# Debug symbol information control
#
ifndef DEBUG_SYMBOLS
DEBUG_SYMBOLS=TRUE
endif
ifeq ($(DEBUG_SYMBOLS),TRUE)
CFLAGS += -g
CXXFLAGS += -g
CPPFLAGS += -g
endif
ifndef BCM_88732_A0
CFGFLAGS += -DNO_BCM_88732_A0
endif
#
# If DEBUG_CFLAGS is set, add its contents to CFLAGS.
# May be useful for setting on the command line or adding to Make.local.
# Example: gmake DEBUG_CFLAGS=-save-temps system.c
#
ifneq ($(DEBUG_CFLAGS),)
CFLAGS += $(DEBUG_CFLAGS)
CXXFLAGS += $(DEBUG_CFLAGS)
CPPFLAGS += $(DEBUG_CFLAGS)
endif
#
# Optimization level
#
# Set DEBUG_OPTIMIZE to TRUE (default) to use a normal optimization
# determined by OPTFLAGS_DEFAULT in the platform Makefile.
# Set DEBUG_OPTIMIZE to FALSE to use no optimization,
# strongly recommended when using any debugger.
# Set DEBUG_OPTIMIZE to any other option string to request specific
# optimization flags (for example -O2).
#
ifndef DEBUG_OPTIMIZE
DEBUG_OPTIMIZE=TRUE
endif
ifeq ($(DEBUG_OPTIMIZE),TRUE)
OPTFLAGS += $(OPTFLAGS_DEFAULT)
else
ifneq ($(DEBUG_OPTIMIZE),FALSE)
OPTFLAGS += $(DEBUG_OPTIMIZE)
endif
endif
#
# Debug assertion control.
#
# Compiling out assert() saves about 1.1% on executable size,
# however doing so is VERY MUCH discouraged.
#
ifndef DEBUG_ASSERTS
DEBUG_ASSERTS=TRUE
endif
ifeq ($(DEBUG_ASSERTS),FALSE)
CFLAGS += -DNDEBUG
CXXFLAGS += -DNDEBUG
CPPFLAGS += -DNDEBUG
endif
#
# GCC pedantic mode.
#
ifeq ($(DEBUG_PEDANTIC),TRUE)
CFGFLAGS += -D__PEDANTIC__
CFLAGS += --pedantic
CXXFLAGS += --pedantic
endif
#
# In each directory, build a list of local sources, objects, and headers
#
LSRCS = $(wildcard *.c *.cpp *.s *.cc *.C)
LOBJS = $(addsuffix .o, $(basename ${LSRCS}))
BOBJS = $(addprefix ${BLDDIR}/,${LOBJS})
LHDRS = $(wildcard *.h *.H)
LDOTIS = $(wildcard *.i)
ifeq ($(TOOLS),Borland)
BORLAND_LOBJS = $(addsuffix .obj, $(basename ${LSRCS}))
#BORLAND_BLDDIR = $(subst, \,/, $(subst -,_,$(BLDDIR)))
BORLAND_BLDDIR = $(BLDDIR)
BORLAND_BOBJS = $(addprefix ${BORLAND_BLDDIR}/,${BORLAND_LOBJS})
endif
#
# Rule to create object file (build) directory
#
.PHONY: all install clean distclean
.PRECIOUS: ${BLDDIR}/.tree
%/.tree:
@$(ECHO) Creating build directory $(dir $@)
$Q($(MKDIR) $(dir $@); $(TOUCH) $@)
# Rule allowing build through CPP only, creates .E file from .c file.
%.E: %.c
$Q$(CC) -E ${CFLAGS} $< | $(SED) -e '/^ *$$/d' -e p -e d > $@
# Rule allowing build through source only, creates .s file from .c file.
%.s: %.c
$Q$(CC) -S ${CFLAGS} $<
# allow disabling of dependency file generation
# enable partial recompilation through use of included
# dependency make files
#
ifndef NO_SDK_DEPS
# take the compiler generated .d file and reparse it
# to generate a dependency graph rule for this object
# file
# the two steps generate:
# file.o: file.c \
# file.h ...
#
# file.h:
# header.h:
# some compilers will generate errors without the latter
# part of the list
.PHONY: .phony
DEPS_SED = \
$(CP) $(BLDDIR)/$*.d $(BLDDIR)/$*.tmp;\
$(ECHO) >> $(BLDDIR)/$*.tmp;\
$(SED) -e 's/\#.*//' -e 's/^[^:]*: *//' \
-e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' \
-e '/^ .$$/d' \
< $(BLDDIR)/$*.d >> $(BLDDIR)/$*.tmp; \
$(SED) -e 's|^\([^\/ ].*\.o\):|'$(BLDDIR)/'\1:|g' \
-e 's|.*?/\(.*\.o\):|'$(BLDDIR)/'\1:|g' \
< $(BLDDIR)/$*.tmp > $(BLDDIR)/$*.P; \
$(RM) -f $(BLDDIR)/$*.d $(BLDDIR)/$*.tmp
DEPS_CMD = $(DEPS_SED)
ifeq ($(VX_VERSION),55)
# this supports the tornado 2.x.x compiler
# (VxWorks 5.x)
DEPS_CMD = $(DEPS_SED)
else
ifneq ($(findstring gnu,$(TOOL)),)
# Gnu compilers always support -MD -MF
DEPS_OPT = -MD -MF $(BLDDIR)/$*.d
DEPS_CMD = $(DEPS_SED)
else
ifneq (,$(filter 64 65,$(VX_VERSION)))
BCM_CFLAGS = -Xstop-on-warning -Xlint
DEPS_OPT = -Xmake-dependency=4 -Xmake-dependency-savefile=$(BLDDIR)/$*.d
DEPS_CMD = $(DEPS_SED)
else
ifneq ($(findstring i686,$(CROSS_COMPILE)),)
# Gcc 2.95 does not support -MD -MF with -o and -c
else
# newer gnu-based compilers allow -MD -MF
DEPS_OPT = -MD -MF $(BLDDIR)/$*.d
DEPS_CMD = $(DEPS_SED)
endif
endif
endif
endif
# From gmsl
# Standard definitions for true and false. true is any non-empty
# string, false is an empty string. These are intended for use with
# $(if).
true := T
false :=
# ----------------------------------------------------------------------------
# Function: not
# Arguments: 1: A boolean value
# Returns: Returns the opposite of the arg. (true -> false, false -> true)
# ----------------------------------------------------------------------------
not = $(if $1,$(false),$(true))
# ----------------------------------------------------------------------------
# Function: map
# Arguments: 1: Name of function to $(call) for each element of list
# 2: List to iterate over calling the function in 1
# Returns: The list after calling the function on each element
# ----------------------------------------------------------------------------
map = $(strip $(foreach a,$2,$(call $1,$a)))
# ----------------------------------------------------------------------------
# Function: seq
# Arguments: 1: A string to compare against...
# 2: ...this string
# Returns: Returns $(true) if the two strings are identical
# ----------------------------------------------------------------------------
seq = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),$(false),$(true))
# ----------------------------------------------------------------------------
# Function: sne
# Arguments: 1: A string to compare against...
# 2: ...this string
# Returns: Returns $(true) if the two strings are not the same
# ----------------------------------------------------------------------------
sne = $(call not,$(call seq,$1,$2))
# End from gmsl
# Define comma symbol so we can repace it with a variable
comma :=,
# Signature
last_target :=
dump_var = $$(eval $1 := $($1))
define new_rule
@echo '$(call map,dump_var,@ < *)' > $S
@$(if $(wildcard $F),,touch $F)
@echo $@: $F >> $S
endef
define do
$(eval S := $(BLDDIR)/$*.sig)$(eval F := $(BLDDIR)/$*.force)$(eval C := $1)
$(if $(call sne,$@,$(last_target)),$(call new_rule),$(eval last_target := $@))
@echo '$$(if $$(call sne,$$(sort $1),$(sort $(subst $(comma),$$(comma),$C))),$$(shell touch $F))' >> $S
$Q$C
endef
# end of Signature
else # ifndef NO_SDK_DEPS
# No dependency files, faster compile times
# no partial compile support
DEPS_SED =
DEPS_OPT =
DEPS_CPY =
DEPS_CMD = /bin/true
define do
$(eval C := $1)
$Q$C
endef
endif
#
# Default Build rules for .c --> .o, leaving the binary in BLDDIR/X.o,
# even if file not built from directory of source.
#
ifeq ($(FAST),1)
${BLDDIR}/%.o: %.c
else
ifdef GENERATE_C_FILES
${BLDDIR}/%.o: %.c
else
${BLDDIR}/%.o: %.c
endif
endif
# echo Compiling needed to properly process errors
@$Q$(ECHO) Compiling ${LOCALDIR}/$<
$Q$(MKDIR) $(BLDDIR)/
$Q$(RM) -f $@
# 55 is VERY different
ifeq ($(VX_VERSION),55)
$Q$(CC) -M $(CFLAGS) $(EXTRA_CFLAGS) $(realpath $<) > $(BLDDIR)/$*.d && ($(DEPS_CMD))
$(call do,$$(CC) $$(CFLAGS) $$(EXTRA_CFLAGS) -o $$@ -c $$(realpath $$<))
else
$(call do,$$(CC) $$(DEPS_OPT) $$(CFLAGS) $$(EXTRA_CFLAGS) -o $$@ -c $$(realpath $$<)) && ($(DEPS_CMD))
endif
${BLDDIR}/%.o: %.s
ifdef QUIET
@$(ECHO) Assembling ${LOCALDIR}/$<
endif
$Q$(CC) ${CFLAGS} ${EXTRA_CFLAGS} -o $@ -c $(realpath $<)
${BLDDIR}/%.o: %.cpp
ifdef QUIET
@$(ECHO) Compiling ${LOCALDIR}/$<
endif
$Q$(CXX) ${CXXFLAGS} -o $@ -c $(realpath $<)