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