]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/sa-lld.git/blob - package.bld
Fix build issues for AM65xx and J7
[keystone-rtos/sa-lld.git] / package.bld
1 /******************************************************************************
2  * FILE PURPOSE: Build description for the SA LLD Package
3  ******************************************************************************
4  * FILE NAME: package.bld
5  *
6  * DESCRIPTION:
7  *  This file contains the build specification and description for the SA LLD
8  *
9  *  The file takes the following parameters from the command line through the
10  *  XDCARGS variable.
11  *      XDCARGS[0] = SA LLD Install Type
12  *      Valid Values are "TAR" or "SETUP"
13  *      DEFAULT is "SETUP"
14  *
15  *  Example for a valid command:
16  *      xdc XDCARGS="SETUP" release
17  *
18  * Copyright (C) 2012-2018, Texas Instruments, Inc.
19  *****************************************************************************/
21 /* List of all subdirectories that combine to make the SA LLD Package. */
22 var subDirectories = [ "src", "docs", "fw", "example", "test"];
24 /* Determine if we need to create the InstallJammer Application or not?
25  * SA LLD Deliverables be either of the following formats:
26  *  - TAR Ball Package
27  *  - Setup Executable
28  * DEFAULT is a TAR Executable. */
30 if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))
31     lldInstallType = "TAR";
32 else
33     lldInstallType = arguments[0];
35 /* Irrespective of the InstallType we always create a TAR Ball Package as a part
36  * of the RTSC Build. Here we determine the name of the TAR Ball Package
37  *  Format is as follows:
38  *      salld_<version> */
39 var lldRTSCFileName = "salld" + "_" +
40                          lldReleaseVersion[0] + "_" +  lldReleaseVersion[1] + "_" +
41                          lldReleaseVersion[2]  + "_" + lldReleaseVersion[3];
43 var package_type = java.lang.System.getenv("PDK_PACKAGE_TYPE");
45 /******************************************************************
46  ************************ Release Banner **************************
47  ******************************************************************/
49 print ("************* SA LLD Build Information *************");
50 print ("SA LLD Install             : " + lldInstallType);
51 print ("SA LLD Version             : " + lldReleaseVersion);
52 print ("C66 Tools Directory        : " + c66ToolsBaseDir);
53 print ("A15 Tools Directory        : " + a15ToolsBaseDir);
54 print ("RTSC File Name             : " + lldRTSCFileName);
55 print ("SA LLD Path                : " + lldPath);
56 if (pOpts == 1)
57 {
58     print ("CC LE opts                 : " + C66LE.ccOpts.prefix);
59     print ("A15 basic opts             : " + A15LE.ccOpts.prefix);
60 }
61 print ("***********************************************************");
63 /* Create the release package for the SA LLD */
64 Pkg.defaultRelease = Pkg.addRelease (lldRTSCFileName, {prefix: "./packages/"});
66 /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
67  * not supported in the XDC tools being used. Currenly builds need to be done with the
68  * following options:-
69  *   xdc MK_FIXLISTOPTS=-t release
70  * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
71  * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
72 //Pkg.attrs = {archiver : "zip"};
74 if (package_type != "package_type_makefile")
75 {
76     /* Cycle through all the sub-directories and build all the files */
77     for (var i = 0; i < subDirectories.length; i++)
78     {
79         /* Load the capsule in the sub directory. */
80         var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");
82         print ("Building directory " + subDirectories[i]);
84         /* Build the capsule. */
85         caps.modBuild();
87         /* Package the module.xs files for building via package */
88         Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
89     }
91     /* Package the remaining files */
92     Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
93     Pkg.otherFiles[Pkg.otherFiles.length++] = "config_mk.bld";
94     Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
95     Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
96     Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
97     Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
98     Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
99     Pkg.otherFiles[Pkg.otherFiles.length++] = "salld.h";
100     Pkg.otherFiles[Pkg.otherFiles.length++] = "saver.h";
101     Pkg.otherFiles[Pkg.otherFiles.length++] = "saver.h.xdt";
102     Pkg.otherFiles[Pkg.otherFiles.length++] = "sa_osal.h";
103     Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
104     Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile.xdt";
105     Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
106     Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
107     Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile_armv7";
108     Pkg.otherFiles[Pkg.otherFiles.length++] = "sa_component.mk";
109     Pkg.otherFiles[Pkg.otherFiles.length++] = "build//makefile_lite2.mk";
110     Pkg.otherFiles[Pkg.otherFiles.length++] = "build/armv7/libsa_aearmv7.mk";
111     Pkg.otherFiles[Pkg.otherFiles.length++] = "util/coreDump/k2e/armv7/linux/build/makefile";
112     Pkg.otherFiles[Pkg.otherFiles.length++] = "util/coreDump/k2h/armv7/linux/build/makefile";
113     Pkg.otherFiles[Pkg.otherFiles.length++] = "util/coreDump/k2k/armv7/linux/build/makefile";
114     Pkg.otherFiles[Pkg.otherFiles.length++] = "util/coreDump/k2l/armv7/linux/build/makefile";
115     Pkg.otherFiles[Pkg.otherFiles.length++] = "util/coreDump/utilSaCoreDumpUtil.c";
116     Pkg.otherFiles[Pkg.otherFiles.length++] = "util/utilSaOsal.c";
118     if (pkgLibExplicitly == 1)
119     {
120         Pkg.otherFiles[Pkg.otherFiles.length++] = "./lib";
121     }
123     /* Generate Users Manual Doxyfile */
124     var tplt = xdc.loadTemplate("./docs/Doxyfile.xdt");
125     tplt.genFile("./docs/Doxyfile",lldReleaseVersion);
128 /* Check if we need to create the mini package? */
129 var xdcplugin_gen = java.lang.System.getenv("ECLIPSE_PLUGIN_GEN");
131 if (xdcplugin_gen=="NULL")
133   /* There is no action */
135 else
137   /* Eclipse Plugin generation is needed s */
138   var tplt = xdc.loadTemplate("./eclipse/sample.xml.xdt");
139   tplt.genFile("./eclipse/sample.xml",lldReleaseVersion);
143 /* Generate Settings.xdc */
144 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
145 tplt.genFile("./Settings.xdc",lldReleaseVersion);
147 /* Generate saver.h */
148 var tplt = xdc.loadTemplate("./saver.h.xdt");
149 tplt.genFile("./saver.h",lldReleaseVersion);