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_server_if.h";\r
98 Pkg.otherFiles[Pkg.otherFiles.length++] = "rm_osal.h";\r
99 Pkg.otherFiles[Pkg.otherFiles.length++] = "rmver.h";\r
100 Pkg.otherFiles[Pkg.otherFiles.length++] = "rmver.h.xdt";\r
101 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";\r
102 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";\r
103 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";\r
104 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";\r
105 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile_armv7";\r
106 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/armv7/librm_aearmv7.mk";\r
107 \r
108 /* Generate Users Manual Doxyfile */\r
109 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");\r
110 tplt.genFile("./docs/Doxyfile",lldReleaseVersion); \r
111 \r
112 /* Generate Settings.xdc */\r
113 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");\r
114 tplt.genFile("./Settings.xdc",lldReleaseVersion); \r
115 \r
116 /* Check if we need to create the mini package? */\r
117 var miniBuild = java.lang.System.getenv("MINI_PACKAGE");\r
118 \r
119 if (miniBuild == "ON")\r
120 {\r
121 /***************************************************************************\r
122 ********************************* MINI Package ****************************\r
123 ***************************************************************************/\r
124 /* Create the MINI RTSC Package */\r
125 var libUtility = xdc.loadCapsule ("build/buildlib.xs");\r
126 libUtility.createMiniPkg(lldRTSCFileName);\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 (lldInstallType == "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_rm_<part_number>_<version>.exe \r
150 * This is for RM Libraries and Header files\r
151 */\r
152 var InstallJammerVersion = "-DVersion " + lldPartNumber + "_" + lldReleaseVersion[0] + "_" +\r
153 lldReleaseVersion[1] + "_" + lldReleaseVersion[2] + "_" + lldReleaseVersion[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 " + lldPath + "./tmp";\r
158 \r
159 /* This is the location where the RM will be installed by default. */\r
160 var WinInstallDir = " -DWinInstallDir C:/ti/rm" + "_" + \r
161 lldPartNumber + "_" + \r
162 lldReleaseVersion[0] + "_" + lldReleaseVersion[1] + "_" + \r
163 lldReleaseVersion[2] + "_" + lldReleaseVersion[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:\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/" + lldRTSCFileName + ".tar" + " -Ctmp/packages \n";\r
176 Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir + \r
177 " --output-dir packages/ --build install/rm.mpi\n";\r
178 Pkg.makeEpilogue += "\t -$(RMDIR) tmp\n\n";\r
179 }\r
180 \r
181 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */\r
182 Pkg.makeEpilogue += "clean::\n";\r
183 Pkg.makeEpilogue += "\t -$(RM) docs/Doxyfile Settings.xdc rmver.h\n";\r
184 Pkg.makeEpilogue += "\t -$(RM) makefile\n";\r
185 Pkg.makeEpilogue += "\t -$(RMDIR) docs/doxygen\n";\r
186 if (lldInstallType == "SETUP")\r
187 {\r
188 Pkg.makeEpilogue += "\t -$(RM) packages/*.exe\n";\r
189 Pkg.makeEpilogue += "\t -$(RM) packages/*.bin\n";\r
190 Pkg.makeEpilogue += "\t -$(RMDIR) eclipse\n\n";\r
191 }\r
192 if (miniBuild == "ON")\r
193 {\r
194 Pkg.makeEpilogue += "\t -$(RM) simpleC66LE.mak\n";\r
195 Pkg.makeEpilogue += "\t -$(RM) simpleC66BE.mak\n";\r
196 }\r