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