1 /******************************************************************************\r
2 * FILE PURPOSE: OSAL 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 osal Driver\r
8 *\r
9 * Copyright (C) 2015-2016, 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 \r
16 /**************************************************************************\r
17 * FUNCTION NAME : modBuild\r
18 **************************************************************************\r
19 * DESCRIPTION :\r
20 * The function is used to build the osal LLD Driver and to add the core\r
21 * driver files to the package. \r
22 **************************************************************************/\r
23 function modBuild() \r
24 {\r
25 if (socs.length != 0)\r
26 {\r
27 /* Build the target libs for TI RTOS libraries, SOC independent */\r
28 var targetFiles_tirtos = osTypes["tirtos"].srcFile.slice(); /* make copy */\r
29 for (var target=0; target < Build.targets.length; target++)\r
30 {\r
31 var libOptions = {\r
32 copts: osTypes["tirtos"].copts,\r
33 incs: osalIncludePath, \r
34 }\r
35 libUtility.buildLibrary ("tirtos", "", libOptions, Pkg.name, Build.targets[target], targetFiles_tirtos); \r
36 \r
37 }\r
38 \r
39 /* Build the target libs for SoC specific RTOS*/ \r
40 for each(var soc in soc_names)\r
41 { \r
42 var dev = socs[soc];\r
43 var targetFiles_tirtos_soc;\r
44 \r
45 if (dev.familyType == "keystone") {\r
46 targetFiles_tirtos_soc = osTypes["tirtos"].srcFile.slice().concat(keyStoneFamilySrcFiles["tirtos"].srcFile.slice());\r
47 }\r
48 else {\r
49 targetFiles_tirtos_soc = osTypes["tirtos"].srcFile.slice().concat(amFamilySrcFiles["tirtos"].srcFile.slice()); \r
50 }\r
51 \r
52 /* Don't build if it is not configured */\r
53 if (dev.build == "false")\r
54 continue;\r
55 \r
56 /* Build the libraries for the soc targets */\r
57 for (var target=0; target < dev.targets.length; target++)\r
58 {\r
59 print (" Building for Soc: " + soc + " target : " + dev.targets[target] );\r
60 var copts_loc = osTypes["tirtos"].copts + " " + dev.copts;\r
61 var libOptions = {\r
62 copts: copts_loc,\r
63 incs: osalIncludePath, \r
64 }\r
65 libUtility.buildLibrary ("tirtos", soc, libOptions, Pkg.name, dev.targets[target], targetFiles_tirtos_soc); \r
66 }\r
67 } \r
68 \r
69 /* Build the target libs for SoC specific NON OS */ \r
70 /* Build the libraries for the SoCs */\r
71 for each(var soc in soc_names)\r
72 { \r
73 var dev = socs[soc];\r
74 var targetFiles_nonos;\r
75 \r
76 if (dev.familyType == "keystone") {\r
77 targetFiles_nonos = osTypes["nonos"].srcFile.slice().concat(keyStoneFamilySrcFiles["nonos"].srcFile.slice());\r
78 }\r
79 else {\r
80 targetFiles_nonos = osTypes["nonos"].srcFile.slice().concat(amFamilySrcFiles["nonos"].srcFile.slice()); \r
81 }\r
82 \r
83 /* Don't build if it is not configured */\r
84 if (dev.build == "false")\r
85 continue;\r
86 \r
87 /* Build the libraries for the soc targets */\r
88 for (var target=0; target < dev.targets.length; target++)\r
89 {\r
90 print (" Building for Soc: " + soc + " target : " + dev.targets[target] );\r
91 var copts_loc = osTypes["nonos"].copts + " " + dev.copts;\r
92 var libOptions = {\r
93 copts: copts_loc,\r
94 incs: osalIncludePath, \r
95 }\r
96 libUtility.buildLibrary ("nonos", soc, libOptions, Pkg.name, dev.targets[target], targetFiles_nonos); \r
97 }\r
98 } \r
99 } \r
100 /* Add all the .c files to the release package. */\r
101 var testFiles = libUtility.listAllFiles (".c", "src", true);\r
102 for (var k = 0 ; k < testFiles.length; k++)\r
103 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
104 \r
105 var testFiles = libUtility.listAllFiles (".c", "arch", true);\r
106 for (var k = 0 ; k < testFiles.length; k++)\r
107 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
108 \r
109 \r
110 /* Add all the .h files to the release package. */\r
111 var testFiles = libUtility.listAllFiles (".h", "src", true);\r
112 for (var k = 0 ; k < testFiles.length; k++)\r
113 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
114 /* Add all the .mk files to the release package. */\r
115 var mkFiles = libUtility.listAllFiles (".mk", "src", true);\r
116 for (var k = 0 ; k < mkFiles.length; k++)\r
117 Pkg.otherFiles[Pkg.otherFiles.length++] = mkFiles[k];\r
118 \r
119 /* Add all the .asm files to the release package. */\r
120 var asmFiles = libUtility.listAllFiles (".asm", "arch", true);\r
121 for (var k = 0 ; k < asmFiles.length; k++)\r
122 Pkg.otherFiles[Pkg.otherFiles.length++] = asmFiles[k];\r
123 \r
124 }\r
125 \r