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