1 /******************************************************************************
2 * FILE PURPOSE: Build description for the PA LLD Package
3 ******************************************************************************
4 * FILE NAME: package.bld
5 *
6 * DESCRIPTION:
7 * This file contains the build specification and description for the PA LLD
8 *
9 * The file takes the following parameters from the command line through the
10 * XDCARGS variable.
11 * XDCARGS[0] = PA LLD Install Type
12 * Valid Values are "TAR" or "SETUP"
13 * DEFAULT is "SETUP"
14 *
15 * Example for a valid command:
16 * xdc XDCARGS="SETUP" release
17 *
18 * Copyright (C) 2011, Texas Instruments, Inc.
19 *****************************************************************************/
21 /* List of all subdirectories that combine to make the PA LLD Package. */
22 var subDirectories = [ "src", "docs", "fw", "example", "test" , "device"];
24 var palldInstallType;
26 /* Check if we need to create the Makefiles? */
27 var miniBuild = java.lang.System.getenv("MINI_PACKAGE");
29 /* Determine if we need to create the InstallJammer Application or not?
30 * PA LLD Deliverables be either of the following formats:
31 * - TAR Ball Package
32 * - Setup Executable
33 * DEFAULT is a SETUP Executable. */
35 if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))
36 palldInstallType = "TAR";
37 else
38 palldInstallType = arguments[0];
40 /* Irrespective of the InstallType we always create a TAR Ball Package as a part
41 * of the RTSC Build. Here we determine the name of the TAR Ball Package
42 * Format is as follows:
43 * palld_<version> */
44 var palldRTSCFileName = "palld" + "_" + palldPartNumber + "_" +
45 palldReleaseVersion[0] + "_" + palldReleaseVersion[1] + "_" +
46 palldReleaseVersion[2] + "_" + palldReleaseVersion[3];
48 /******************************************************************
49 ************************ Release Banner **************************
50 ******************************************************************/
52 print ("************* PA LLD Build Information *************");
53 print ("PA LLD Install : " + palldInstallType);
54 print ("PA LLD Version : " + palldReleaseVersion);
55 print ("C66 Tools Directory : " + c66ToolsBaseDir);
56 print ("A15 Tools Directory : " + a15ToolsBaseDir);
57 print ("RTSC File Name : " + palldRTSCFileName);
58 print ("PA LLD Path : " + palldPath);
59 print ("Coverity Analysis : " + (coverityAnalysis == "ON" ? "ON" : "OFF"));
60 if(xdcTargetType == "ARM11")
61 {
62 print ("ARM LE opts : " + TIArmv6le.ccOpts.prefix);
63 print ("ARM BE opts : " + TIArmv6be.ccOpts.prefix);
64 }
65 else
66 {
67 print ("A15 basic opts : " + A15LE.ccOpts.prefix);
68 print ("C66 LE opts : " + C66LE.ccOpts.prefix);
69 }
70 print ("***********************************************************");
72 /* Create the release package for the PA LLD */
73 Pkg.defaultRelease = Pkg.addRelease (palldRTSCFileName, {prefix: "./packages/"});
75 /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
76 * not supported in the XDC tools being used. Currenly builds need to be done with the
77 * following options:-
78 * xdc MK_FIXLISTOPTS=-t release
79 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
80 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
81 //Pkg.attrs = {archiver : "zip"};
83 /* Cycle through all the sub-directories and build all the files */
84 for (var i = 0; i < subDirectories.length; i++)
85 {
86 /* Load the capsule in the sub directory. */
87 var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");
89 print ("Building directory " + subDirectories[i]);
91 /* Build the capsule. */
92 caps.modBuild();
94 /* Package the module.xs files for building via package */
95 Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
96 }
98 /* Package the remaining files */
99 Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
100 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
101 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
102 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
103 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
104 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
105 Pkg.otherFiles[Pkg.otherFiles.length++] = "pa.h";
106 Pkg.otherFiles[Pkg.otherFiles.length++] = "pa_fc.h";
107 Pkg.otherFiles[Pkg.otherFiles.length++] = "paver.h";
108 Pkg.otherFiles[Pkg.otherFiles.length++] = "paver.h.xdt";
109 Pkg.otherFiles[Pkg.otherFiles.length++] = "pasahost.h";
110 Pkg.otherFiles[Pkg.otherFiles.length++] = "pa_osal.h";
111 Pkg.otherFiles[Pkg.otherFiles.length++] = "nss_if.h";
112 Pkg.otherFiles[Pkg.otherFiles.length++] = "nss_cfg.h";
113 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
114 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
115 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
116 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
117 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile_armv7";
118 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/armv7/libpa_aearmv7.mk";
120 /* Generate Users Manual Doxyfile */
121 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
122 tplt.genFile("./docs/Doxyfile",palldReleaseVersion);
124 /* Generate Settings.xdc */
125 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
126 tplt.genFile("./Settings.xdc",palldReleaseVersion);
128 /* Generate paver.h */
129 var tplt = xdc.loadTemplate("./paver.h.xdt");
130 tplt.genFile("./paver.h",palldReleaseVersion);
133 /*********************************************************************
134 *********************** INSTALL-JAMMER Support **********************
135 * In order to create the InstallJammer Application; we need to UNTAR
136 * the package into a temporary directory. This is required because
137 * currently the InstallJammer does not support the TAR Files and thus
138 * creating an UNTAR of the file. So to work-around the problem we will
139 * do the following in the EPILOGUE Section:-
140 * (a) Create a temporary directory called 'tmp'
141 * (b) UNTAR the package into 'tmp'
142 * (c) Run the INSTALL Jammer on 'tmp'
143 * (d) Remove the 'tmp' directory.
144 *
145 * This can be done only after the 'release' package has been created.
146 * Thus all of this work is being done in the EPILOGUE.
147 *********************************************************************/
148 if (palldInstallType == "SETUP")
149 {
150 /* Create the Install Jammer Version Variable. This is used inside the
151 * MPI File to create the Final executable.
152 * The format supported is as follows:-
153 * - setupwin32_palld-<part_number>-<version>.exe
154 */
155 var InstallJammerVersion = "-DVersion " + palldPartNumber + "_" +
156 palldReleaseVersion[0] + "_" + palldReleaseVersion[1] + "_" +
157 palldReleaseVersion[2] + "_" + palldReleaseVersion[3];
159 /* This is the location where the tmp directory is located; this is used as
160 * the input directory for the Install Jammer. */
161 var PackageBaseDir = " -DPackageBaseDir " + palldPath + "./tmp";
163 /* This is the location where the PA LLD will be installed by default. */
164 var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/palld" + "_" +
165 palldPartNumber + "_" +
166 palldReleaseVersion[0] + "_" + palldReleaseVersion[1] + "_" +
167 palldReleaseVersion[2] + "_" + palldReleaseVersion[3];
169 /* Create the actual EPILOGUE Section for the INSTALLER */
170 Pkg.makeEpilogue += "release: install_application\n";
171 Pkg.makeEpilogue += "install_application: firmware\n";
172 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";
173 Pkg.makeEpilogue += "\t @echo Creating the Install\n";
174 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";
175 Pkg.makeEpilogue += "\t -$(MKDIR) tmp\n";
176 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/packages\n";
177 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/eclipse\n";
178 Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n";
179 Pkg.makeEpilogue += "\t tar -xf ./packages/" + palldRTSCFileName + ".tar" + " -Ctmp/packages \n";
180 Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir +
181 " --output-dir packages/ --build install/palld.mpi\n";
182 Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q tmp\n\n";
184 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */
185 Pkg.makeEpilogue += "clean::\n";
186 Pkg.makeEpilogue += "\t $(RM) packages/*.exe\n";
187 Pkg.makeEpilogue += "\t $(RM) packages/*.bin\n";
188 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q eclipse\n";
189 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q tmp\n";
190 }
192 if (miniBuild == "ON")
193 {
194 /***************************************************************************
195 ********************************* MINI Package ****************************
196 ***************************************************************************/
197 /* Create the MINI RTSC Package */
198 var additionalFiles = [];
200 additionalFiles[additionalFiles.length++] = "fw/classify1_bin.c";
201 additionalFiles[additionalFiles.length++] = "fw/classify2_bin.c";
202 additionalFiles[additionalFiles.length++] = "fw/pam_bin.c";
203 additionalFiles[additionalFiles.length++] = "fw/pafw.h";
205 var libUtility = xdc.loadCapsule ("build/buildlib.xs");
206 libUtility.createMiniPkg(palldRTSCFileName, additionalFiles);
207 }