1 /******************************************************************************\r
2 * FILE PURPOSE: Build description for the PCIE 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 PCIE 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] = PCIE 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 PCIE LLD Package. */\r
22 var subDirectories = [ "src", "docs", "example" ];\r
23 \r
24 var pcielldInstallType;\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 * PCIE 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 pcielldInstallType = "TAR";\r
37 else\r
38 pcielldInstallType = 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 * pcielld_<version> */\r
44 var pcielldRTSCFileName = "pcielld" + "_" + pcielldPartNumber + "_" +\r
45 pcielldReleaseVersion[0] + "_" + pcielldReleaseVersion[1] + "_" + \r
46 pcielldReleaseVersion[2] + "_" + pcielldReleaseVersion[3];\r
47 \r
48 /******************************************************************\r
49 ************************ Release Banner **************************\r
50 ******************************************************************/\r
51 \r
52 print ("************* PCIE LLD Build Information *************");\r
53 print ("PCIE LLD Install : " + pcielldInstallType);\r
54 print ("PCIE LLD Version : " + pcielldReleaseVersion);\r
55 print ("Tools Directory : " + toolsBaseDir);\r
56 print ("RTSC File Name : " + pcielldRTSCFileName);\r
57 print ("PCIE LLD Path : " + pcielldPath);\r
58 print ("Coverity Analysis : " + (coverityAnalysis == "ON" ? "ON" : "OFF"));\r
59 print ("C66 LE opts : " + C66LE.ccOpts.prefix);\r
60 print ("C66 BE opts : " + C66BE.ccOpts.prefix);\r
61 print ("***********************************************************");\r
62 \r
63 /* Create the release package for the PCIE LLD */\r
64 Pkg.defaultRelease = Pkg.addRelease (pcielldRTSCFileName, {prefix: "./packages/"});\r
65 \r
66 /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently\r
67 * not supported in the XDC tools being used. Currenly builds need to be done with the \r
68 * following options:-\r
69 * xdc MK_FIXLISTOPTS=-t release \r
70 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the\r
71 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */\r
72 //Pkg.attrs = {archiver : "zip"};\r
73 \r
74 /* Cycle through all the sub-directories and build all the files */\r
75 for (var i = 0; i < subDirectories.length; i++) \r
76 {\r
77 /* Load the capsule in the sub directory. */\r
78 var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");\r
79 \r
80 print ("Building directory " + subDirectories[i]);\r
81 \r
82 /* Build the capsule. */\r
83 caps.modBuild();\r
84 \r
85 /* Package the module.xs files for building via package */\r
86 Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";\r
87 }\r
88 \r
89 /* Package the remaining files */\r
90 Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";\r
91 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";\r
92 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";\r
93 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";\r
94 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";\r
95 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";\r
96 Pkg.otherFiles[Pkg.otherFiles.length++] = "pcie.h";\r
97 Pkg.otherFiles[Pkg.otherFiles.length++] = "pciever.h";\r
98 Pkg.otherFiles[Pkg.otherFiles.length++] = "pciever.h.xdt";\r
99 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";\r
100 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";\r
101 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";\r
102 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";\r
103 \r
104 /* Generate Users Manual Doxyfile */\r
105 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");\r
106 tplt.genFile("./docs/Doxyfile",pcielldReleaseVersion); \r
107 \r
108 /* Generate Settings.xdc */\r
109 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");\r
110 tplt.genFile("./Settings.xdc",pcielldReleaseVersion); \r
111 \r
112 /* Generate paver.h */\r
113 var tplt = xdc.loadTemplate("./pciever.h.xdt");\r
114 tplt.genFile("./pciever.h",pcielldReleaseVersion); \r
115 \r
116 /********************************************************************* \r
117 *********************** INSTALL-JAMMER Support **********************\r
118 * In order to create the InstallJammer Application; we need to UNTAR\r
119 * the package into a temporary directory. This is required because \r
120 * currently the InstallJammer does not support the TAR Files and thus\r
121 * creating an UNTAR of the file. So to work-around the problem we will\r
122 * do the following in the EPILOGUE Section:-\r
123 * (a) Create a temporary directory called 'tmp'\r
124 * (b) UNTAR the package into 'tmp'\r
125 * (c) Run the INSTALL Jammer on 'tmp'\r
126 * (d) Remove the 'tmp' directory.\r
127 *\r
128 * This can be done only after the 'release' package has been created.\r
129 * Thus all of this work is being done in the EPILOGUE.\r
130 *********************************************************************/\r
131 if (pcielldInstallType == "SETUP")\r
132 {\r
133 /* Create the Install Jammer Version Variable. This is used inside the \r
134 * MPI File to create the Final executable. \r
135 * The format supported is as follows:-\r
136 * - setupwin32_pcielld-<part_number>-<version>.exe \r
137 */\r
138 var InstallJammerVersion = "-DVersion " + pcielldPartNumber + "_" + \r
139 pcielldReleaseVersion[0] + "_" + pcielldReleaseVersion[1] + "_" + \r
140 pcielldReleaseVersion[2] + "_" + pcielldReleaseVersion[3];\r
141 \r
142 /* This is the location where the tmp directory is located; this is used as \r
143 * the input directory for the Install Jammer. */ \r
144 var PackageBaseDir = " -DPackageBaseDir " + pcielldPath + "./tmp";\r
145 \r
146 /* This is the location where the PCIE LLD will be installed by default. */\r
147 var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/pcielld" + "_" + \r
148 pcielldPartNumber + "_" + \r
149 pcielldReleaseVersion[0] + "_" + pcielldReleaseVersion[1] + "_" + \r
150 pcielldReleaseVersion[2] + "_" + pcielldReleaseVersion[3]; \r
151 \r
152 /* Create the actual EPILOGUE Section for the INSTALLER */\r
153 Pkg.makeEpilogue += "release: install_application\n";\r
154 Pkg.makeEpilogue += "install_application: firmware\n";\r
155 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";\r
156 Pkg.makeEpilogue += "\t @echo Creating the Install\n";\r
157 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";\r
158 Pkg.makeEpilogue += "\t -$(MKDIR) tmp\n";\r
159 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/packages\n";\r
160 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/eclipse\n";\r
161 Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n";\r
162 Pkg.makeEpilogue += "\t tar -xf ./packages/" + pcielldRTSCFileName + ".tar" + " -Ctmp/packages \n";\r
163 Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir + \r
164 " --output-dir packages/ --build install/pcielld.mpi\n";\r
165 Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q tmp\n\n";\r
166 \r
167 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */\r
168 Pkg.makeEpilogue += "clean::\n";\r
169 Pkg.makeEpilogue += "\t $(RM) packages/*.exe\n";\r
170 Pkg.makeEpilogue += "\t $(RM) packages/*.bin\n";\r
171 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q eclipse\n";\r
172 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q tmp\n";\r
173 }\r
174 \r
175 if (miniBuild == "ON")\r
176 {\r
177 /***************************************************************************\r
178 ********************************* MINI Package ****************************\r
179 ***************************************************************************/\r
180 /* Create the MINI RTSC Package */\r
181 var additionalFiles = [];\r
182 \r
183 var libUtility = xdc.loadCapsule ("build/buildlib.xs");\r
184 libUtility.createMiniPkg(pcielldRTSCFileName, additionalFiles);\r
185 }\r
186 \r
187 \r