/****************************************************************************** * FILE PURPOSE: Build description for the TCP3D Driver ****************************************************************************** * FILE NAME: package.bld * * DESCRIPTION: * This file contains the build specification and description for the TCP3D driver * * The file takes the following parameters from the command line through the * XDCARGS variable. * XDCARGS[0] = TCP3D Driver Install Type * Valid Values are "TAR" or "SETUP" * DEFAULT is "TAR" * * Example for a valid command: * xdc XDCARGS=SETUP release * * Copyright (C) 2011, Texas Instruments, Inc. *****************************************************************************/ /* List of all subdirectories that combine to make the TCP3D Driver Package. */ var subDirectories = [ "src", "docs", "example", "test" ]; /* Determine if we need to create the InstallJammer Application or not? * TCP3D Driver deliverables be either of the following formats: * - TAR Ball Package * - Setup Executable * DEFAULT is a TAR package. */ if ((arguments[0] != "TAR") && (arguments[0] != "SETUP")) tcp3dDriverInstallType = Pkg.attrs.archiver; else tcp3dDriverInstallType = arguments[0]; /* Irrespective of the InstallType we always create a TAR Ball Package as a part * of the RTSC Build. Here we determine the name of the TAR Ball Package * Format is as follows: * tcp3d_ */ var tcp3dRTSCFileName = "tcp3d" + "_" + tcp3dPartNumber + "_" + tcp3dDriverReleaseVersion[0] + "_" + tcp3dDriverReleaseVersion[1] + "_" + tcp3dDriverReleaseVersion[2] + "_" + tcp3dDriverReleaseVersion[3]; /****************************************************************** ************************ Release Banner ************************** ******************************************************************/ print ("************* TCP3D Driver Build Information *************"); print ("TCP3D Driver Install : " + tcp3dDriverInstallType); print ("TCP3D Driver Version : " + tcp3dDriverReleaseVersion); print ("Tools Directory : " + toolsBaseDir); print ("RTSC File Name : " + tcp3dRTSCFileName); print ("TCP3D Driver Path : " + tcp3dDriverPath); print ("Coverity Analysis : " + (coverityAnalysis == "ON" ? "ON" : "OFF")); print ("CC LE opts : " + C66LE.ccOpts.prefix); print ("CC BE opts : " + C66BE.ccOpts.prefix); print ("**********************************************************"); /* Create the release package for the TCP3D Driver */ Pkg.defaultRelease = Pkg.addRelease (tcp3dRTSCFileName, {prefix: "./packages/"}); /* Cycle through all the sub-directories and build all the files */ for (var i = 0; i < subDirectories.length; i++) { /* Load the capsule in the sub directory. */ var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs"); print ("Building directory " + subDirectories[i]); /* Build the capsule. */ caps.modBuild(); /* Package the module.xs files for building via package */ Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs"; } /* Package the remaining files */ Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld"; Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld"; Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc"; Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs"; Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc"; Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt"; Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3d_drv.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3d_osal.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3d_drv_types.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3dver.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "tcp3dver.h.xdt"; Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/TCP3D_DRV_doxconfig"; Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/TCP3D_DRV_doxconfig.xdt"; Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs"; Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile"; /* Generate Users Manual Doxyfile */ var tplt = xdc.loadTemplate("./docs/TCP3D_DRV_doxconfig.xdt"); tplt.genFile("./docs/TCP3D_DRV_doxconfig",tcp3dDriverReleaseVersion); /* Generate Settings.xdc */ var tplt = xdc.loadTemplate("./Settings.xdc.xdt"); tplt.genFile("./Settings.xdc",tcp3dDriverReleaseVersion); /* Generate paver.h */ var tplt = xdc.loadTemplate("./tcp3dver.h.xdt"); tplt.genFile("./tcp3dver.h",tcp3dDriverReleaseVersion); /* Generate eclipse sample file */ var tplt = xdc.loadTemplate("./docs/eclipse/sample.xml.xdt"); tplt.genFile("./docs/eclipse/sample.xml",tcp3dDriverReleaseVersion); /*************************************************************************** ********************************* MINI Package **************************** ***************************************************************************/ /* Check if we need to create the mini package? */ var miniBuild = java.lang.System.getenv("MINI_PACKAGE"); if (miniBuild == "ON") { /* Create the MINI RTSC Package */ var additionalFiles = []; var libUtility = xdc.loadCapsule ("build/buildlib.xs"); libUtility.createMiniPkg(tcp3dRTSCFileName, additionalFiles); } /********************************************************************* *********************** INSTALL-JAMMER Support ********************** * In order to create the InstallJammer Application; we need to UNTAR * the package into a temporary directory. This is required because * currently the InstallJammer does not support the TAR Files and thus * creating an UNTAR of the file. So to work-around the problem we will * do the following in the EPILOGUE Section:- * (a) Create a temporary directory called 'tmp' * (b) UNTAR the package into 'tmp' * (c) Run the INSTALL Jammer on 'tmp' * (d) Remove the 'tmp' directory. * * This can be done only after the 'release' package has been created. * Thus all of this work is being done in the EPILOGUE. *********************************************************************/ if (tcp3dDriverInstallType == "SETUP") { /* Create the Install Jammer Version Variable. This is used inside the * MPI File to create the Final executable. * The format supported is as follows:- * - setupwin32_tcp3d__.exe */ var InstallJammerVersion = "-DVersion " + tcp3dPartNumber + "_" + tcp3dDriverReleaseVersion[0] + "_" + tcp3dDriverReleaseVersion[1] + "_" + tcp3dDriverReleaseVersion[2] + "_" + tcp3dDriverReleaseVersion[3]; /* This is the location where the tmp directory is located; this is used as * the input directory for the Install Jammer. */ var PackageBaseDir = " -DPackageBaseDir " + tcp3dDriverPath + "./tmp"; /* This is the location where the TCP3D Driver will be installed by default. */ var WinInstallDir = " -DWinInstallDir " + "C:/ti/tcp3d" + "_" + tcp3dPartNumber + "_" + tcp3dDriverReleaseVersion[0] + "_" + tcp3dDriverReleaseVersion[1] + "_" + tcp3dDriverReleaseVersion[2] + "_" + tcp3dDriverReleaseVersion[3]; /* Create the actual EPILOGUE Section for the INSTALLER */ Pkg.makeEpilogue += "release: install_application\n"; Pkg.makeEpilogue += "install_application:\n"; Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n"; Pkg.makeEpilogue += "\t @echo Creating the Install\n"; Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n"; Pkg.makeEpilogue += "\t -$(MKDIR) tmp\n"; Pkg.makeEpilogue += "\t -$(MKDIR) tmp/packages\n"; Pkg.makeEpilogue += "\t -$(MKDIR) tmp/eclipse\n"; Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n"; Pkg.makeEpilogue += "\t tar -xf ./packages/" + tcp3dRTSCFileName + ".tar" + " -Ctmp/packages \n"; Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir + " --output-dir packages/ --build install/tcp3d.mpi\n"; Pkg.makeEpilogue += "\t -$(RMDIR) tmp\n\n"; } /* We need to clean after ourselves; extend the 'clean' target to take care of this. */ Pkg.makeEpilogue += "clean::\n"; Pkg.makeEpilogue += "\t -$(RM) .xdcenv.mak\n"; Pkg.makeEpilogue += "\t -$(RM) tcp3dver.h\n"; Pkg.makeEpilogue += "\t -$(RM) Settings.xdc\n"; Pkg.makeEpilogue += "\t -$(RM) makefile\n"; Pkg.makeEpilogue += "\t -$(RM) docs/TCP3D_DRV_APIIF.chm\n"; Pkg.makeEpilogue += "\t -$(RM) docs/TCP3D_DRV_doxconfig\n"; Pkg.makeEpilogue += "\t -$(RM) docs/eclipse/sample.xml\n"; Pkg.makeEpilogue += "\t -$(RMDIR) docs/doxy/rtf\n"; Pkg.makeEpilogue += "\t -$(RMDIR) docs/doxy/html\n"; Pkg.makeEpilogue += "\t -$(RMDIR) lib\n"; // for (var i = 0; i < devices.length; i++) // { // Pkg.makeEpilogue += "\t -$(RMDIR) lib/" + devices[i].split("/")[0] + "\n"; // } if (tcp3dDriverInstallType == "SETUP") { Pkg.makeEpilogue += "\t -$(RM) packages/*.exe\n"; Pkg.makeEpilogue += "\t -$(RM) packages/*.bin\n"; Pkg.makeEpilogue += "\t -$(RMDIR) eclipse\n"; Pkg.makeEpilogue += "\t -$(RMDIR) tmp\n"; } if (miniBuild == "ON") { Pkg.makeEpilogue += "\t -$(RM) simpleC66LE.mak\n"; Pkg.makeEpilogue += "\t -$(RM) simpleC66BE.mak\n"; }