build.ck 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*++
  2. Copyright (c) 2017 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. LZMA Module
  9. Abstract:
  10. This directory builds the LZMA module, which enables compressing and
  11. decompressing Minoca LZMA streams.
  12. Author:
  13. Evan Green 22-May-2017
  14. Environment:
  15. C
  16. --*/
  17. from menv import compiledSources, group, mconfig, staticLibrary;
  18. from apps.ck.modules.build import chalkSharedModule;
  19. function build() {
  20. var buildOs = mconfig.build_os;
  21. var commonSources;
  22. var lib;
  23. var entries;
  24. var objs;
  25. commonSources = [
  26. "entry.c",
  27. "lzma.c"
  28. ];
  29. //
  30. // Create the static and dynamic versions of the module targeted at Minoca.
  31. //
  32. lib = {
  33. "label": "lzma_static",
  34. "output": "lzma",
  35. "inputs": commonSources + ["apps/lib/lzma:liblzma"]
  36. };
  37. objs = compiledSources(lib);
  38. entries = staticLibrary(lib);
  39. lib = {
  40. "label": "lzma_dynamic",
  41. "output": "lzma",
  42. "inputs": objs[0]
  43. };
  44. entries += chalkSharedModule(lib);
  45. lib = {
  46. "label": "build_lzma_static",
  47. "output": "lzma",
  48. "inputs": commonSources + ["apps/lib/lzma:build_liblzma"],
  49. "build": true,
  50. "prefix": "build"
  51. };
  52. objs = compiledSources(lib);
  53. entries += staticLibrary(lib);
  54. lib = {
  55. "label": "build_lzma_dynamic",
  56. "output": "lzma",
  57. "inputs": objs[0],
  58. "build": true,
  59. "prefix": "build"
  60. };
  61. entries += chalkSharedModule(lib);
  62. entries += group("all", [":lzma_static", ":lzma_dynamic"]);
  63. entries += group("build_all",
  64. [":build_lzma_static", ":build_lzma_dynamic"]);
  65. return entries;
  66. }