summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Qian2012-07-03 15:17:36 -0500
committerMartin Qian2012-07-03 15:17:36 -0500
commit38d0864e0e37beb5a42f4770b092f7bf99ca8475 (patch)
treeb156b9816c0b59c2d4c57bfadb9e2d8e656febfc /package.bld
downloadpcie-lld-38d0864e0e37beb5a42f4770b092f7bf99ca8475.tar.gz
pcie-lld-38d0864e0e37beb5a42f4770b092f7bf99ca8475.tar.xz
pcie-lld-38d0864e0e37beb5a42f4770b092f7bf99ca8475.zip
initial commit
Diffstat (limited to 'package.bld')
-rw-r--r--package.bld187
1 files changed, 187 insertions, 0 deletions
diff --git a/package.bld b/package.bld
new file mode 100644
index 0000000..9693932
--- /dev/null
+++ b/package.bld
@@ -0,0 +1,187 @@
1/******************************************************************************
2 * FILE PURPOSE: Build description for the PCIE LLD Package
3 ******************************************************************************
4 * FILE NAME: package.bld
5 *
6 * DESCRIPTION:
7 * This file contains the build specification and description for the PCIE LLD
8 *
9 * The file takes the following parameters from the command line through the
10 * XDCARGS variable.
11 * XDCARGS[0] = PCIE LLD Install Type
12 * Valid Values are "TAR" or "SETUP"
13 * DEFAULT is "SETUP"
14 *
15 * Example for a valid command:
16 * xdc XDCARGS="SETUP" release
17 *
18 * Copyright (C) 2011, Texas Instruments, Inc.
19 *****************************************************************************/
20
21/* List of all subdirectories that combine to make the PCIE LLD Package. */
22var subDirectories = [ "src", "docs", "example" ];
23
24var pcielldInstallType;
25
26/* Check if we need to create the Makefiles? */
27var miniBuild = java.lang.System.getenv("MINI_PACKAGE");
28
29/* Determine if we need to create the InstallJammer Application or not?
30 * PCIE LLD Deliverables be either of the following formats:
31 * - TAR Ball Package
32 * - Setup Executable
33 * DEFAULT is a SETUP Executable. */
34
35if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))
36 pcielldInstallType = "TAR";
37else
38 pcielldInstallType = arguments[0];
39
40/* Irrespective of the InstallType we always create a TAR Ball Package as a part
41 * of the RTSC Build. Here we determine the name of the TAR Ball Package
42 * Format is as follows:
43 * pcielld_<version> */
44var pcielldRTSCFileName = "pcielld" + "_" + pcielldPartNumber + "_" +
45 pcielldReleaseVersion[0] + "_" + pcielldReleaseVersion[1] + "_" +
46 pcielldReleaseVersion[2] + "_" + pcielldReleaseVersion[3];
47
48/******************************************************************
49 ************************ Release Banner **************************
50 ******************************************************************/
51
52print ("************* PCIE LLD Build Information *************");
53print ("PCIE LLD Install : " + pcielldInstallType);
54print ("PCIE LLD Version : " + pcielldReleaseVersion);
55print ("Tools Directory : " + toolsBaseDir);
56print ("RTSC File Name : " + pcielldRTSCFileName);
57print ("PCIE LLD Path : " + pcielldPath);
58print ("Coverity Analysis : " + (coverityAnalysis == "ON" ? "ON" : "OFF"));
59print ("C66 LE opts : " + C66LE.ccOpts.prefix);
60print ("C66 BE opts : " + C66BE.ccOpts.prefix);
61print ("***********************************************************");
62
63/* Create the release package for the PCIE LLD */
64Pkg.defaultRelease = Pkg.addRelease (pcielldRTSCFileName, {prefix: "./packages/"});
65
66/* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
67 * not supported in the XDC tools being used. Currenly builds need to be done with the
68 * following options:-
69 * xdc MK_FIXLISTOPTS=-t release
70 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
71 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
72//Pkg.attrs = {archiver : "zip"};
73
74/* Cycle through all the sub-directories and build all the files */
75for (var i = 0; i < subDirectories.length; i++)
76{
77 /* Load the capsule in the sub directory. */
78 var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");
79
80 print ("Building directory " + subDirectories[i]);
81
82 /* Build the capsule. */
83 caps.modBuild();
84
85 /* Package the module.xs files for building via package */
86 Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
87}
88
89/* Package the remaining files */
90Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
91Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
92Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
93Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
94Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
95Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
96Pkg.otherFiles[Pkg.otherFiles.length++] = "pcie.h";
97Pkg.otherFiles[Pkg.otherFiles.length++] = "pciever.h";
98Pkg.otherFiles[Pkg.otherFiles.length++] = "pciever.h.xdt";
99Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
100Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
101Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
102Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
103
104/* Generate Users Manual Doxyfile */
105var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
106tplt.genFile("./docs/Doxyfile",pcielldReleaseVersion);
107
108/* Generate Settings.xdc */
109var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
110tplt.genFile("./Settings.xdc",pcielldReleaseVersion);
111
112/* Generate paver.h */
113var tplt = xdc.loadTemplate("./pciever.h.xdt");
114tplt.genFile("./pciever.h",pcielldReleaseVersion);
115
116/*********************************************************************
117 *********************** INSTALL-JAMMER Support **********************
118 * In order to create the InstallJammer Application; we need to UNTAR
119 * the package into a temporary directory. This is required because
120 * currently the InstallJammer does not support the TAR Files and thus
121 * creating an UNTAR of the file. So to work-around the problem we will
122 * do the following in the EPILOGUE Section:-
123 * (a) Create a temporary directory called 'tmp'
124 * (b) UNTAR the package into 'tmp'
125 * (c) Run the INSTALL Jammer on 'tmp'
126 * (d) Remove the 'tmp' directory.
127 *
128 * This can be done only after the 'release' package has been created.
129 * Thus all of this work is being done in the EPILOGUE.
130 *********************************************************************/
131if (pcielldInstallType == "SETUP")
132{
133 /* Create the Install Jammer Version Variable. This is used inside the
134 * MPI File to create the Final executable.
135 * The format supported is as follows:-
136 * - setupwin32_pcielld-<part_number>-<version>.exe
137 */
138 var InstallJammerVersion = "-DVersion " + pcielldPartNumber + "_" +
139 pcielldReleaseVersion[0] + "_" + pcielldReleaseVersion[1] + "_" +
140 pcielldReleaseVersion[2] + "_" + pcielldReleaseVersion[3];
141
142 /* This is the location where the tmp directory is located; this is used as
143 * the input directory for the Install Jammer. */
144 var PackageBaseDir = " -DPackageBaseDir " + pcielldPath + "./tmp";
145
146 /* This is the location where the PCIE LLD will be installed by default. */
147 var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/pcielld" + "_" +
148 pcielldPartNumber + "_" +
149 pcielldReleaseVersion[0] + "_" + pcielldReleaseVersion[1] + "_" +
150 pcielldReleaseVersion[2] + "_" + pcielldReleaseVersion[3];
151
152 /* Create the actual EPILOGUE Section for the INSTALLER */
153 Pkg.makeEpilogue += "release: install_application\n";
154 Pkg.makeEpilogue += "install_application: firmware\n";
155 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";
156 Pkg.makeEpilogue += "\t @echo Creating the Install\n";
157 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";
158 Pkg.makeEpilogue += "\t -$(MKDIR) tmp\n";
159 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/packages\n";
160 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/eclipse\n";
161 Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n";
162 Pkg.makeEpilogue += "\t tar -xf ./packages/" + pcielldRTSCFileName + ".tar" + " -Ctmp/packages \n";
163 Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir +
164 " --output-dir packages/ --build install/pcielld.mpi\n";
165 Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q tmp\n\n";
166
167 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */
168 Pkg.makeEpilogue += "clean::\n";
169 Pkg.makeEpilogue += "\t $(RM) packages/*.exe\n";
170 Pkg.makeEpilogue += "\t $(RM) packages/*.bin\n";
171 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q eclipse\n";
172 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q tmp\n";
173}
174
175if (miniBuild == "ON")
176{
177 /***************************************************************************
178 ********************************* MINI Package ****************************
179 ***************************************************************************/
180 /* Create the MINI RTSC Package */
181 var additionalFiles = [];
182
183 var libUtility = xdc.loadCapsule ("build/buildlib.xs");
184 libUtility.createMiniPkg(pcielldRTSCFileName, additionalFiles);
185}
186
187