1 /*
2 * Copyright (c) 2010-2013, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
33 /*
34 * ======== package.bld ========
35 */
37 var UtilsBuild = xdc.loadCapsule("ti/sdo/utils/Build.xs");
39 var objList = [
40 "NameServer",
41 "NameServerRemoteNull",
42 "List",
43 "MultiProc",
44 ];
47 /* generate makefiles */
48 UtilsBuild.buildLibs(objList, undefined, null, arguments);
50 /* generate smp makefiles */
51 UtilsBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
53 Pkg.otherFiles = [
54 "package.bld",
55 "_MultiProc.h",
56 "_NameServer.h",
57 "UTILS.c",
58 "makefile.xdt",
59 "makefile_gccArmLto.xdt",
60 "instrumented.cfg.xs", "nonInstrumented.cfg.xs",
61 "instrumented.cfg", "nonInstrumented.cfg",
62 "smpInstrumented.cfg", "smpNonInstrumented.cfg",
63 ];
65 var testArray = [
66 { name: 'instrumented',
67 config: "instrumented",
68 libdir: "instrumented",
69 },
70 { name: 'nonInstrumented',
71 config: "nonInstrumented",
72 libdir: "nonInstrumented",
73 },
74 ];
76 /* Build non-SMP pre-built libs */
77 for each (var targ in Build.targets) {
79 /* For each test... */
80 for each (var test in testArray) {
82 var platform = test.platform ? test.platform : targ.platform;
84 var cfg = Pkg.addConfiguration(test.name,
85 targ, platform, {
86 cfgScript: test.config,
87 prelink: false,
88 profile: "release",
89 exportCfg: false,
90 exportSrc: false,
91 });
93 var myLib = "lib/utils/"
94 + test.libdir + "/utils.a" + targ.suffix;
96 Pkg.otherFiles[Pkg.otherFiles.length++] = myLib;
97 }
98 }
100 var smpTestArray = [
101 { name: 'smpInstrumented',
102 config: "smpInstrumented",
103 libdir: "instrumented",
104 },
105 { name: 'smpNonInstrumented',
106 config: "smpNonInstrumented",
107 libdir: "nonInstrumented",
108 },
109 ];
111 /* Build SMP pre-built libs */
112 for each (var targ in Build.targets) {
114 if (targ.profiles["smp"] === undefined) continue;
116 /* For each test... */
117 for each (var test in smpTestArray) {
118 var platform = test.platform ? test.platform : targ.platform;
120 var cfg = Pkg.addConfiguration(test.name,
121 targ, platform, {
122 cfgScript: test.config,
123 prelink: false,
124 profile: "release",
125 exportCfg: false,
126 exportSrc: false,
127 });
129 var myLib = "lib/smputils/"
130 + test.libdir + "/utils.a" + targ.suffix;
132 Pkg.otherFiles[Pkg.otherFiles.length++] = myLib;
133 }
134 }
137 /* include source files in the release package */
138 Pkg.attrs.exportSrc = true;
139 Pkg.attrs.exportCfg = true;
141 Pkg.generatedFiles.$add("lib/");