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