7906127df5b68571a5a3456e5f96bbc62eaa5a7c
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 ("M4 LE opts : " + M4LE.ccOpts.prefix);\r
62 print ("A15 basic opts : " + A15LE.ccOpts.prefix);\r
63 print ("***********************************************************");\r
64 \r
65 /* Create the release package for the RM */\r
66 Pkg.defaultRelease = Pkg.addRelease (lldRTSCFileName, {prefix: "./packages/"});\r
67 \r
68 /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently\r
69 * not supported in the XDC tools being used. Currenly builds need to be done with the \r
70 * following options:-\r
71 * xdc MK_FIXLISTOPTS=-t release \r
72 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the\r
73 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */\r
74 //Pkg.attrs = {archiver : "zip"};\r
75 \r
76 /* Cycle through all the sub-directories and build all the files */\r
77 for (var i = 0; i < subDirectories.length; i++) \r
78 {\r
79 /* Load the capsule in the sub directory. */\r
80 var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");\r
81 \r
82 print ("Building directory " + subDirectories[i]);\r
83 \r
84 /* Build the capsule. */\r
85 caps.modBuild();\r
86 \r
87 /* Package the module.xs files for building via package */\r
88 Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";\r
89 }\r
90 \r
91 /* Package the remaining files */\r
92 Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";\r
93 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";\r
94 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";\r
95 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";\r
96 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";\r
97 Pkg.otherFiles[Pkg.otherFiles.length++] = "rm.h";\r
98 Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_services.h";\r
99 Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_transport.h";\r
100 Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_server_if.h";\r
101 Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_osal.h";\r
102 Pkg.otherFiles[Pkg.otherFiles.length++] = "rmver.h";\r
103 Pkg.otherFiles[Pkg.otherFiles.length++] = "rmver.h.xdt";\r
104 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";\r
105 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";\r
106 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";\r
107 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";\r
108 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile_armv7";\r
109 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/armv7/librm_aearmv7.mk";\r
110 \r
111 /* Generate Users Manual Doxyfile */\r
112 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");\r
113 tplt.genFile("./docs/Doxyfile",lldReleaseVersion); \r
114 \r
115 /* Generate Settings.xdc */\r
116 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");\r
117 tplt.genFile("./Settings.xdc",lldReleaseVersion); \r
118 \r
119 /* Check if we need to create the mini package? */\r
120 var miniBuild = java.lang.System.getenv("MINI_PACKAGE");\r
121 \r
122 if (miniBuild == "ON")\r
123 {\r
124 /***************************************************************************\r
125 ********************************* MINI Package ****************************\r
126 ***************************************************************************/\r
127 /* Create the MINI RTSC Package */\r
128 var libUtility = xdc.loadCapsule ("build/buildlib.xs");\r
129 libUtility.createMiniPkg(lldRTSCFileName);\r
130 }\r
131 \r
132 /********************************************************************* \r
133 *********************** INSTALL-JAMMER Support **********************\r
134 * In order to create the InstallJammer Application; we need to UNTAR\r
135 * the package into a temporary directory. This is required because \r
136 * currently the InstallJammer does not support the TAR Files and thus\r
137 * creating an UNTAR of the file. So to work-around the problem we will\r
138 * do the following in the EPILOGUE Section:-\r
139 * (a) Create a temporary directory called 'tmp'\r
140 * (b) UNTAR the package into 'tmp'\r
141 * (c) Run the INSTALL Jammer on 'tmp'\r
142 * (d) Remove the 'tmp' directory.\r
143 *\r
144 * This can be done only after the 'release' package has been created.\r
145 * Thus all of this work is being done in the EPILOGUE.\r
146 *********************************************************************/\r
147 if (lldInstallType == "SETUP")\r
148 {\r
149 /* Create the Install Jammer Version Variable. This is used inside the \r
150 * MPI File to create the Final executable. \r
151 * The format supported is as follows:-\r
152 * - setupwin32_rm_<part_number>_<version>.exe \r
153 * This is for RM Libraries and Header files\r
154 */\r
155 var InstallJammerVersion = "-DVersion " + lldPartNumber + "_" + lldReleaseVersion[0] + "_" +\r
156 lldReleaseVersion[1] + "_" + lldReleaseVersion[2] + "_" + lldReleaseVersion[3];\r
157 \r
158 /* This is the location where the tmp directory is located; this is used as \r
159 * the input directory for the Install Jammer. */ \r
160 var PackageBaseDir = " -DPackageBaseDir " + lldPath + "./tmp";\r
161 \r
162 /* This is the location where the RM will be installed by default. */\r
163 var WinInstallDir = " -DWinInstallDir C:/ti/rm" + "_" + \r
164 lldPartNumber + "_" + \r
165 lldReleaseVersion[0] + "_" + lldReleaseVersion[1] + "_" + \r
166 lldReleaseVersion[2] + "_" + lldReleaseVersion[3];\r
167 \r
168 /* Create the actual EPILOGUE Section for the INSTALLER */\r
169 Pkg.makeEpilogue += "release: install_application\n";\r
170 Pkg.makeEpilogue += "install_application:\n";\r
171 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";\r
172 Pkg.makeEpilogue += "\t @echo Creating the Install\n";\r
173 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";\r
174 Pkg.makeEpilogue += "\t -$(MKDIR) tmp\n";\r
175 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/packages\n";\r
176 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/eclipse\n";\r
177 Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n";\r
178 Pkg.makeEpilogue += "\t tar -xf ./packages/" + lldRTSCFileName + ".tar" + " -Ctmp/packages \n";\r
179 Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir + \r
180 " --output-dir packages/ --build install/rm.mpi\n";\r
181 Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q tmp\n\n";\r
182 }\r
183 \r
184 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */\r
185 Pkg.makeEpilogue += "clean::\n";\r
186 Pkg.makeEpilogue += "\t -$(RM) docs/Doxyfile Settings.xdc rmver.h\n";\r
187 Pkg.makeEpilogue += "\t -$(RM) makefile\n";\r
188 Pkg.makeEpilogue += "\t -$(RMDIR) docs/doxygen\n";\r
189 if (lldInstallType == "SETUP")\r
190 {\r
191 Pkg.makeEpilogue += "\t -$(RM) packages/*.exe\n";\r
192 Pkg.makeEpilogue += "\t -$(RM) packages/*.bin\n";\r
193 Pkg.makeEpilogue += "\t -$(RMDIR) eclipse\n\n";\r
194 }\r
195 if (miniBuild == "ON")\r
196 {\r
197 Pkg.makeEpilogue += "\t -$(RM) simpleC66LE.mak\n";\r
198 }\r