1 /******************************************************************************
2 * FILE PURPOSE: Fault Management Source module specification file.
3 ******************************************************************************
4 * FILE NAME: module.xs
5 *
6 * DESCRIPTION:
7 * This file contains the module specification for the Fault Management source directory.
8 *
9 * Copyright (C) 2012-2015, Texas Instruments, Inc.
10 *****************************************************************************/
12 /* Load the library utility. */
13 var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
15 var fault_mgmtLibFiles = [
16 "src/fault_mgmt.c",
17 "src/fm_clean.c",
18 "src/fm_exclusion.c",
19 ];
21 /**************************************************************************
22 * FUNCTION NAME : modBuild
23 **************************************************************************
24 * DESCRIPTION :
25 * The function is used to build all the components of the Fault
26 * Management library
27 **************************************************************************/
28 function modBuild()
29 {
30 /* Build the device independent libraries for all the targets specified. */
31 if (socs["all"].build == "true")
32 {
33 for (var targets=0; targets < socs["all"].targets.length; targets++)
34 {
35 var targetFiles = fault_mgmtLibFiles.slice(); /* make copy */
36 var libOptions = {
37 copts: socs["all"].copts,
38 incs: lldIncludePath,
39 };
40 libUtility.buildLibrary ("", "false", libOptions, Pkg.name, socs["all"].targets[targets], targetFiles);
41 }
42 }
44 /* Build library targets for device dependent SoCs */
45 for (var soc=0; soc < soc_names.length; soc++)
46 {
47 var dev = socs[soc_names[soc]];
49 /* do not proceed if this SoC is not configured to be built */
50 if (dev.build == "false")
51 continue;
53 if (dev.socDevLib == "true")
54 {
55 var targetFiles_soc = fault_mgmtLibFiles.slice(); /* make copy */
56 targetFiles_soc.push (deviceConstruct[0]+soc_names[soc]+deviceConstruct[1]);
57 /* Build the libraries for all the targets specified. */
58 for (var targets=0; targets < dev.targets.length; targets++)
59 {
60 var libOptions = {
61 copts: dev.copts,
62 incs: lldIncludePath,
63 };
64 libUtility.buildLibrary (soc_names[soc], "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc);
65 }
66 }
67 }
69 /* Add all the .c files to the release package. */
70 var testFiles = libUtility.listAllFiles (".c", "src", true);
71 for (var k = 0 ; k < testFiles.length; k++)
72 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
74 /* Add all the .h files to the release package. */
75 var testFiles = libUtility.listAllFiles (".h", "src", true);
76 for (var k = 0 ; k < testFiles.length; k++)
77 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
78 }