]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/tcp3d-lld.git/blob - package.bld
MCSDK 3.0: workaround to fix compilation issue for device specific CSL
[keystone-rtos/tcp3d-lld.git] / package.bld
1 /******************************************************************************\r
2  * FILE PURPOSE: Build description for the TCP3D Driver\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 TCP3D driver\r
8  *  \r
9  *  The file takes the following parameters from the command line through the\r
10  *  XDCARGS variable.\r
11  *      XDCARGS[0] = TCP3D Driver Install Type \r
12  *      Valid Values are "TAR" or "SETUP"\r
13  *      DEFAULT is "TAR"\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 TCP3D Driver Package. */\r
22 var subDirectories = [ "src", "docs", "example", "test" ];\r
23 \r
24 /* Determine if we need to create the InstallJammer Application or not? \r
25  * TCP3D Driver deliverables be either of the following formats:\r
26  *  - TAR Ball Package\r
27  *  - Setup Executable \r
28  * DEFAULT is a TAR package. */\r
29 if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))\r
30     tcp3dDriverInstallType = Pkg.attrs.archiver;\r
31 else\r
32     tcp3dDriverInstallType = arguments[0];\r
33 \r
34 /* Irrespective of the InstallType we always create a TAR Ball Package as a part\r
35  * of the RTSC Build. Here we determine the name of the TAR Ball Package\r
36  *  Format is as follows:\r
37  *      tcp3d_<version> */\r
38 var tcp3dRTSCFileName = "tcp3d" + "_" +\r
39                         tcp3dPartNumber + "_" + \r
40                         tcp3dDriverReleaseVersion[0] + "_" +\r
41                         tcp3dDriverReleaseVersion[1] + "_" + \r
42                         tcp3dDriverReleaseVersion[2] + "_" +\r
43                         tcp3dDriverReleaseVersion[3];\r
44 \r
45 /******************************************************************\r
46  ************************ Release Banner **************************\r
47  ******************************************************************/\r
48 \r
49 print ("************* TCP3D Driver Build Information *************");\r
50 print ("TCP3D Driver Install            : " + tcp3dDriverInstallType);\r
51 print ("TCP3D Driver Version            : " + tcp3dDriverReleaseVersion);\r
52 print ("Tools Directory                 : " + toolsBaseDir);\r
53 print ("RTSC File Name                  : " + tcp3dRTSCFileName);\r
54 print ("TCP3D Driver Path               : " + tcp3dDriverPath);\r
55 print ("Coverity Analysis               : " + (coverityAnalysis == "ON" ? "ON" : "OFF"));\r
56 print ("CC LE opts                      : " + C66LE.ccOpts.prefix);\r
57 print ("CC BE opts                      : " + C66BE.ccOpts.prefix);\r
58 print ("**********************************************************");\r
59 \r
60 /* Create the release package for the TCP3D Driver */\r
61 Pkg.defaultRelease = Pkg.addRelease (tcp3dRTSCFileName, {prefix: "./packages/"});\r
62 \r
63 /* Cycle through all the sub-directories and build all the files */\r
64 for (var i = 0; i < subDirectories.length; i++) \r
65 {\r
66     /* Load the capsule in the sub directory. */\r
67     var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");\r
68 \r
69     print ("Building directory " + subDirectories[i]);\r
70 \r
71     /* Build the capsule. */\r
72     caps.modBuild();\r
73 \r
74     /* Package the module.xs files for building via package */\r
75     Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";\r
76 }\r
77 \r
78 /* Package the remaining files */\r
79 Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";\r
80 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";\r
81 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";\r
82 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";\r
83 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";\r
84 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";\r
85 Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3d_drv.h";\r
86 Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3d_osal.h";\r
87 Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3d_drv_types.h";\r
88 Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3dver.h";\r
89 Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3dver.h.xdt";\r
90 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/TCP3D_DRV_doxconfig";\r
91 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/TCP3D_DRV_doxconfig.xdt";\r
92 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";\r
93 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";\r
94 \r
95 /* Generate Users Manual Doxyfile */\r
96 var tplt = xdc.loadTemplate("./docs/TCP3D_DRV_doxconfig.xdt");\r
97 tplt.genFile("./docs/TCP3D_DRV_doxconfig",tcp3dDriverReleaseVersion); \r
98 \r
99 /* Generate Settings.xdc */\r
100 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");\r
101 tplt.genFile("./Settings.xdc",tcp3dDriverReleaseVersion); \r
102 \r
103 /* Generate paver.h */\r
104 var tplt = xdc.loadTemplate("./tcp3dver.h.xdt");\r
105 tplt.genFile("./tcp3dver.h",tcp3dDriverReleaseVersion);      \r
106 \r
107 /* Generate eclipse sample file */\r
108 var tplt = xdc.loadTemplate("./docs/eclipse/sample.xml.xdt");\r
109 tplt.genFile("./docs/eclipse/sample.xml",tcp3dDriverReleaseVersion); \r
110 \r
111 \r
112 /***************************************************************************\r
113  ********************************* MINI Package ****************************\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     /* Create the MINI RTSC Package */\r
121     var additionalFiles = [];\r
122 \r
123     var libUtility = xdc.loadCapsule ("build/buildlib.xs");\r
124     libUtility.createMiniPkg(tcp3dRTSCFileName, additionalFiles);\r
125 }\r
126 \r
127 /********************************************************************* \r
128  *********************** INSTALL-JAMMER Support **********************\r
129  * In order to create the InstallJammer Application; we need to UNTAR\r
130  * the package into a temporary directory. This is required because \r
131  * currently the InstallJammer does not support the TAR Files and thus\r
132  * creating an UNTAR of the file. So to work-around the problem we will\r
133  * do the following in the EPILOGUE Section:-\r
134  *  (a) Create a temporary directory called 'tmp'\r
135  *  (b) UNTAR the package into 'tmp'\r
136  *  (c) Run the INSTALL Jammer on 'tmp'\r
137  *  (d) Remove the 'tmp' directory.\r
138  *\r
139  * This can be done only after the 'release' package has been created.\r
140  * Thus all of this work is being done in the EPILOGUE.\r
141  *********************************************************************/\r
142 if (tcp3dDriverInstallType == "SETUP")\r
143 {\r
144     /* Create the Install Jammer Version Variable. This is used inside the \r
145      * MPI File to create the Final executable. \r
146      *  The format supported is as follows:-\r
147      *   - setupwin32_tcp3d_<device>_<version>.exe \r
148      */\r
149     var InstallJammerVersion =  "-DVersion " +\r
150                                 tcp3dPartNumber + "_" + \r
151                                 tcp3dDriverReleaseVersion[0] + "_" +\r
152                                 tcp3dDriverReleaseVersion[1] + "_" +  \r
153                                 tcp3dDriverReleaseVersion[2] + "_" +\r
154                                 tcp3dDriverReleaseVersion[3];\r
155 \r
156     /* This is the location where the tmp directory is located; this is used as \r
157      * the input directory for the Install Jammer. */ \r
158     var PackageBaseDir = " -DPackageBaseDir " + tcp3dDriverPath + "./tmp";\r
159 \r
160     /* This is the location where the TCP3D Driver will be installed by default. */\r
161     var WinInstallDir = " -DWinInstallDir " + \r
162                         "C:/ti/tcp3d" + "_" + \r
163                         tcp3dPartNumber + "_" + \r
164                         tcp3dDriverReleaseVersion[0] + "_" +\r
165                         tcp3dDriverReleaseVersion[1] + "_" +  \r
166                         tcp3dDriverReleaseVersion[2] + "_" +\r
167                         tcp3dDriverReleaseVersion[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/" + tcp3dRTSCFileName + ".tar" + " -Ctmp/packages \n";\r
180     Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir + \r
181                         " --output-dir packages/ --build install/tcp3d.mpi\n";\r
182     Pkg.makeEpilogue += "\t -$(RMDIR) 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) .xdcenv.mak\n";\r
188 Pkg.makeEpilogue += "\t -$(RM) tcp3dver.h\n";\r
189 Pkg.makeEpilogue += "\t -$(RM) Settings.xdc\n";\r
190 Pkg.makeEpilogue += "\t -$(RM) makefile\n";\r
191 Pkg.makeEpilogue += "\t -$(RM) docs/TCP3D_DRV_APIIF.chm\n";\r
192 Pkg.makeEpilogue += "\t -$(RM) docs/TCP3D_DRV_doxconfig\n";\r
193 Pkg.makeEpilogue += "\t -$(RM) docs/eclipse/sample.xml\n";\r
194 Pkg.makeEpilogue += "\t -$(RMDIR) docs/doxy/rtf\n";\r
195 Pkg.makeEpilogue += "\t -$(RMDIR) docs/doxy/html\n";\r
196 Pkg.makeEpilogue += "\t -$(RMDIR) lib\n";\r
197 // for (var i = 0; i < devices.length; i++)\r
198 // {\r
199     // Pkg.makeEpilogue += "\t -$(RMDIR) lib/" + devices[i].split("/")[0] + "\n";\r
200 // }\r
201 if (tcp3dDriverInstallType == "SETUP")\r
202 {\r
203     Pkg.makeEpilogue += "\t -$(RM) packages/*.exe\n";\r
204     Pkg.makeEpilogue += "\t -$(RM) packages/*.bin\n";\r
205     Pkg.makeEpilogue += "\t -$(RMDIR) eclipse\n";\r
206     Pkg.makeEpilogue += "\t -$(RMDIR) tmp\n";\r
207 }\r
208 if (miniBuild == "ON")\r
209 {\r
210     Pkg.makeEpilogue += "\t -$(RM) simpleC66LE.mak\n";\r
211     Pkg.makeEpilogue += "\t -$(RM) simpleC66BE.mak\n";\r
212 }\r