wolfssl.bld 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Generally there is no need to edit this file!
  3. *
  4. * This file controls which libraries are built, as well as compiler options
  5. * to use.
  6. *
  7. * The contents of this file usually don't change, but having it in your
  8. * ownership allows you to tweak your compiler options. If you do change
  9. * this file, however, on the next upgrade of the product we recommend
  10. * that you take "wolfssl.bld" file as supplied by the upgrade and then merge
  11. * your changes with it.
  12. */
  13. /*
  14. * ======== wolfssl.bld ========
  15. * This script is run prior to all build scripts. It sets host-system-
  16. * independent values for targets and platforms, then it attempts to
  17. * find the host-system-specific user.bld script that sets rootDirs.
  18. *
  19. * These settings may be a function of the following global variables:
  20. *
  21. * environment a hash table of environment strings
  22. *
  23. * arguments an array of string arguments to the _config.bld script
  24. * initialized as follows:
  25. * arguments[0] - the file name of the _config.bld script
  26. * arguments[1] - the first argument specified in XDCARGS
  27. * :
  28. * arguments[n] - the n'th argument in XDCARGS
  29. *
  30. * Build an alias for xdc.om.xdc.bld.BuildEnvironment
  31. */
  32. var armOpts = " -ms ";
  33. var gnuOpts = "";
  34. var iarOpts = "";
  35. /* Uncomment the following lines to build libraries for debug mode: */
  36. // Pkg.attrs.profile = "debug";
  37. // armOpts += " -g -o0 ";
  38. // gnuOpts += " -g ";
  39. // iarOpts += " --debug ";
  40. var ccOpts = {
  41. "ti.targets.arm.elf.M4F" : armOpts,
  42. "gnu.targets.arm.M4F" : gnuOpts,
  43. "iar.targets.arm.M4F" : iarOpts,
  44. };
  45. /* initialize local vars with those set in xdcpaths.mak (via XDCARGS) */
  46. for (arg = 0; arg < arguments.length; arg++) {
  47. /*
  48. * Get the compiler's installation directory.
  49. * For "ti.targets.arm.elf.M4F=/vendors/arm/6.1.0",
  50. * we get "/vendors/arm/6.1.0"
  51. */
  52. var targetName = arguments[arg].split("=")[0];
  53. var rootDir = arguments[arg].split("=")[1];
  54. /* only build for the specified compilers */
  55. if (rootDir == "" || rootDir == undefined) {
  56. continue;
  57. }
  58. if (targetName.match(/^TivaWareDir/) ) {
  59. TivaWareDir = rootDir;
  60. continue;
  61. }
  62. var target = xdc.useModule(targetName);
  63. target.rootDir = rootDir;
  64. target.ccOpts.suffix += ccOpts[targetName];
  65. Build.targets.$add(target);
  66. }
  67. /* Include Path (needed to find NDK headers) */
  68. var ndkPath = "$(NDK_INSTALL_DIR)/packages/ti/ndk/";
  69. var wolfsslPathInclude = " -I" + ndkPath + "/inc/bsd -DWOLFSSL_TIRTOS ";
  70. /* lib/ is a generated directory that 'xdc clean' should remove */
  71. var Pkg = xdc.useModule('xdc.bld.PackageContents');
  72. Pkg.generatedFiles.$add("lib/");