1 /******************************************************************************\r
2 * FILE PURPOSE: Build configuration Script for the AIF2 Driver\r
3 ******************************************************************************\r
4 * FILE NAME: config.bld\r
5 *\r
6 * DESCRIPTION: \r
7 * This file contains the build configuration script for the AIF2 driver\r
8 * and is responsible for configuration of the paths for the various \r
9 * tools required to build the driver.\r
10 *\r
11 * Copyright (C) 2009, Texas Instruments, Inc.\r
12 *****************************************************************************/\r
13 var Build = xdc.useModule('xdc.bld.BuildEnvironment');\r
14 print (Build.hostOSName);\r
15 \r
16 \r
17 /* Get the Tools Base directory from the Environment Variable. */\r
18 var toolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");\r
19 /* Get the extended debug flags for C66x, \r
20 * did not change the name for backwards compatibilty */\r
21 var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS");\r
22 \r
23 \r
24 /* Get the base directory for the AIF2 Socket Driver Package */\r
25 var aif2DriverPath = new java.io.File(".//").getPath();\r
26 \r
27 /* Read the part number from the environment variable. */\r
28 var aif2LLDPartNumber = "KeyStone1";\r
29 \r
30 /* Configure the AIF2 Socket Release Version Information */\r
31 var aif2DriverReleaseVersion = [01,02,00,00];\r
32 \r
33 var pkgName = Pkg.name;\r
34 \r
35 var tiCcopts = "-g -mn -o3 --verbose_diagnostics --display_error_number --diag_error=225 -k --diag_error=9 --diag_warning=179 --diag_remark=880 --diag_remark=188 --mem_model:data=far"; \r
36 /* var tiCcopts = "-g --verbose_diagnostics --display_error_number --diag_error=225 -k --diag_error=9 --diag_warning=179 --diag_remark=880 --diag_remark=188 --mem_model:data=far";*/\r
37 var tiDefs = " ";\r
38 var tiIncs = " " ;\r
39 \r
40 \r
41 /* C66 ELF compiler configuration for Little Endian Mode. */\r
42 var C66LE = xdc.useModule('ti.targets.elf.C66');\r
43 C66LE.rootDir = toolsBaseDir;\r
44 C66LE.ccOpts.prefix = tiCcopts;\r
45 if(extDbgFlags) \r
46 C66LE.ccOpts.prefix = C66LE.ccOpts.prefix + " " + extDbgFlags; \r
47 \r
48 /* Check if we need to run the STATIC Analysis or not? */\r
49 var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");\r
50 \r
51 /* Setup the Coverity Filters to perform Static Analysis. */\r
52 if (coverityAnalysis == "ON") {\r
53 var coverityInstallPath = java.lang.System.getenv("STATIC_ANALYZE_PATH");\r
54 var cfgBase = xdc.getPackageBase("tisb.coverity.filters") + "cfg";\r
55 \r
56 var coverityFilter = [\r
57 {\r
58 moduleName: "tisb.coverity.filters.Coverity",\r
59 params: {\r
60 cfgDir: cfgBase, // The Coverity configuration file directory\r
61 rootDir: coverityInstallPath,\r
62 outDir: xdc.csd() + "cov_out",\r
63 analyzeLibs: true\r
64 }\r
65 },\r
66 ];\r
67 \r
68 /* Run the coverity filters on the LE Build only. */\r
69 C66LE.profiles["release"].filters = coverityFilter;\r
70 }\r
71 \r
72 /* Check if we need to create the Makefiles? */\r
73 var miniBuild = java.lang.System.getenv("MINI_PACKAGE");\r
74 if (miniBuild == "ON")\r
75 {\r
76 var makeC66LEFilter = {\r
77 moduleName: "build.filter.Make",\r
78 params: {\r
79 makefileName: "simpleC66LE.mak",\r
80 }\r
81 };\r
82 C66LE.profiles["release"].filters[C66LE.profiles["release"].filters.length++] = makeC66LEFilter;\r
83 \r
84 }\r
85 \r
86 /* List all the build targets here. */\r
87 Build.targets = [ C66LE ];\r
88 \r
89 /* Grab input from XDCARGS */\r
90 var buildArguments = [];\r
91 \r
92 /* Local variable for KeyStone1 or KeyStone2 devices */\r
93 var socFamily = "KeyStone1";\r
94 \r
95 /* Construct the build arguments */\r
96 for (var tmp=0; arguments[tmp] != undefined; tmp++)\r
97 {\r
98 \r
99 /* If no arguments are provided, override for building all */\r
100 if ( ( arguments.length == 1) && (arguments[tmp].equals("./config.bld")) )\r
101 buildArguments[buildArguments.length++] = "all";\r
102 else\r
103 buildArguments[buildArguments.length++] = arguments[tmp];\r
104 }\r
105 \r
106 \r
107 if ( ( buildArguments.indexOf("k2h") != -1 ) ||\r
108 ( buildArguments.indexOf("all") != -1 ) ) \r
109 {\r
110 tiCcopts = tiCcopts + " -DK2 -DSOC_K2H ";\r
111 aif2LLDPartNumber = "K2";\r
112 C66LE.ccOpts.prefix = tiCcopts;\r
113 }\r
114 \r
115 else if ( ( buildArguments.indexOf("k2k") != -1 ) ||\r
116 ( buildArguments.indexOf("all") != -1 ) ) \r
117 {\r
118 tiCcopts = tiCcopts + " -DK2 -DSOC_K2K ";\r
119 aif2LLDPartNumber = "K2";\r
120 C66LE.ccOpts.prefix = tiCcopts;\r
121 }\r