/****************************************************************************** * FILE PURPOSE: Build description for the MCBSP Driver ****************************************************************************** * FILE NAME: package.bld * * DESCRIPTION: * This file contains the build specification and description for the MCBSP driver * * The file takes the following parameters from the command line through the * XDCARGS variable. * XDCARGS[0] = MCBSP Driver Install Type * Valid Values are "TAR" or "SETUP" * DEFAULT is "SETUP" * * Example for a valid command: * xdc XDCARGS="SETUP" release * * Copyright (C) 2012, Texas Instruments, Inc. *****************************************************************************/ /* List of all subdirectories that combine to make the MCBSP Driver Package. */ var subDirectories = [ "src", "docs", "include", "example" ]; var mcbspDriverInstallType; /* Determine if we need to create the InstallJammer Application or not? * MCBSP LLD Deliverables be either of the following formats: * - TAR Ball Package * - Setup Executable * DEFAULT is a SETUP Executable. */ if ((arguments[0] != "TAR") && (arguments[0] != "SETUP")) mcbspDriverInstallType = "TAR"; else mcbspDriverInstallType = 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: * mcbsp_ */ var mcbspRTSCFileName = "mcbsp" + "_" + mcbspLLDPartNumber + "_" + mcbspDriverReleaseVersion[0] + "_" + mcbspDriverReleaseVersion[1] + "_" + mcbspDriverReleaseVersion[2] + "_" + mcbspDriverReleaseVersion[3]; /****************************************************************** ************************ Release Banner ************************** ******************************************************************/ print ("************* MCBSP Driver Build Information *************"); print ("MCBSP Driver Install : " + mcbspDriverInstallType); print ("MCBSP Driver LLD Version : " + mcbspDriverReleaseVersion); print ("Tools Directory : " + toolsBaseDir); print ("RTSC File Name : " + mcbspRTSCFileName); print ("MCBSP Driver LLD Path : " + mcbspDriverPath); 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 MCBSP LLD */ Pkg.defaultRelease = Pkg.addRelease (mcbspRTSCFileName, {prefix: "./packages/"}); /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently * not supported in the XDC tools being used. Currenly builds need to be done with the * following options:- * xdc MK_FIXLISTOPTS=-t release * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */ //Pkg.attrs = {archiver : "zip"}; /* 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++] = "mcbsp_drv.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_osal.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_types.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbspver.h"; Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbspver.h.xdt"; Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile"; Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt"; Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs"; Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile"; /* Generate Users Manual Doxyfile */ var tplt = xdc.loadTemplate("./docs/doxyfile.xdt"); tplt.genFile("./docs/Doxyfile",mcbspDriverReleaseVersion); /* Generate Settings.xdc */ var tplt = xdc.loadTemplate("./Settings.xdc.xdt"); tplt.genFile("./Settings.xdc",mcbspDriverReleaseVersion); /* Generate paver.h */ var tplt = xdc.loadTemplate("./mcbspver.h.xdt"); tplt.genFile("./mcbspver.h",mcbspDriverReleaseVersion); /********************************************************************* *********************** 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 (mcbspDriverInstallType == "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_mcbsp__.exe */ var InstallJammerVersion = "-DVersion " + mcbspLLDPartNumber + "_" + mcbspDriverReleaseVersion[0] + "_" + mcbspDriverReleaseVersion[1] + "_" + mcbspDriverReleaseVersion[2] + "_" + mcbspDriverReleaseVersion[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 " + mcbspDriverPath + "./tmp"; /* This is the location where the MCBSP LLD will be installed by default. */ var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/mcbsp" + "_" + mcbspLLDPartNumber + "_" + mcbspDriverReleaseVersion[0] + "_" + mcbspDriverReleaseVersion[1] + "_" + mcbspDriverReleaseVersion[2] + "_" + mcbspDriverReleaseVersion[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/" + mcbspRTSCFileName + ".tar" + " -Ctmp/packages \n"; Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir + " --output-dir packages/ --build install/mcbsplld.mpi\n"; Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q 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) packages/*.exe\n"; Pkg.makeEpilogue += "\t $(RM) packages/*.bin\n"; Pkg.makeEpilogue += "\t $(RMDIR) /S /Q eclipse\n"; Pkg.makeEpilogue += "\t $(RMDIR) /S /Q tmp\n"; } /*************************************************************************** ********************************* MINI Package **************************** ***************************************************************************/ /* Check if we need to create the mini package? */ if (miniBuild == "ON") { /* Create the MINI RTSC Package */ var libUtility = xdc.loadCapsule ("build/buildlib.xs"); libUtility.createMiniPkg(mcbspRTSCFileName); }