1 /******************************************************************************\r
2 * FILE PURPOSE: UART Driver Source Module specification file.\r
3 ******************************************************************************\r
4 * FILE NAME: module.xs\r
5 *\r
6 * DESCRIPTION: \r
7 * This file contains the module specification for the UART Driver\r
8 *\r
9 * Copyright (C) 2009-2015, Texas Instruments, Inc.\r
10 *****************************************************************************/\r
11 \r
12 /* Load the library utility. */\r
13 var libUtility = xdc.loadCapsule ("../build/buildlib.xs");\r
14 \r
15 /* List of all the UART Driver Files */\r
16 var uartSockLibFiles = [\r
17 "src/UART_drv.c",\r
18 "src/v1/UART_v1.c",\r
19 "src/v0/UART_v0.c",\r
20 "src/UART_stdio.c",\r
21 "src/UART_ascii_utils.c",\r
22 "src/UART_status.c"\r
23 ];\r
24 \r
25 /**************************************************************************\r
26 * FUNCTION NAME : modBuild\r
27 **************************************************************************\r
28 * DESCRIPTION :\r
29 * The function is used to build the UART LLD Driver and to add the core\r
30 * driver files to the package. \r
31 **************************************************************************/\r
32 function modBuild() \r
33 {\r
34 if (socs.length != 0)\r
35 {\r
36 /* Build the device independent libraries for all the targets specified. */\r
37 for (var targets=0; targets < socs["all"].targets.length; targets++)\r
38 {\r
39 var targetFiles = uartSockLibFiles.slice(); /* make copy */\r
40 var libOptions = {\r
41 copts: socs["all"].copts,\r
42 incs: lldIncludePath, \r
43 };\r
44 libUtility.buildLibrary ("", "false", "false", libOptions, Pkg.name, socs["all"].targets[targets], targetFiles);\r
45 libUtility.buildLibrary ("", "false", "false", libOptions, Pkg.name, socs["all"].targets[targets], targetFiles, true);\r
46 }\r
47 \r
48 /* Build library targets for device dependent SoCs */\r
49 for (var soc=0; soc < soc_names.length; soc++) \r
50 {\r
51 var dev = socs[soc_names[soc]];\r
52 \r
53 /* do not proceed if this SoC is not configured to be built */\r
54 if (dev.build == "false")\r
55 continue;\r
56 \r
57 var soc_name = soc_names[soc];\r
58 if ( soc_name.equals("k2k") )\r
59 soc_name = "k2h";\r
60 \r
61 if (dev.socDevLib == "true")\r
62 { \r
63 var targetFiles_soc = uartSockLibFiles.slice(); /* make copy */\r
64 \r
65 targetFiles_soc.push (deviceConstruct[0]+soc_name+deviceConstruct[1]);\r
66 /* Build the libraries for all the targets specified. */\r
67 for (var targets=0; targets < dev.targets.length; targets++)\r
68 {\r
69 var libOptions = {\r
70 copts: dev.copts,\r
71 incs: lldIncludePath, \r
72 };\r
73 libUtility.buildLibrary (soc_names[soc], "false", "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc);\r
74 libUtility.buildLibrary (soc_names[soc], "false", "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc, true);\r
75 }\r
76 }\r
77 \r
78 if (dev.dmaDevLib == "true")\r
79 {\r
80 var targetFiles_soc_dma = uartSockLibFiles.slice(); /* make copy */\r
81 targetFiles_soc_dma.push (deviceDmaConstruct[0]+soc_name+deviceDmaConstruct[1]);\r
82 \r
83 /* Build the libraries for all the targets specified. */\r
84 for (var targets=0; targets < dev.targets.length; targets++)\r
85 {\r
86 var libOptions = {\r
87 copts: dev.copts,\r
88 incs: lldIncludePath, \r
89 };\r
90 libUtility.buildLibrary (soc_names[soc], "true", "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc_dma);\r
91 libUtility.buildLibrary (soc_names[soc], "true", "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc_dma, true);\r
92 }\r
93 }\r
94 }\r
95 }\r
96 \r
97 /* Add all the .c files to the release package. */\r
98 var testFiles = libUtility.listAllFiles (".c", "src", true);\r
99 for (var k = 0 ; k < testFiles.length; k++)\r
100 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
101 \r
102 /* Add all the .h files to the release package. */\r
103 var testFiles = libUtility.listAllFiles (".h", "src", true);\r
104 for (var k = 0 ; k < testFiles.length; k++)\r
105 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
106 \r
107 /* Add all the .mk files to the release package. */\r
108 var mkFiles = libUtility.listAllFiles (".mk", "src", true);\r
109 for (var k = 0 ; k < mkFiles.length; k++)\r
110 Pkg.otherFiles[Pkg.otherFiles.length++] = mkFiles[k];\r
111 \r
112 }\r
113 \r